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