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