Android.mk revision f1480761c1a83aecd09cdd473ec797a41d1a2f3f
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 := false 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/Typeface.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 Readback.cpp \ 88 RenderBufferCache.cpp \ 89 RenderNode.cpp \ 90 RenderProperties.cpp \ 91 ResourceCache.cpp \ 92 ShadowTessellator.cpp \ 93 SkiaCanvas.cpp \ 94 SkiaCanvasProxy.cpp \ 95 SkiaShader.cpp \ 96 Snapshot.cpp \ 97 SpotShadow.cpp \ 98 TessellationCache.cpp \ 99 TextDropShadowCache.cpp \ 100 Texture.cpp \ 101 TextureCache.cpp \ 102 VectorDrawable.cpp \ 103 protos/hwui.proto 104 105hwui_test_common_src_files := \ 106 $(call all-cpp-files-under, tests/common/scenes) \ 107 tests/common/LeakChecker.cpp \ 108 tests/common/TestListViewSceneBase.cpp \ 109 tests/common/TestContext.cpp \ 110 tests/common/TestScene.cpp \ 111 tests/common/TestUtils.cpp 112 113hwui_debug_common_src_files := \ 114 debug/wrap_gles.cpp \ 115 debug/DefaultGlesDriver.cpp \ 116 debug/GlesErrorCheckWrapper.cpp \ 117 debug/GlesDriver.cpp \ 118 debug/FatalBaseDriver.cpp \ 119 debug/NullGlesDriver.cpp 120 121hwui_cflags := \ 122 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \ 123 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \ 124 -Wall -Wno-unused-parameter -Wunreachable-code -Werror 125 126# GCC false-positives on this warning, and since we -Werror that's 127# a problem 128hwui_cflags += -Wno-free-nonheap-object 129 130# clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629 131hwui_cflags += -Wno-missing-braces 132 133ifeq (true, $(HWUI_NEW_OPS)) 134 hwui_src_files += \ 135 BakedOpDispatcher.cpp \ 136 BakedOpRenderer.cpp \ 137 BakedOpState.cpp \ 138 FrameBuilder.cpp \ 139 LayerBuilder.cpp \ 140 OpDumper.cpp \ 141 RecordingCanvas.cpp 142 143 hwui_cflags += -DHWUI_NEW_OPS 144 145endif 146 147ifndef HWUI_COMPILE_SYMBOLS 148 hwui_cflags += -fvisibility=hidden 149endif 150 151ifdef HWUI_COMPILE_FOR_PERF 152 # TODO: Non-arm? 153 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs 154endif 155 156# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS 157# which varies depending on what is being built 158define hwui_proto_include 159$(call local-generated-sources-dir)/proto/$(LOCAL_PATH) 160endef 161 162hwui_c_includes += \ 163 external/skia/include/private \ 164 external/skia/src/core \ 165 external/harfbuzz_ng/src \ 166 external/freetype/include 167 168ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT)) 169 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT 170 hwui_c_includes += \ 171 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \ 172 frameworks/rs/cpp \ 173 frameworks/rs 174endif 175 176# ------------------------ 177# static library 178# ------------------------ 179 180include $(CLEAR_VARS) 181 182LOCAL_MODULE_CLASS := STATIC_LIBRARIES 183LOCAL_MODULE := libhwui_static 184LOCAL_CFLAGS := $(hwui_cflags) 185LOCAL_SRC_FILES := $(hwui_src_files) 186 187ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION)) 188 LOCAL_CFLAGS += -include debug/wrap_gles.h 189 LOCAL_CFLAGS += -DDEBUG_OPENGL=3 190 LOCAL_SRC_FILES += $(hwui_debug_common_src_files) 191endif 192 193LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 194LOCAL_EXPORT_C_INCLUDE_DIRS := \ 195 $(LOCAL_PATH) \ 196 $(call hwui_proto_include) 197 198include $(LOCAL_PATH)/hwui_static_deps.mk 199include $(BUILD_STATIC_LIBRARY) 200 201# ------------------------ 202# static library null gpu 203# ------------------------ 204 205include $(CLEAR_VARS) 206 207LOCAL_MODULE_CLASS := STATIC_LIBRARIES 208LOCAL_MODULE := libhwui_static_debug 209LOCAL_CFLAGS := \ 210 $(hwui_cflags) \ 211 -include debug/wrap_gles.h \ 212 -DHWUI_NULL_GPU 213LOCAL_SRC_FILES := \ 214 $(hwui_src_files) \ 215 $(hwui_debug_common_src_files) \ 216 debug/nullegl.cpp 217LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 218LOCAL_EXPORT_C_INCLUDE_DIRS := \ 219 $(LOCAL_PATH) \ 220 $(call hwui_proto_include) 221 222include $(LOCAL_PATH)/hwui_static_deps.mk 223include $(BUILD_STATIC_LIBRARY) 224 225# ------------------------ 226# shared library 227# ------------------------ 228 229include $(CLEAR_VARS) 230 231LOCAL_MODULE_CLASS := SHARED_LIBRARIES 232LOCAL_MODULE := libhwui 233LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static 234LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 235 236include $(LOCAL_PATH)/hwui_static_deps.mk 237include $(BUILD_SHARED_LIBRARY) 238 239# ------------------------ 240# unit tests 241# ------------------------ 242 243include $(CLEAR_VARS) 244 245LOCAL_MODULE := hwui_unit_tests 246LOCAL_MODULE_TAGS := tests 247LOCAL_STATIC_LIBRARIES := libgmock libhwui_static_debug 248LOCAL_SHARED_LIBRARIES := libmemunreachable 249LOCAL_CFLAGS := \ 250 $(hwui_cflags) \ 251 -include debug/wrap_gles.h \ 252 -DHWUI_NULL_GPU 253LOCAL_C_INCLUDES := $(hwui_c_includes) 254 255LOCAL_SRC_FILES += \ 256 $(hwui_test_common_src_files) \ 257 tests/unit/main.cpp \ 258 tests/unit/CanvasStateTests.cpp \ 259 tests/unit/ClipAreaTests.cpp \ 260 tests/unit/DamageAccumulatorTests.cpp \ 261 tests/unit/DeviceInfoTests.cpp \ 262 tests/unit/FatVectorTests.cpp \ 263 tests/unit/FontRendererTests.cpp \ 264 tests/unit/GlopBuilderTests.cpp \ 265 tests/unit/GpuMemoryTrackerTests.cpp \ 266 tests/unit/GradientCacheTests.cpp \ 267 tests/unit/LayerUpdateQueueTests.cpp \ 268 tests/unit/LinearAllocatorTests.cpp \ 269 tests/unit/MatrixTests.cpp \ 270 tests/unit/MeshStateTests.cpp \ 271 tests/unit/OffscreenBufferPoolTests.cpp \ 272 tests/unit/RenderNodeTests.cpp \ 273 tests/unit/RenderPropertiesTests.cpp \ 274 tests/unit/SkiaBehaviorTests.cpp \ 275 tests/unit/SnapshotTests.cpp \ 276 tests/unit/StringUtilsTests.cpp \ 277 tests/unit/TestUtilsTests.cpp \ 278 tests/unit/TextDropShadowCacheTests.cpp \ 279 tests/unit/VectorDrawableTests.cpp 280 281ifeq (true, $(HWUI_NEW_OPS)) 282 LOCAL_SRC_FILES += \ 283 tests/unit/BakedOpDispatcherTests.cpp \ 284 tests/unit/BakedOpRendererTests.cpp \ 285 tests/unit/BakedOpStateTests.cpp \ 286 tests/unit/FrameBuilderTests.cpp \ 287 tests/unit/LeakCheckTests.cpp \ 288 tests/unit/OpDumperTests.cpp \ 289 tests/unit/RecordingCanvasTests.cpp \ 290 tests/unit/SkiaCanvasTests.cpp 291endif 292 293include $(LOCAL_PATH)/hwui_static_deps.mk 294include $(BUILD_NATIVE_TEST) 295 296# ------------------------ 297# Macro-bench app 298# ------------------------ 299 300include $(CLEAR_VARS) 301 302LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp 303LOCAL_MODULE:= hwuitest 304LOCAL_MODULE_TAGS := tests 305LOCAL_MODULE_CLASS := EXECUTABLES 306LOCAL_MULTILIB := both 307LOCAL_MODULE_STEM_32 := hwuitest 308LOCAL_MODULE_STEM_64 := hwuitest64 309LOCAL_CFLAGS := $(hwui_cflags) 310LOCAL_C_INCLUDES := $(hwui_c_includes) 311 312# set to libhwui_static_debug to skip actual GL commands 313LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static 314LOCAL_SHARED_LIBRARIES := libmemunreachable 315LOCAL_STATIC_LIBRARIES := libgoogle-benchmark 316 317LOCAL_SRC_FILES += \ 318 $(hwui_test_common_src_files) \ 319 tests/macrobench/TestSceneRunner.cpp \ 320 tests/macrobench/main.cpp 321 322include $(LOCAL_PATH)/hwui_static_deps.mk 323include $(BUILD_EXECUTABLE) 324 325# ------------------------ 326# Micro-bench app 327# --------------------- 328include $(CLEAR_VARS) 329 330LOCAL_MODULE:= hwuimicro 331LOCAL_MODULE_TAGS := tests 332LOCAL_CFLAGS := \ 333 $(hwui_cflags) \ 334 -include debug/wrap_gles.h \ 335 -DHWUI_NULL_GPU 336 337LOCAL_C_INCLUDES := $(hwui_c_includes) 338 339LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_debug 340LOCAL_SHARED_LIBRARIES := libmemunreachable 341 342LOCAL_SRC_FILES += \ 343 $(hwui_test_common_src_files) \ 344 tests/microbench/main.cpp \ 345 tests/microbench/DisplayListCanvasBench.cpp \ 346 tests/microbench/FontBench.cpp \ 347 tests/microbench/LinearAllocatorBench.cpp \ 348 tests/microbench/PathParserBench.cpp \ 349 tests/microbench/ShadowBench.cpp \ 350 tests/microbench/TaskManagerBench.cpp 351 352ifeq (true, $(HWUI_NEW_OPS)) 353 LOCAL_SRC_FILES += \ 354 tests/microbench/FrameBuilderBench.cpp 355endif 356 357include $(LOCAL_PATH)/hwui_static_deps.mk 358include $(BUILD_NATIVE_BENCHMARK) 359