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