Android.mk revision c5ae595e6f71798109c730cd835a2cca79a8877c
1LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
3LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
4
5BUGREPORT_FONT_CACHE_USAGE := false
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    hwui/Bitmap.cpp \
14    font/CacheTexture.cpp \
15    font/Font.cpp \
16    hwui/Canvas.cpp \
17    hwui/MinikinSkia.cpp \
18    hwui/MinikinUtils.cpp \
19    hwui/PaintImpl.cpp \
20    hwui/Typeface.cpp \
21    pipeline/skia/GLFunctorDrawable.cpp \
22    pipeline/skia/LayerDrawable.cpp \
23    pipeline/skia/RenderNodeDrawable.cpp \
24    pipeline/skia/ReorderBarrierDrawables.cpp \
25    pipeline/skia/SkiaDisplayList.cpp \
26    pipeline/skia/SkiaOpenGLPipeline.cpp \
27    pipeline/skia/SkiaOpenGLReadback.cpp \
28    pipeline/skia/SkiaPipeline.cpp \
29    pipeline/skia/SkiaProfileRenderer.cpp \
30    pipeline/skia/SkiaRecordingCanvas.cpp \
31    pipeline/skia/SkiaVulkanPipeline.cpp \
32    renderstate/Blend.cpp \
33    renderstate/MeshState.cpp \
34    renderstate/OffscreenBufferPool.cpp \
35    renderstate/PixelBufferState.cpp \
36    renderstate/RenderState.cpp \
37    renderstate/Scissor.cpp \
38    renderstate/Stencil.cpp \
39    renderstate/TextureState.cpp \
40    renderthread/CanvasContext.cpp \
41    renderthread/OpenGLPipeline.cpp \
42    renderthread/DrawFrameTask.cpp \
43    renderthread/EglManager.cpp \
44    renderthread/VulkanManager.cpp \
45    renderthread/RenderProxy.cpp \
46    renderthread/RenderTask.cpp \
47    renderthread/RenderThread.cpp \
48    renderthread/TimeLord.cpp \
49    renderthread/Frame.cpp \
50    thread/TaskManager.cpp \
51    utils/Blur.cpp \
52    utils/GLUtils.cpp \
53    utils/LinearAllocator.cpp \
54    utils/StringUtils.cpp \
55    utils/TestWindowContext.cpp \
56    utils/VectorDrawableUtils.cpp \
57    AmbientShadow.cpp \
58    AnimationContext.cpp \
59    Animator.cpp \
60    AnimatorManager.cpp \
61    BakedOpDispatcher.cpp \
62    BakedOpRenderer.cpp \
63    BakedOpState.cpp \
64    Caches.cpp \
65    CanvasState.cpp \
66    ClipArea.cpp \
67    DamageAccumulator.cpp \
68    DeferredLayerUpdater.cpp \
69    DeviceInfo.cpp \
70    DisplayList.cpp \
71    Extensions.cpp \
72    FboCache.cpp \
73    FontRenderer.cpp \
74    FrameBuilder.cpp \
75    FrameInfo.cpp \
76    FrameInfoVisualizer.cpp \
77    GammaFontRenderer.cpp \
78    GlLayer.cpp \
79    GlopBuilder.cpp \
80    GpuMemoryTracker.cpp \
81    GradientCache.cpp \
82    Image.cpp \
83    Interpolator.cpp \
84    JankTracker.cpp \
85    Layer.cpp \
86    LayerBuilder.cpp \
87    LayerUpdateQueue.cpp \
88    Matrix.cpp \
89    OpDumper.cpp \
90    OpenGLReadback.cpp \
91    Patch.cpp \
92    PatchCache.cpp \
93    PathCache.cpp \
94    PathParser.cpp \
95    PathTessellator.cpp \
96    PixelBuffer.cpp \
97    ProfileRenderer.cpp \
98    Program.cpp \
99    ProgramCache.cpp \
100    Properties.cpp \
101    PropertyValuesAnimatorSet.cpp \
102    PropertyValuesHolder.cpp \
103    RecordingCanvas.cpp \
104    RenderBufferCache.cpp \
105    RenderNode.cpp \
106    RenderProperties.cpp \
107    ResourceCache.cpp \
108    ShadowTessellator.cpp \
109    SkiaCanvas.cpp \
110    SkiaCanvasProxy.cpp \
111    SkiaShader.cpp \
112    Snapshot.cpp \
113    SpotShadow.cpp \
114    TessellationCache.cpp \
115    TextDropShadowCache.cpp \
116    Texture.cpp \
117    TextureCache.cpp \
118    VectorDrawable.cpp \
119    VkLayer.cpp \
120    protos/hwui.proto
121
122hwui_test_common_src_files := \
123    $(call all-cpp-files-under, tests/common/scenes) \
124    tests/common/LeakChecker.cpp \
125    tests/common/TestListViewSceneBase.cpp \
126    tests/common/TestContext.cpp \
127    tests/common/TestScene.cpp \
128    tests/common/TestUtils.cpp
129
130hwui_debug_common_src_files := \
131    debug/wrap_gles.cpp \
132    debug/DefaultGlesDriver.cpp \
133    debug/GlesErrorCheckWrapper.cpp \
134    debug/GlesDriver.cpp \
135    debug/FatalBaseDriver.cpp \
136    debug/NullGlesDriver.cpp
137
138hwui_cflags := \
139    -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
140    -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
141    -Wall -Wno-unused-parameter -Wunreachable-code -Werror
142
143ifeq ($(TARGET_USES_HWC2),true)
144    hwui_cflags += -DUSE_HWC2
145endif
146
147# TODO: Linear blending should be enabled by default, but we are
148# TODO: making it an opt-in while it's a work in progress
149# TODO: The final test should be:
150# TODO: ifneq ($(TARGET_ENABLE_LINEAR_BLENDING),false)
151ifeq ($(TARGET_ENABLE_LINEAR_BLENDING),true)
152    hwui_cflags += -DANDROID_ENABLE_LINEAR_BLENDING
153endif
154
155# GCC false-positives on this warning, and since we -Werror that's
156# a problem
157hwui_cflags += -Wno-free-nonheap-object
158
159# clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
160hwui_cflags += -Wno-missing-braces
161
162ifeq (true, $(BUGREPORT_FONT_CACHE_USAGE))
163    hwui_src_files += \
164        font/FontCacheHistoryTracker.cpp
165    hwui_cflags += -DBUGREPORT_FONT_CACHE_USAGE
166endif
167
168ifndef HWUI_COMPILE_SYMBOLS
169    hwui_cflags += -fvisibility=hidden
170endif
171
172ifdef HWUI_COMPILE_FOR_PERF
173    # TODO: Non-arm?
174    hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
175endif
176
177# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
178# which varies depending on what is being built
179define hwui_proto_include
180$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
181endef
182
183hwui_c_includes += \
184    external/skia/include/private \
185    external/skia/src/core \
186    external/skia/src/effects \
187    external/skia/src/image \
188    external/skia/src/utils \
189    external/harfbuzz_ng/src \
190    external/freetype/include
191
192# enable RENDERSCRIPT
193hwui_c_includes += \
194    $(call intermediates-dir-for,STATIC_LIBRARIES,TARGET,) \
195    frameworks/rs/cpp \
196    frameworks/rs
197
198# ------------------------
199# static library
200# ------------------------
201
202include $(CLEAR_VARS)
203
204LOCAL_MODULE_CLASS := STATIC_LIBRARIES
205LOCAL_MODULE := libhwui_static
206LOCAL_CFLAGS := $(hwui_cflags)
207LOCAL_SRC_FILES := $(hwui_src_files)
208
209ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION))
210    LOCAL_CFLAGS += -include debug/wrap_gles.h
211    LOCAL_CFLAGS += -DDEBUG_OPENGL=3
212    LOCAL_SRC_FILES += $(hwui_debug_common_src_files)
213endif
214
215LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
216LOCAL_EXPORT_C_INCLUDE_DIRS := \
217        $(LOCAL_PATH) \
218        $(call hwui_proto_include)
219
220include $(LOCAL_PATH)/hwui_static_deps.mk
221include $(BUILD_STATIC_LIBRARY)
222
223# ------------------------
224# static library null gpu
225# ------------------------
226
227include $(CLEAR_VARS)
228
229LOCAL_MODULE_CLASS := STATIC_LIBRARIES
230LOCAL_MODULE := libhwui_static_debug
231LOCAL_CFLAGS := \
232        $(hwui_cflags) \
233        -include debug/wrap_gles.h \
234        -DHWUI_NULL_GPU
235LOCAL_SRC_FILES := \
236        $(hwui_src_files) \
237        $(hwui_debug_common_src_files) \
238        debug/nullegl.cpp
239LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
240LOCAL_EXPORT_C_INCLUDE_DIRS := \
241        $(LOCAL_PATH) \
242        $(call hwui_proto_include)
243
244include $(LOCAL_PATH)/hwui_static_deps.mk
245include $(BUILD_STATIC_LIBRARY)
246
247# ------------------------
248# shared library
249# ------------------------
250
251include $(CLEAR_VARS)
252
253LOCAL_MODULE_CLASS := SHARED_LIBRARIES
254LOCAL_MODULE := libhwui
255LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
256LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
257
258include $(LOCAL_PATH)/hwui_static_deps.mk
259include $(BUILD_SHARED_LIBRARY)
260
261# ------------------------
262# unit tests
263# ------------------------
264
265include $(CLEAR_VARS)
266
267LOCAL_MODULE := hwui_unit_tests
268LOCAL_MODULE_TAGS := tests
269LOCAL_STATIC_LIBRARIES := libgmock libhwui_static_debug
270LOCAL_SHARED_LIBRARIES := libmemunreachable
271LOCAL_CFLAGS := \
272        $(hwui_cflags) \
273        -include debug/wrap_gles.h \
274        -DHWUI_NULL_GPU
275LOCAL_C_INCLUDES := $(hwui_c_includes)
276
277LOCAL_SRC_FILES += \
278    $(hwui_test_common_src_files) \
279    tests/unit/main.cpp \
280    tests/unit/BakedOpDispatcherTests.cpp \
281    tests/unit/BakedOpRendererTests.cpp \
282    tests/unit/BakedOpStateTests.cpp \
283    tests/unit/BitmapTests.cpp \
284    tests/unit/CanvasContextTests.cpp \
285    tests/unit/CanvasStateTests.cpp \
286    tests/unit/ClipAreaTests.cpp \
287    tests/unit/DamageAccumulatorTests.cpp \
288    tests/unit/DeferredLayerUpdaterTests.cpp \
289    tests/unit/DeviceInfoTests.cpp \
290    tests/unit/FatVectorTests.cpp \
291    tests/unit/FontRendererTests.cpp \
292    tests/unit/FrameBuilderTests.cpp \
293    tests/unit/GlopBuilderTests.cpp \
294    tests/unit/GpuMemoryTrackerTests.cpp \
295    tests/unit/GradientCacheTests.cpp \
296    tests/unit/LayerUpdateQueueTests.cpp \
297    tests/unit/LeakCheckTests.cpp \
298    tests/unit/LinearAllocatorTests.cpp \
299    tests/unit/MatrixTests.cpp \
300    tests/unit/MeshStateTests.cpp \
301    tests/unit/OffscreenBufferPoolTests.cpp \
302    tests/unit/OpDumperTests.cpp \
303    tests/unit/PathInterpolatorTests.cpp \
304    tests/unit/RenderNodeDrawableTests.cpp \
305    tests/unit/RecordingCanvasTests.cpp \
306    tests/unit/RenderNodeTests.cpp \
307    tests/unit/RenderPropertiesTests.cpp \
308    tests/unit/SkiaBehaviorTests.cpp \
309    tests/unit/SkiaDisplayListTests.cpp \
310    tests/unit/SkiaPipelineTests.cpp \
311    tests/unit/SkiaRenderPropertiesTests.cpp \
312    tests/unit/SkiaCanvasTests.cpp \
313    tests/unit/SnapshotTests.cpp \
314    tests/unit/StringUtilsTests.cpp \
315    tests/unit/TestUtilsTests.cpp \
316    tests/unit/TextDropShadowCacheTests.cpp \
317    tests/unit/TextureCacheTests.cpp \
318    tests/unit/VectorDrawableTests.cpp \
319
320include $(LOCAL_PATH)/hwui_static_deps.mk
321include $(BUILD_NATIVE_TEST)
322
323# ------------------------
324# Macro-bench app
325# ------------------------
326
327include $(CLEAR_VARS)
328
329LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
330LOCAL_MODULE:= hwuimacro
331LOCAL_MODULE_TAGS := tests
332LOCAL_MULTILIB := both
333LOCAL_CFLAGS := $(hwui_cflags)
334LOCAL_C_INCLUDES := $(hwui_c_includes)
335
336# set to libhwui_static_debug to skip actual GL commands
337LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
338LOCAL_SHARED_LIBRARIES := libmemunreachable
339
340LOCAL_SRC_FILES += \
341    $(hwui_test_common_src_files) \
342    tests/macrobench/TestSceneRunner.cpp \
343    tests/macrobench/main.cpp
344
345include $(LOCAL_PATH)/hwui_static_deps.mk
346include $(BUILD_NATIVE_BENCHMARK)
347
348# ------------------------
349# Micro-bench app
350# ---------------------
351include $(CLEAR_VARS)
352
353LOCAL_MODULE:= hwuimicro
354LOCAL_MODULE_TAGS := tests
355LOCAL_CFLAGS := \
356        $(hwui_cflags) \
357        -include debug/wrap_gles.h \
358        -DHWUI_NULL_GPU
359
360LOCAL_C_INCLUDES := $(hwui_c_includes)
361
362LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_debug
363LOCAL_SHARED_LIBRARIES := libmemunreachable
364
365LOCAL_SRC_FILES += \
366    $(hwui_test_common_src_files) \
367    tests/microbench/main.cpp \
368    tests/microbench/DisplayListCanvasBench.cpp \
369    tests/microbench/FontBench.cpp \
370    tests/microbench/FrameBuilderBench.cpp \
371    tests/microbench/LinearAllocatorBench.cpp \
372    tests/microbench/PathParserBench.cpp \
373    tests/microbench/RenderNodeBench.cpp \
374    tests/microbench/ShadowBench.cpp \
375    tests/microbench/TaskManagerBench.cpp
376
377
378include $(LOCAL_PATH)/hwui_static_deps.mk
379include $(BUILD_NATIVE_BENCHMARK)
380