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