Android.mk revision 6cc3a25db5b5479f3896afa18615d2476fc3a569
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 := true 11 12hwui_src_files := \ 13 font/CacheTexture.cpp \ 14 font/Font.cpp \ 15 renderstate/Blend.cpp \ 16 renderstate/MeshState.cpp \ 17 renderstate/OffscreenBufferPool.cpp \ 18 renderstate/PixelBufferState.cpp \ 19 renderstate/RenderState.cpp \ 20 renderstate/Scissor.cpp \ 21 renderstate/Stencil.cpp \ 22 renderstate/TextureState.cpp \ 23 renderthread/CanvasContext.cpp \ 24 renderthread/DrawFrameTask.cpp \ 25 renderthread/EglManager.cpp \ 26 renderthread/RenderProxy.cpp \ 27 renderthread/RenderTask.cpp \ 28 renderthread/RenderThread.cpp \ 29 renderthread/TimeLord.cpp \ 30 thread/TaskManager.cpp \ 31 utils/Blur.cpp \ 32 utils/GLUtils.cpp \ 33 utils/LinearAllocator.cpp \ 34 utils/NinePatchImpl.cpp \ 35 utils/StringUtils.cpp \ 36 utils/TestWindowContext.cpp \ 37 utils/VectorDrawableUtils.cpp \ 38 AmbientShadow.cpp \ 39 AnimationContext.cpp \ 40 Animator.cpp \ 41 AnimatorManager.cpp \ 42 AssetAtlas.cpp \ 43 Caches.cpp \ 44 Canvas.cpp \ 45 CanvasState.cpp \ 46 ClipArea.cpp \ 47 DamageAccumulator.cpp \ 48 DeferredDisplayList.cpp \ 49 DeferredLayerUpdater.cpp \ 50 DeviceInfo.cpp \ 51 DisplayList.cpp \ 52 DisplayListCanvas.cpp \ 53 Dither.cpp \ 54 Extensions.cpp \ 55 FboCache.cpp \ 56 FontRenderer.cpp \ 57 FrameInfo.cpp \ 58 FrameInfoVisualizer.cpp \ 59 GammaFontRenderer.cpp \ 60 GlopBuilder.cpp \ 61 GpuMemoryTracker.cpp \ 62 GradientCache.cpp \ 63 Image.cpp \ 64 Interpolator.cpp \ 65 JankTracker.cpp \ 66 Layer.cpp \ 67 LayerCache.cpp \ 68 LayerRenderer.cpp \ 69 LayerUpdateQueue.cpp \ 70 Matrix.cpp \ 71 OpenGLRenderer.cpp \ 72 Patch.cpp \ 73 PatchCache.cpp \ 74 PathCache.cpp \ 75 PathTessellator.cpp \ 76 PathParser.cpp \ 77 PixelBuffer.cpp \ 78 Program.cpp \ 79 ProgramCache.cpp \ 80 Properties.cpp \ 81 PropertyValuesHolder.cpp \ 82 PropertyValuesAnimatorSet.cpp \ 83 RenderBufferCache.cpp \ 84 RenderNode.cpp \ 85 RenderProperties.cpp \ 86 ResourceCache.cpp \ 87 ShadowTessellator.cpp \ 88 SkiaCanvas.cpp \ 89 SkiaCanvasProxy.cpp \ 90 SkiaShader.cpp \ 91 Snapshot.cpp \ 92 SpotShadow.cpp \ 93 TessellationCache.cpp \ 94 TextDropShadowCache.cpp \ 95 Texture.cpp \ 96 TextureCache.cpp \ 97 VectorDrawable.cpp \ 98 protos/hwui.proto 99 100hwui_test_common_src_files := \ 101 $(call all-cpp-files-under, tests/common/scenes) \ 102 tests/common/TestContext.cpp \ 103 tests/common/TestScene.cpp \ 104 tests/common/TestUtils.cpp 105 106hwui_cflags := \ 107 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \ 108 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \ 109 -Wall -Wno-unused-parameter -Wunreachable-code -Werror 110 111# GCC false-positives on this warning, and since we -Werror that's 112# a problem 113hwui_cflags += -Wno-free-nonheap-object 114 115ifeq (true, $(HWUI_NEW_OPS)) 116 hwui_src_files += \ 117 BakedOpDispatcher.cpp \ 118 BakedOpRenderer.cpp \ 119 BakedOpState.cpp \ 120 FrameBuilder.cpp \ 121 LayerBuilder.cpp \ 122 RecordingCanvas.cpp 123 124 hwui_cflags += -DHWUI_NEW_OPS 125 126endif 127 128ifndef HWUI_COMPILE_SYMBOLS 129 hwui_cflags += -fvisibility=hidden 130endif 131 132ifdef HWUI_COMPILE_FOR_PERF 133 # TODO: Non-arm? 134 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs 135endif 136 137# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS 138# which varies depending on what is being built 139define hwui_proto_include 140$(call local-generated-sources-dir)/proto/$(LOCAL_PATH) 141endef 142 143hwui_c_includes += \ 144 external/skia/include/private \ 145 external/skia/src/core 146 147ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT)) 148 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT 149 hwui_c_includes += \ 150 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \ 151 frameworks/rs/cpp \ 152 frameworks/rs 153endif 154 155ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION)) 156 hwui_cflags += -include debug/wrap_gles.h 157 hwui_src_files += debug/wrap_gles.cpp 158 hwui_c_includes += frameworks/native/opengl/libs/GLES2 159 hwui_cflags += -DDEBUG_OPENGL=3 160endif 161 162 163# ------------------------ 164# static library 165# ------------------------ 166 167include $(CLEAR_VARS) 168 169LOCAL_MODULE_CLASS := STATIC_LIBRARIES 170LOCAL_MODULE := libhwui_static 171LOCAL_CFLAGS := $(hwui_cflags) 172LOCAL_SRC_FILES := $(hwui_src_files) 173LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 174LOCAL_EXPORT_C_INCLUDE_DIRS := \ 175 $(LOCAL_PATH) \ 176 $(hwui_c_includes) \ 177 $(call hwui_proto_include) 178 179include $(LOCAL_PATH)/hwui_static_deps.mk 180include $(BUILD_STATIC_LIBRARY) 181 182# ------------------------ 183# static library null gpu 184# ------------------------ 185 186include $(CLEAR_VARS) 187 188LOCAL_MODULE_CLASS := STATIC_LIBRARIES 189LOCAL_MODULE := libhwui_static_null_gpu 190LOCAL_CFLAGS := \ 191 $(hwui_cflags) \ 192 -DHWUI_NULL_GPU 193LOCAL_SRC_FILES := \ 194 $(hwui_src_files) \ 195 debug/nullegl.cpp \ 196 debug/nullgles.cpp 197LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 198LOCAL_EXPORT_C_INCLUDE_DIRS := \ 199 $(LOCAL_PATH) \ 200 $(hwui_c_includes) \ 201 $(call hwui_proto_include) 202 203include $(LOCAL_PATH)/hwui_static_deps.mk 204include $(BUILD_STATIC_LIBRARY) 205 206# ------------------------ 207# shared library 208# ------------------------ 209 210include $(CLEAR_VARS) 211 212LOCAL_MODULE_CLASS := SHARED_LIBRARIES 213LOCAL_MODULE := libhwui 214LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static 215LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 216 217include $(LOCAL_PATH)/hwui_static_deps.mk 218include $(BUILD_SHARED_LIBRARY) 219 220# ------------------------ 221# unit tests 222# ------------------------ 223 224include $(CLEAR_VARS) 225 226LOCAL_MODULE := hwui_unit_tests 227LOCAL_MODULE_TAGS := tests 228LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu 229LOCAL_CFLAGS := \ 230 $(hwui_cflags) \ 231 -DHWUI_NULL_GPU 232 233LOCAL_SRC_FILES += \ 234 $(hwui_test_common_src_files) \ 235 tests/unit/CanvasStateTests.cpp \ 236 tests/unit/ClipAreaTests.cpp \ 237 tests/unit/CrashHandlerInjector.cpp \ 238 tests/unit/DamageAccumulatorTests.cpp \ 239 tests/unit/DeviceInfoTests.cpp \ 240 tests/unit/FatVectorTests.cpp \ 241 tests/unit/GpuMemoryTrackerTests.cpp \ 242 tests/unit/LayerUpdateQueueTests.cpp \ 243 tests/unit/LinearAllocatorTests.cpp \ 244 tests/unit/OffscreenBufferPoolTests.cpp \ 245 tests/unit/SkiaBehaviorTests.cpp \ 246 tests/unit/StringUtilsTests.cpp \ 247 tests/unit/TextDropShadowCacheTests.cpp \ 248 tests/unit/VectorDrawableTests.cpp \ 249 tests/unit/GradientCacheTests.cpp 250 251ifeq (true, $(HWUI_NEW_OPS)) 252 LOCAL_SRC_FILES += \ 253 tests/unit/BakedOpStateTests.cpp \ 254 tests/unit/FrameBuilderTests.cpp \ 255 tests/unit/LeakCheckTests.cpp \ 256 tests/unit/RecordingCanvasTests.cpp 257endif 258 259include $(LOCAL_PATH)/hwui_static_deps.mk 260include $(BUILD_NATIVE_TEST) 261 262# ------------------------ 263# Macro-bench app 264# ------------------------ 265 266include $(CLEAR_VARS) 267 268LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp 269LOCAL_MODULE:= hwuitest 270LOCAL_MODULE_TAGS := tests 271LOCAL_MODULE_CLASS := EXECUTABLES 272LOCAL_MULTILIB := both 273LOCAL_MODULE_STEM_32 := hwuitest 274LOCAL_MODULE_STEM_64 := hwuitest64 275LOCAL_CFLAGS := $(hwui_cflags) 276 277# set to libhwui_static_null_gpu to skip actual GL commands 278LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static 279 280LOCAL_SRC_FILES += \ 281 $(hwui_test_common_src_files) \ 282 tests/macrobench/TestSceneRunner.cpp \ 283 tests/macrobench/main.cpp 284 285include $(LOCAL_PATH)/hwui_static_deps.mk 286include $(BUILD_EXECUTABLE) 287 288# ------------------------ 289# Micro-bench app 290# --------------------- 291include $(CLEAR_VARS) 292 293LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp 294LOCAL_MODULE:= hwuimicro 295LOCAL_MODULE_TAGS := tests 296LOCAL_MODULE_CLASS := EXECUTABLES 297LOCAL_MULTILIB := both 298LOCAL_MODULE_STEM_32 := hwuimicro 299LOCAL_MODULE_STEM_64 := hwuimicro64 300LOCAL_CFLAGS := \ 301 $(hwui_cflags) \ 302 -DHWUI_NULL_GPU 303LOCAL_C_INCLUDES += bionic/benchmarks/ 304 305LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu 306LOCAL_STATIC_LIBRARIES := libbenchmark libbase 307 308LOCAL_SRC_FILES += \ 309 $(hwui_test_common_src_files) \ 310 tests/microbench/DisplayListCanvasBench.cpp \ 311 tests/microbench/LinearAllocatorBench.cpp \ 312 tests/microbench/PathParserBench.cpp \ 313 tests/microbench/ShadowBench.cpp \ 314 tests/microbench/TaskManagerBench.cpp 315 316ifeq (true, $(HWUI_NEW_OPS)) 317 LOCAL_SRC_FILES += \ 318 tests/microbench/FrameBuilderBench.cpp 319endif 320 321include $(LOCAL_PATH)/hwui_static_deps.mk 322include $(BUILD_EXECUTABLE) 323