Android.mk revision 8160f20b0aca8c6595d4b385d673f59b6bcd16a4
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    tests/common/TestUtils.cpp
94
95hwui_cflags := \
96    -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
97    -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
98    -Wall -Wno-unused-parameter -Wunreachable-code -Werror
99
100# GCC false-positives on this warning, and since we -Werror that's
101# a problem
102hwui_cflags += -Wno-free-nonheap-object
103
104ifeq (true, $(HWUI_NEW_OPS))
105    hwui_src_files += \
106        BakedOpDispatcher.cpp \
107        BakedOpRenderer.cpp \
108        OpReorderer.cpp \
109        RecordingCanvas.cpp
110
111    hwui_cflags += -DHWUI_NEW_OPS
112
113endif
114
115ifndef HWUI_COMPILE_SYMBOLS
116    hwui_cflags += -fvisibility=hidden
117endif
118
119ifdef HWUI_COMPILE_FOR_PERF
120    # TODO: Non-arm?
121    hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
122endif
123
124# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
125# which varies depending on what is being built
126define hwui_proto_include
127$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
128endef
129
130hwui_c_includes += \
131    external/skia/include/private \
132    external/skia/src/core
133
134hwui_shared_libraries := \
135    liblog \
136    libcutils \
137    libutils \
138    libEGL \
139    libGLESv2 \
140    libskia \
141    libui \
142    libgui \
143    libprotobuf-cpp-lite \
144
145ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
146    hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
147    hwui_shared_libraries += libRS libRScpp
148    hwui_c_includes += \
149        $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
150        frameworks/rs/cpp \
151        frameworks/rs
152endif
153
154
155# ------------------------
156# static library
157# ------------------------
158
159include $(CLEAR_VARS)
160
161LOCAL_MODULE_CLASS := STATIC_LIBRARIES
162LOCAL_MODULE := libhwui_static
163LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
164LOCAL_CFLAGS := $(hwui_cflags)
165LOCAL_SRC_FILES := $(hwui_src_files)
166LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
167LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
168
169include $(BUILD_STATIC_LIBRARY)
170
171# ------------------------
172# static library null gpu
173# ------------------------
174
175include $(CLEAR_VARS)
176
177LOCAL_MODULE_CLASS := STATIC_LIBRARIES
178LOCAL_MODULE := libhwui_static_null_gpu
179LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
180LOCAL_CFLAGS := \
181        $(hwui_cflags) \
182        -DHWUI_NULL_GPU
183LOCAL_SRC_FILES := \
184        $(hwui_src_files) \
185        tests/common/nullegl.cpp \
186        tests/common/nullgles.cpp
187LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
188LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
189
190include $(BUILD_STATIC_LIBRARY)
191
192# ------------------------
193# shared library
194# ------------------------
195
196include $(CLEAR_VARS)
197
198LOCAL_MODULE_CLASS := SHARED_LIBRARIES
199LOCAL_MODULE := libhwui
200LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
201LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
202
203include $(BUILD_SHARED_LIBRARY)
204
205# ------------------------
206# unit tests
207# ------------------------
208
209include $(CLEAR_VARS)
210
211LOCAL_MODULE := hwui_unit_tests
212LOCAL_MODULE_TAGS := tests
213LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
214LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
215LOCAL_CFLAGS := \
216        $(hwui_cflags) \
217        -DHWUI_NULL_GPU
218
219LOCAL_SRC_FILES += \
220    $(hwui_test_common_src_files) \
221    tests/unit/CanvasStateTests.cpp \
222    tests/unit/ClipAreaTests.cpp \
223    tests/unit/DamageAccumulatorTests.cpp \
224    tests/unit/DeviceInfoTests.cpp \
225    tests/unit/FatVectorTests.cpp \
226    tests/unit/LayerUpdateQueueTests.cpp \
227    tests/unit/LinearAllocatorTests.cpp \
228    tests/unit/VectorDrawableTests.cpp \
229    tests/unit/OffscreenBufferPoolTests.cpp \
230    tests/unit/StringUtilsTests.cpp
231
232ifeq (true, $(HWUI_NEW_OPS))
233    LOCAL_SRC_FILES += \
234        tests/unit/BakedOpStateTests.cpp \
235        tests/unit/RecordingCanvasTests.cpp \
236        tests/unit/OpReordererTests.cpp
237endif
238
239include $(BUILD_NATIVE_TEST)
240
241# ------------------------
242# Macro-bench app
243# ------------------------
244
245include $(CLEAR_VARS)
246
247LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
248LOCAL_MODULE:= hwuitest
249LOCAL_MODULE_TAGS := tests
250LOCAL_MODULE_CLASS := EXECUTABLES
251LOCAL_MULTILIB := both
252LOCAL_MODULE_STEM_32 := hwuitest
253LOCAL_MODULE_STEM_64 := hwuitest64
254LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
255LOCAL_CFLAGS := $(hwui_cflags)
256
257# set to libhwui_static_null_gpu to skip actual GL commands
258LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
259
260LOCAL_SRC_FILES += \
261    $(hwui_test_common_src_files) \
262    tests/macrobench/TestContext.cpp \
263    tests/macrobench/TestSceneRunner.cpp \
264    tests/macrobench/main.cpp
265
266LOCAL_SRC_FILES += $(call all-cpp-files-under, tests/common/scenes)
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