Android.mk revision 06f5bc70a667a02b14e31d3f53f91d3661e30666
1LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
3LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
4
5HWUI_NEW_OPS := true
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    GpuMemoryTracker.cpp \
57    GradientCache.cpp \
58    Image.cpp \
59    Interpolator.cpp \
60    JankTracker.cpp \
61    Layer.cpp \
62    LayerCache.cpp \
63    LayerRenderer.cpp \
64    LayerUpdateQueue.cpp \
65    Matrix.cpp \
66    OpenGLRenderer.cpp \
67    Patch.cpp \
68    PatchCache.cpp \
69    PathCache.cpp \
70    PathTessellator.cpp \
71    PathParser.cpp \
72    PixelBuffer.cpp \
73    Program.cpp \
74    ProgramCache.cpp \
75    Properties.cpp \
76    RenderBufferCache.cpp \
77    RenderNode.cpp \
78    RenderProperties.cpp \
79    ResourceCache.cpp \
80    ShadowTessellator.cpp \
81    SkiaCanvas.cpp \
82    SkiaCanvasProxy.cpp \
83    SkiaShader.cpp \
84    Snapshot.cpp \
85    SpotShadow.cpp \
86    TessellationCache.cpp \
87    TextDropShadowCache.cpp \
88    Texture.cpp \
89    TextureCache.cpp \
90    VectorDrawable.cpp \
91    protos/hwui.proto
92
93hwui_test_common_src_files := \
94    $(call all-cpp-files-under, tests/common/scenes) \
95    tests/common/TestContext.cpp \
96    tests/common/TestScene.cpp \
97    tests/common/TestUtils.cpp
98
99hwui_cflags := \
100    -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
101    -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
102    -Wall -Wno-unused-parameter -Wunreachable-code -Werror
103
104# GCC false-positives on this warning, and since we -Werror that's
105# a problem
106hwui_cflags += -Wno-free-nonheap-object
107
108ifeq (true, $(HWUI_NEW_OPS))
109    hwui_src_files += \
110        BakedOpDispatcher.cpp \
111        BakedOpRenderer.cpp \
112        BakedOpState.cpp \
113        FrameBuilder.cpp \
114        LayerBuilder.cpp \
115        RecordingCanvas.cpp
116
117    hwui_cflags += -DHWUI_NEW_OPS
118
119endif
120
121ifndef HWUI_COMPILE_SYMBOLS
122    hwui_cflags += -fvisibility=hidden
123endif
124
125ifdef HWUI_COMPILE_FOR_PERF
126    # TODO: Non-arm?
127    hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
128endif
129
130# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
131# which varies depending on what is being built
132define hwui_proto_include
133$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
134endef
135
136hwui_c_includes += \
137    external/skia/include/private \
138    external/skia/src/core
139
140hwui_shared_libraries := \
141    liblog \
142    libcutils \
143    libutils \
144    libEGL \
145    libGLESv2 \
146    libskia \
147    libui \
148    libgui \
149    libprotobuf-cpp-lite \
150
151ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
152    hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
153    hwui_shared_libraries += libRS libRScpp
154    hwui_c_includes += \
155        $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
156        frameworks/rs/cpp \
157        frameworks/rs
158endif
159
160
161# ------------------------
162# static library
163# ------------------------
164
165include $(CLEAR_VARS)
166
167LOCAL_MODULE_CLASS := STATIC_LIBRARIES
168LOCAL_MODULE := libhwui_static
169LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
170LOCAL_CFLAGS := $(hwui_cflags)
171LOCAL_SRC_FILES := $(hwui_src_files)
172LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
173LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
174
175include $(BUILD_STATIC_LIBRARY)
176
177# ------------------------
178# static library null gpu
179# ------------------------
180
181include $(CLEAR_VARS)
182
183LOCAL_MODULE_CLASS := STATIC_LIBRARIES
184LOCAL_MODULE := libhwui_static_null_gpu
185LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
186LOCAL_CFLAGS := \
187        $(hwui_cflags) \
188        -DHWUI_NULL_GPU
189LOCAL_SRC_FILES := \
190        $(hwui_src_files) \
191        tests/common/nullegl.cpp \
192        tests/common/nullgles.cpp
193LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
194LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
195
196include $(BUILD_STATIC_LIBRARY)
197
198# ------------------------
199# shared library
200# ------------------------
201
202include $(CLEAR_VARS)
203
204LOCAL_MODULE_CLASS := SHARED_LIBRARIES
205LOCAL_MODULE := libhwui
206LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
207LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
208
209include $(BUILD_SHARED_LIBRARY)
210
211# ------------------------
212# unit tests
213# ------------------------
214
215include $(CLEAR_VARS)
216
217LOCAL_MODULE := hwui_unit_tests
218LOCAL_MODULE_TAGS := tests
219LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
220LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
221LOCAL_CFLAGS := \
222        $(hwui_cflags) \
223        -DHWUI_NULL_GPU
224
225LOCAL_SRC_FILES += \
226    $(hwui_test_common_src_files) \
227    tests/unit/CanvasStateTests.cpp \
228    tests/unit/ClipAreaTests.cpp \
229    tests/unit/CrashHandlerInjector.cpp \
230    tests/unit/DamageAccumulatorTests.cpp \
231    tests/unit/DeviceInfoTests.cpp \
232    tests/unit/FatVectorTests.cpp \
233    tests/unit/GpuMemoryTrackerTests.cpp \
234    tests/unit/LayerUpdateQueueTests.cpp \
235    tests/unit/LinearAllocatorTests.cpp \
236    tests/unit/VectorDrawableTests.cpp \
237    tests/unit/OffscreenBufferPoolTests.cpp \
238    tests/unit/StringUtilsTests.cpp \
239    tests/unit/BufferPoolTests.cpp
240
241ifeq (true, $(HWUI_NEW_OPS))
242    LOCAL_SRC_FILES += \
243        tests/unit/BakedOpStateTests.cpp \
244        tests/unit/FrameBuilderTests.cpp \
245        tests/unit/LeakCheckTests.cpp \
246        tests/unit/RecordingCanvasTests.cpp
247endif
248
249include $(BUILD_NATIVE_TEST)
250
251# ------------------------
252# Macro-bench app
253# ------------------------
254
255include $(CLEAR_VARS)
256
257LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
258LOCAL_MODULE:= hwuitest
259LOCAL_MODULE_TAGS := tests
260LOCAL_MODULE_CLASS := EXECUTABLES
261LOCAL_MULTILIB := both
262LOCAL_MODULE_STEM_32 := hwuitest
263LOCAL_MODULE_STEM_64 := hwuitest64
264LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
265LOCAL_CFLAGS := $(hwui_cflags)
266
267# set to libhwui_static_null_gpu to skip actual GL commands
268LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
269
270LOCAL_SRC_FILES += \
271    $(hwui_test_common_src_files) \
272    tests/macrobench/TestSceneRunner.cpp \
273    tests/macrobench/main.cpp
274
275include $(BUILD_EXECUTABLE)
276
277# ------------------------
278# Micro-bench app
279# ---------------------
280include $(CLEAR_VARS)
281
282LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
283LOCAL_MODULE:= hwuimicro
284LOCAL_MODULE_TAGS := tests
285LOCAL_MODULE_CLASS := EXECUTABLES
286LOCAL_MULTILIB := both
287LOCAL_MODULE_STEM_32 := hwuimicro
288LOCAL_MODULE_STEM_64 := hwuimicro64
289LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
290LOCAL_CFLAGS := \
291        $(hwui_cflags) \
292        -DHWUI_NULL_GPU
293LOCAL_C_INCLUDES += bionic/benchmarks/
294
295LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
296LOCAL_STATIC_LIBRARIES := libbenchmark libbase
297
298LOCAL_SRC_FILES += \
299    $(hwui_test_common_src_files) \
300    tests/microbench/DisplayListCanvasBench.cpp \
301    tests/microbench/LinearAllocatorBench.cpp \
302    tests/microbench/PathParserBench.cpp \
303    tests/microbench/ShadowBench.cpp
304
305ifeq (true, $(HWUI_NEW_OPS))
306    LOCAL_SRC_FILES += \
307        tests/microbench/FrameBuilderBench.cpp
308endif
309
310include $(BUILD_EXECUTABLE)
311