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