Android.mk revision 9640477e3cc075b0f303e817a3ebcc72d7bc878b
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 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 RenderBufferCache.cpp \ 82 RenderNode.cpp \ 83 RenderProperties.cpp \ 84 ResourceCache.cpp \ 85 ShadowTessellator.cpp \ 86 SkiaCanvas.cpp \ 87 SkiaCanvasProxy.cpp \ 88 SkiaShader.cpp \ 89 Snapshot.cpp \ 90 SpotShadow.cpp \ 91 TessellationCache.cpp \ 92 TextDropShadowCache.cpp \ 93 Texture.cpp \ 94 TextureCache.cpp \ 95 VectorDrawable.cpp \ 96 protos/hwui.proto 97 98hwui_test_common_src_files := \ 99 $(call all-cpp-files-under, tests/common/scenes) \ 100 tests/common/TestContext.cpp \ 101 tests/common/TestScene.cpp \ 102 tests/common/TestUtils.cpp 103 104hwui_cflags := \ 105 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \ 106 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \ 107 -Wall -Wno-unused-parameter -Wunreachable-code -Werror 108 109# GCC false-positives on this warning, and since we -Werror that's 110# a problem 111hwui_cflags += -Wno-free-nonheap-object 112 113ifeq (true, $(HWUI_NEW_OPS)) 114 hwui_src_files += \ 115 BakedOpDispatcher.cpp \ 116 BakedOpRenderer.cpp \ 117 BakedOpState.cpp \ 118 FrameBuilder.cpp \ 119 LayerBuilder.cpp \ 120 RecordingCanvas.cpp 121 122 hwui_cflags += -DHWUI_NEW_OPS 123 124endif 125 126ifndef HWUI_COMPILE_SYMBOLS 127 hwui_cflags += -fvisibility=hidden 128endif 129 130ifdef HWUI_COMPILE_FOR_PERF 131 # TODO: Non-arm? 132 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs 133endif 134 135# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS 136# which varies depending on what is being built 137define hwui_proto_include 138$(call local-generated-sources-dir)/proto/$(LOCAL_PATH) 139endef 140 141hwui_c_includes += \ 142 external/skia/include/private \ 143 external/skia/src/core 144 145hwui_shared_libraries := \ 146 liblog \ 147 libcutils \ 148 libutils \ 149 libEGL \ 150 libGLESv2 \ 151 libskia \ 152 libui \ 153 libgui \ 154 libprotobuf-cpp-lite \ 155 156ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT)) 157 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT 158 hwui_shared_libraries += libRS libRScpp 159 hwui_c_includes += \ 160 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \ 161 frameworks/rs/cpp \ 162 frameworks/rs 163endif 164 165ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION)) 166 hwui_cflags += -include debug/wrap_gles.h 167 hwui_src_files += debug/wrap_gles.cpp 168 hwui_c_includes += frameworks/native/opengl/libs/GLES2 169 hwui_cflags += -DDEBUG_OPENGL=3 170endif 171 172 173# ------------------------ 174# static library 175# ------------------------ 176 177include $(CLEAR_VARS) 178 179LOCAL_MODULE_CLASS := STATIC_LIBRARIES 180LOCAL_MODULE := libhwui_static 181LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 182LOCAL_CFLAGS := $(hwui_cflags) 183LOCAL_SRC_FILES := $(hwui_src_files) 184LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 185LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include) 186 187include $(BUILD_STATIC_LIBRARY) 188 189# ------------------------ 190# static library null gpu 191# ------------------------ 192 193include $(CLEAR_VARS) 194 195LOCAL_MODULE_CLASS := STATIC_LIBRARIES 196LOCAL_MODULE := libhwui_static_null_gpu 197LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 198LOCAL_CFLAGS := \ 199 $(hwui_cflags) \ 200 -DHWUI_NULL_GPU 201LOCAL_SRC_FILES := \ 202 $(hwui_src_files) \ 203 debug/nullegl.cpp \ 204 debug/nullgles.cpp 205LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 206LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include) 207 208include $(BUILD_STATIC_LIBRARY) 209 210# ------------------------ 211# shared library 212# ------------------------ 213 214include $(CLEAR_VARS) 215 216LOCAL_MODULE_CLASS := SHARED_LIBRARIES 217LOCAL_MODULE := libhwui 218LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static 219LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 220 221include $(BUILD_SHARED_LIBRARY) 222 223# ------------------------ 224# unit tests 225# ------------------------ 226 227include $(CLEAR_VARS) 228 229LOCAL_MODULE := hwui_unit_tests 230LOCAL_MODULE_TAGS := tests 231LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 232LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu 233LOCAL_CFLAGS := \ 234 $(hwui_cflags) \ 235 -DHWUI_NULL_GPU 236 237LOCAL_SRC_FILES += \ 238 $(hwui_test_common_src_files) \ 239 tests/unit/BufferPoolTests.cpp \ 240 tests/unit/CanvasStateTests.cpp \ 241 tests/unit/ClipAreaTests.cpp \ 242 tests/unit/CrashHandlerInjector.cpp \ 243 tests/unit/DamageAccumulatorTests.cpp \ 244 tests/unit/DeviceInfoTests.cpp \ 245 tests/unit/FatVectorTests.cpp \ 246 tests/unit/GpuMemoryTrackerTests.cpp \ 247 tests/unit/LayerUpdateQueueTests.cpp \ 248 tests/unit/LinearAllocatorTests.cpp \ 249 tests/unit/OffscreenBufferPoolTests.cpp \ 250 tests/unit/SkiaBehaviorTests.cpp \ 251 tests/unit/StringUtilsTests.cpp \ 252 tests/unit/TextDropShadowCacheTests.cpp \ 253 tests/unit/VectorDrawableTests.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/RecordingCanvasTests.cpp 261endif 262 263include $(BUILD_NATIVE_TEST) 264 265# ------------------------ 266# Macro-bench app 267# ------------------------ 268 269include $(CLEAR_VARS) 270 271LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp 272LOCAL_MODULE:= hwuitest 273LOCAL_MODULE_TAGS := tests 274LOCAL_MODULE_CLASS := EXECUTABLES 275LOCAL_MULTILIB := both 276LOCAL_MODULE_STEM_32 := hwuitest 277LOCAL_MODULE_STEM_64 := hwuitest64 278LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 279LOCAL_CFLAGS := $(hwui_cflags) 280 281# set to libhwui_static_null_gpu to skip actual GL commands 282LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static 283 284LOCAL_SRC_FILES += \ 285 $(hwui_test_common_src_files) \ 286 tests/macrobench/TestSceneRunner.cpp \ 287 tests/macrobench/main.cpp 288 289include $(BUILD_EXECUTABLE) 290 291# ------------------------ 292# Micro-bench app 293# --------------------- 294include $(CLEAR_VARS) 295 296LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp 297LOCAL_MODULE:= hwuimicro 298LOCAL_MODULE_TAGS := tests 299LOCAL_MODULE_CLASS := EXECUTABLES 300LOCAL_MULTILIB := both 301LOCAL_MODULE_STEM_32 := hwuimicro 302LOCAL_MODULE_STEM_64 := hwuimicro64 303LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 304LOCAL_CFLAGS := \ 305 $(hwui_cflags) \ 306 -DHWUI_NULL_GPU 307LOCAL_C_INCLUDES += bionic/benchmarks/ 308 309LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu 310LOCAL_STATIC_LIBRARIES := libbenchmark libbase 311 312LOCAL_SRC_FILES += \ 313 $(hwui_test_common_src_files) \ 314 tests/microbench/DisplayListCanvasBench.cpp \ 315 tests/microbench/LinearAllocatorBench.cpp \ 316 tests/microbench/PathParserBench.cpp \ 317 tests/microbench/ShadowBench.cpp 318 319ifeq (true, $(HWUI_NEW_OPS)) 320 LOCAL_SRC_FILES += \ 321 tests/microbench/FrameBuilderBench.cpp 322endif 323 324include $(BUILD_EXECUTABLE) 325