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