Android.mk revision dccca44ffda4836b56a21da95a046c9708ffd49c
1LOCAL_PATH:= $(call my-dir) 2include $(CLEAR_VARS) 3LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 4 5HWUI_NEW_OPS := true 6 7# Enables fine-grained GLES error checking 8# If set to true, every GLES call is wrapped & error checked 9# Has moderate overhead 10HWUI_ENABLE_OPENGL_VALIDATION := true 11 12hwui_src_files := \ 13 font/CacheTexture.cpp \ 14 font/Font.cpp \ 15 hwui/Canvas.cpp \ 16 hwui/MinikinSkia.cpp \ 17 hwui/MinikinUtils.cpp \ 18 hwui/PaintImpl.cpp \ 19 hwui/TypefaceImpl.cpp \ 20 renderstate/Blend.cpp \ 21 renderstate/MeshState.cpp \ 22 renderstate/OffscreenBufferPool.cpp \ 23 renderstate/PixelBufferState.cpp \ 24 renderstate/RenderState.cpp \ 25 renderstate/Scissor.cpp \ 26 renderstate/Stencil.cpp \ 27 renderstate/TextureState.cpp \ 28 renderthread/CanvasContext.cpp \ 29 renderthread/DrawFrameTask.cpp \ 30 renderthread/EglManager.cpp \ 31 renderthread/RenderProxy.cpp \ 32 renderthread/RenderTask.cpp \ 33 renderthread/RenderThread.cpp \ 34 renderthread/TimeLord.cpp \ 35 thread/TaskManager.cpp \ 36 utils/Blur.cpp \ 37 utils/GLUtils.cpp \ 38 utils/LinearAllocator.cpp \ 39 utils/NinePatchImpl.cpp \ 40 utils/StringUtils.cpp \ 41 utils/TestWindowContext.cpp \ 42 utils/VectorDrawableUtils.cpp \ 43 AmbientShadow.cpp \ 44 AnimationContext.cpp \ 45 Animator.cpp \ 46 AnimatorManager.cpp \ 47 AssetAtlas.cpp \ 48 Caches.cpp \ 49 CanvasState.cpp \ 50 ClipArea.cpp \ 51 DamageAccumulator.cpp \ 52 DeferredDisplayList.cpp \ 53 DeferredLayerUpdater.cpp \ 54 DeviceInfo.cpp \ 55 DisplayList.cpp \ 56 DisplayListCanvas.cpp \ 57 Dither.cpp \ 58 Extensions.cpp \ 59 FboCache.cpp \ 60 FontRenderer.cpp \ 61 FrameInfo.cpp \ 62 FrameInfoVisualizer.cpp \ 63 GammaFontRenderer.cpp \ 64 GlopBuilder.cpp \ 65 GpuMemoryTracker.cpp \ 66 GradientCache.cpp \ 67 Image.cpp \ 68 Interpolator.cpp \ 69 JankTracker.cpp \ 70 Layer.cpp \ 71 LayerCache.cpp \ 72 LayerRenderer.cpp \ 73 LayerUpdateQueue.cpp \ 74 Matrix.cpp \ 75 OpenGLRenderer.cpp \ 76 Patch.cpp \ 77 PatchCache.cpp \ 78 PathCache.cpp \ 79 PathTessellator.cpp \ 80 PathParser.cpp \ 81 PixelBuffer.cpp \ 82 Program.cpp \ 83 ProgramCache.cpp \ 84 Properties.cpp \ 85 PropertyValuesHolder.cpp \ 86 PropertyValuesAnimatorSet.cpp \ 87 RenderBufferCache.cpp \ 88 RenderNode.cpp \ 89 RenderProperties.cpp \ 90 ResourceCache.cpp \ 91 ShadowTessellator.cpp \ 92 SkiaCanvas.cpp \ 93 SkiaCanvasProxy.cpp \ 94 SkiaShader.cpp \ 95 Snapshot.cpp \ 96 SpotShadow.cpp \ 97 TessellationCache.cpp \ 98 TextDropShadowCache.cpp \ 99 Texture.cpp \ 100 TextureCache.cpp \ 101 VectorDrawable.cpp \ 102 protos/hwui.proto 103 104hwui_test_common_src_files := \ 105 $(call all-cpp-files-under, tests/common/scenes) \ 106 tests/common/TestContext.cpp \ 107 tests/common/TestScene.cpp \ 108 tests/common/TestUtils.cpp 109 110hwui_cflags := \ 111 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \ 112 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \ 113 -Wall -Wno-unused-parameter -Wunreachable-code -Werror 114 115# GCC false-positives on this warning, and since we -Werror that's 116# a problem 117hwui_cflags += -Wno-free-nonheap-object 118 119ifeq (true, $(HWUI_NEW_OPS)) 120 hwui_src_files += \ 121 BakedOpDispatcher.cpp \ 122 BakedOpRenderer.cpp \ 123 BakedOpState.cpp \ 124 FrameBuilder.cpp \ 125 LayerBuilder.cpp \ 126 OpDumper.cpp \ 127 RecordingCanvas.cpp 128 129 hwui_cflags += -DHWUI_NEW_OPS 130 131endif 132 133ifndef HWUI_COMPILE_SYMBOLS 134 hwui_cflags += -fvisibility=hidden 135endif 136 137ifdef HWUI_COMPILE_FOR_PERF 138 # TODO: Non-arm? 139 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs 140endif 141 142# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS 143# which varies depending on what is being built 144define hwui_proto_include 145$(call local-generated-sources-dir)/proto/$(LOCAL_PATH) 146endef 147 148hwui_c_includes += \ 149 external/skia/include/private \ 150 external/skia/src/core \ 151 external/harfbuzz_ng/src \ 152 external/freetype/include 153 154ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT)) 155 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT 156 hwui_c_includes += \ 157 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \ 158 frameworks/rs/cpp \ 159 frameworks/rs 160endif 161 162ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION)) 163 hwui_cflags += -include debug/wrap_gles.h 164 hwui_src_files += debug/wrap_gles.cpp 165 hwui_c_includes += frameworks/native/opengl/libs/GLES2 166 hwui_cflags += -DDEBUG_OPENGL=3 167endif 168 169 170# ------------------------ 171# static library 172# ------------------------ 173 174include $(CLEAR_VARS) 175 176LOCAL_MODULE_CLASS := STATIC_LIBRARIES 177LOCAL_MODULE := libhwui_static 178LOCAL_CFLAGS := $(hwui_cflags) 179LOCAL_SRC_FILES := $(hwui_src_files) 180LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 181LOCAL_EXPORT_C_INCLUDE_DIRS := \ 182 $(LOCAL_PATH) \ 183 $(hwui_c_includes) \ 184 $(call hwui_proto_include) 185 186include $(LOCAL_PATH)/hwui_static_deps.mk 187include $(BUILD_STATIC_LIBRARY) 188 189# ------------------------ 190# static library null gpu 191# ------------------------ 192 193include $(CLEAR_VARS) 194 195LOCAL_MODULE_CLASS := STATIC_LIBRARIES 196LOCAL_MODULE := libhwui_static_null_gpu 197LOCAL_CFLAGS := \ 198 $(hwui_cflags) \ 199 -DHWUI_NULL_GPU 200LOCAL_SRC_FILES := \ 201 $(hwui_src_files) \ 202 debug/nullegl.cpp \ 203 debug/nullgles.cpp 204LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 205LOCAL_EXPORT_C_INCLUDE_DIRS := \ 206 $(LOCAL_PATH) \ 207 $(hwui_c_includes) \ 208 $(call hwui_proto_include) 209 210include $(LOCAL_PATH)/hwui_static_deps.mk 211include $(BUILD_STATIC_LIBRARY) 212 213# ------------------------ 214# shared library 215# ------------------------ 216 217include $(CLEAR_VARS) 218 219LOCAL_MODULE_CLASS := SHARED_LIBRARIES 220LOCAL_MODULE := libhwui 221LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static 222LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 223 224include $(LOCAL_PATH)/hwui_static_deps.mk 225include $(BUILD_SHARED_LIBRARY) 226 227# ------------------------ 228# unit tests 229# ------------------------ 230 231include $(CLEAR_VARS) 232 233LOCAL_MODULE := hwui_unit_tests 234LOCAL_MODULE_TAGS := tests 235LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu 236LOCAL_SHARED_LIBRARIES := libmemunreachable 237LOCAL_CFLAGS := \ 238 $(hwui_cflags) \ 239 -DHWUI_NULL_GPU 240 241LOCAL_SRC_FILES += \ 242 $(hwui_test_common_src_files) \ 243 tests/unit/main.cpp \ 244 tests/unit/CanvasStateTests.cpp \ 245 tests/unit/ClipAreaTests.cpp \ 246 tests/unit/DamageAccumulatorTests.cpp \ 247 tests/unit/DeviceInfoTests.cpp \ 248 tests/unit/FatVectorTests.cpp \ 249 tests/unit/GlopBuilderTests.cpp \ 250 tests/unit/GpuMemoryTrackerTests.cpp \ 251 tests/unit/LayerUpdateQueueTests.cpp \ 252 tests/unit/LinearAllocatorTests.cpp \ 253 tests/unit/MatrixTests.cpp \ 254 tests/unit/OffscreenBufferPoolTests.cpp \ 255 tests/unit/SkiaBehaviorTests.cpp \ 256 tests/unit/StringUtilsTests.cpp \ 257 tests/unit/TextDropShadowCacheTests.cpp \ 258 tests/unit/VectorDrawableTests.cpp \ 259 tests/unit/GradientCacheTests.cpp 260 261ifeq (true, $(HWUI_NEW_OPS)) 262 LOCAL_SRC_FILES += \ 263 tests/unit/BakedOpDispatcherTests.cpp \ 264 tests/unit/BakedOpRendererTests.cpp \ 265 tests/unit/BakedOpStateTests.cpp \ 266 tests/unit/FrameBuilderTests.cpp \ 267 tests/unit/LeakCheckTests.cpp \ 268 tests/unit/OpDumperTests.cpp \ 269 tests/unit/RecordingCanvasTests.cpp 270endif 271 272include $(LOCAL_PATH)/hwui_static_deps.mk 273include $(BUILD_NATIVE_TEST) 274 275# ------------------------ 276# Macro-bench app 277# ------------------------ 278 279include $(CLEAR_VARS) 280 281LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp 282LOCAL_MODULE:= hwuitest 283LOCAL_MODULE_TAGS := tests 284LOCAL_MODULE_CLASS := EXECUTABLES 285LOCAL_MULTILIB := both 286LOCAL_MODULE_STEM_32 := hwuitest 287LOCAL_MODULE_STEM_64 := hwuitest64 288LOCAL_CFLAGS := $(hwui_cflags) 289 290# set to libhwui_static_null_gpu to skip actual GL commands 291LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static 292 293LOCAL_SRC_FILES += \ 294 $(hwui_test_common_src_files) \ 295 tests/macrobench/TestSceneRunner.cpp \ 296 tests/macrobench/main.cpp 297 298include $(LOCAL_PATH)/hwui_static_deps.mk 299include $(BUILD_EXECUTABLE) 300 301# ------------------------ 302# Micro-bench app 303# --------------------- 304include $(CLEAR_VARS) 305 306LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp 307LOCAL_MODULE:= hwuimicro 308LOCAL_MODULE_TAGS := tests 309LOCAL_MODULE_CLASS := EXECUTABLES 310LOCAL_MULTILIB := both 311LOCAL_MODULE_STEM_32 := hwuimicro 312LOCAL_MODULE_STEM_64 := hwuimicro64 313LOCAL_CFLAGS := \ 314 $(hwui_cflags) \ 315 -DHWUI_NULL_GPU 316 317LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu 318LOCAL_STATIC_LIBRARIES := libgoogle-benchmark 319 320LOCAL_SRC_FILES += \ 321 $(hwui_test_common_src_files) \ 322 tests/microbench/main.cpp \ 323 tests/microbench/DisplayListCanvasBench.cpp \ 324 tests/microbench/LinearAllocatorBench.cpp \ 325 tests/microbench/PathParserBench.cpp \ 326 tests/microbench/ShadowBench.cpp \ 327 tests/microbench/TaskManagerBench.cpp 328 329ifeq (true, $(HWUI_NEW_OPS)) 330 LOCAL_SRC_FILES += \ 331 tests/microbench/FrameBuilderBench.cpp 332endif 333 334include $(LOCAL_PATH)/hwui_static_deps.mk 335include $(BUILD_EXECUTABLE) 336