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