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