Android.mk revision f276acd98457bcaabc9e79a17a736b3b484f005e
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 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 147hwui_shared_libraries := \ 148 liblog \ 149 libcutils \ 150 libutils \ 151 libEGL \ 152 libGLESv2 \ 153 libskia \ 154 libui \ 155 libgui \ 156 libprotobuf-cpp-lite \ 157 158ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT)) 159 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT 160 hwui_shared_libraries += libRS libRScpp 161 hwui_c_includes += \ 162 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \ 163 frameworks/rs/cpp \ 164 frameworks/rs 165endif 166 167ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION)) 168 hwui_cflags += -include debug/wrap_gles.h 169 hwui_src_files += debug/wrap_gles.cpp 170 hwui_c_includes += frameworks/native/opengl/libs/GLES2 171 hwui_cflags += -DDEBUG_OPENGL=3 172endif 173 174 175# ------------------------ 176# static library 177# ------------------------ 178 179include $(CLEAR_VARS) 180 181LOCAL_MODULE_CLASS := STATIC_LIBRARIES 182LOCAL_MODULE := libhwui_static 183LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 184LOCAL_CFLAGS := $(hwui_cflags) 185LOCAL_SRC_FILES := $(hwui_src_files) 186LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 187LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include) 188 189include $(BUILD_STATIC_LIBRARY) 190 191# ------------------------ 192# static library null gpu 193# ------------------------ 194 195include $(CLEAR_VARS) 196 197LOCAL_MODULE_CLASS := STATIC_LIBRARIES 198LOCAL_MODULE := libhwui_static_null_gpu 199LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 200LOCAL_CFLAGS := \ 201 $(hwui_cflags) \ 202 -DHWUI_NULL_GPU 203LOCAL_SRC_FILES := \ 204 $(hwui_src_files) \ 205 debug/nullegl.cpp \ 206 debug/nullgles.cpp 207LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include) 208LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include) 209 210include $(BUILD_STATIC_LIBRARY) 211 212# ------------------------ 213# shared library 214# ------------------------ 215 216include $(CLEAR_VARS) 217 218LOCAL_MODULE_CLASS := SHARED_LIBRARIES 219LOCAL_MODULE := libhwui 220LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static 221LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 222 223include $(BUILD_SHARED_LIBRARY) 224 225# ------------------------ 226# unit tests 227# ------------------------ 228 229include $(CLEAR_VARS) 230 231LOCAL_MODULE := hwui_unit_tests 232LOCAL_MODULE_TAGS := tests 233LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries) 234LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu 235LOCAL_CFLAGS := \ 236 $(hwui_cflags) \ 237 -DHWUI_NULL_GPU 238 239LOCAL_SRC_FILES += \ 240 $(hwui_test_common_src_files) \ 241 tests/unit/CanvasStateTests.cpp \ 242 tests/unit/ClipAreaTests.cpp \ 243 tests/unit/CrashHandlerInjector.cpp \ 244 tests/unit/DamageAccumulatorTests.cpp \ 245 tests/unit/DeviceInfoTests.cpp \ 246 tests/unit/FatVectorTests.cpp \ 247 tests/unit/GpuMemoryTrackerTests.cpp \ 248 tests/unit/LayerUpdateQueueTests.cpp \ 249 tests/unit/LinearAllocatorTests.cpp \ 250 tests/unit/VectorDrawableTests.cpp \ 251 tests/unit/OffscreenBufferPoolTests.cpp \ 252 tests/unit/StringUtilsTests.cpp \ 253 tests/unit/BufferPoolTests.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