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