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