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