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