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