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