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