Android.mk revision 8cd3edfa15cc9cdbffa935d19ab894426b08d174
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    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    protos/hwui.proto
120
121hwui_test_common_src_files := \
122    $(call all-cpp-files-under, tests/common/scenes) \
123    tests/common/LeakChecker.cpp \
124    tests/common/TestListViewSceneBase.cpp \
125    tests/common/TestContext.cpp \
126    tests/common/TestScene.cpp \
127    tests/common/TestUtils.cpp
128
129hwui_debug_common_src_files := \
130    debug/wrap_gles.cpp \
131    debug/DefaultGlesDriver.cpp \
132    debug/GlesErrorCheckWrapper.cpp \
133    debug/GlesDriver.cpp \
134    debug/FatalBaseDriver.cpp \
135    debug/NullGlesDriver.cpp
136
137hwui_cflags := \
138    -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
139    -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
140    -Wall -Wno-unused-parameter -Wunreachable-code -Werror
141
142ifeq ($(TARGET_USES_HWC2),true)
143    hwui_cflags += -DUSE_HWC2
144endif
145
146# TODO: Linear blending should be enabled by default, but we are
147# TODO: making it an opt-in while it's a work in progress
148# TODO: The final test should be:
149# TODO: ifneq ($(TARGET_ENABLE_LINEAR_BLENDING),false)
150ifeq ($(TARGET_ENABLE_LINEAR_BLENDING),true)
151    hwui_cflags += -DANDROID_ENABLE_LINEAR_BLENDING
152endif
153
154# GCC false-positives on this warning, and since we -Werror that's
155# a problem
156hwui_cflags += -Wno-free-nonheap-object
157
158# clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
159hwui_cflags += -Wno-missing-braces
160
161ifeq (true, $(BUGREPORT_FONT_CACHE_USAGE))
162    hwui_src_files += \
163        font/FontCacheHistoryTracker.cpp
164    hwui_cflags += -DBUGREPORT_FONT_CACHE_USAGE
165endif
166
167ifndef HWUI_COMPILE_SYMBOLS
168    hwui_cflags += -fvisibility=hidden
169endif
170
171ifdef HWUI_COMPILE_FOR_PERF
172    # TODO: Non-arm?
173    hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
174endif
175
176# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
177# which varies depending on what is being built
178define hwui_proto_include
179$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
180endef
181
182hwui_c_includes += \
183    external/skia/include/private \
184    external/skia/src/core \
185    external/skia/src/effects \
186    external/skia/src/image \
187    external/skia/src/utils \
188    external/harfbuzz_ng/src \
189    external/freetype/include
190
191ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
192    hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
193    hwui_c_includes += \
194        $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
195        frameworks/rs/cpp \
196        frameworks/rs
197endif
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/LayerUpdateQueueTests.cpp \
298    tests/unit/LeakCheckTests.cpp \
299    tests/unit/LinearAllocatorTests.cpp \
300    tests/unit/MatrixTests.cpp \
301    tests/unit/MeshStateTests.cpp \
302    tests/unit/OffscreenBufferPoolTests.cpp \
303    tests/unit/OpDumperTests.cpp \
304    tests/unit/PathInterpolatorTests.cpp \
305    tests/unit/RenderNodeDrawableTests.cpp \
306    tests/unit/RecordingCanvasTests.cpp \
307    tests/unit/RenderNodeTests.cpp \
308    tests/unit/RenderPropertiesTests.cpp \
309    tests/unit/SkiaBehaviorTests.cpp \
310    tests/unit/SkiaDisplayListTests.cpp \
311    tests/unit/SkiaPipelineTests.cpp \
312    tests/unit/SkiaRenderPropertiesTests.cpp \
313    tests/unit/SkiaCanvasTests.cpp \
314    tests/unit/SnapshotTests.cpp \
315    tests/unit/StringUtilsTests.cpp \
316    tests/unit/TestUtilsTests.cpp \
317    tests/unit/TextDropShadowCacheTests.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