Android.mk revision 9b9eca5cc597a4245bd814f81a993f39c1591c84
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    utils/TestUtils.cpp \
34    AmbientShadow.cpp \
35    AnimationContext.cpp \
36    Animator.cpp \
37    AnimatorManager.cpp \
38    AssetAtlas.cpp \
39    Caches.cpp \
40    Canvas.cpp \
41    CanvasState.cpp \
42    ClipArea.cpp \
43    DamageAccumulator.cpp \
44    DeferredDisplayList.cpp \
45    DeferredLayerUpdater.cpp \
46    DeviceInfo.cpp \
47    DisplayList.cpp \
48    DisplayListCanvas.cpp \
49    Dither.cpp \
50    Extensions.cpp \
51    FboCache.cpp \
52    FontRenderer.cpp \
53    FrameInfo.cpp \
54    FrameInfoVisualizer.cpp \
55    GammaFontRenderer.cpp \
56    GlopBuilder.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    VectorDrawablePath.cpp \
91    protos/hwui.proto
92
93hwui_cflags := \
94    -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
95    -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
96    -Wall -Wno-unused-parameter -Wunreachable-code -Werror
97
98# GCC false-positives on this warning, and since we -Werror that's
99# a problem
100hwui_cflags += -Wno-free-nonheap-object
101
102ifeq (true, $(HWUI_NEW_OPS))
103    hwui_src_files += \
104        BakedOpDispatcher.cpp \
105        BakedOpRenderer.cpp \
106        OpReorderer.cpp \
107        RecordingCanvas.cpp
108
109    hwui_cflags += -DHWUI_NEW_OPS
110
111endif
112
113ifndef HWUI_COMPILE_SYMBOLS
114    hwui_cflags += -fvisibility=hidden
115endif
116
117ifdef HWUI_COMPILE_FOR_PERF
118    # TODO: Non-arm?
119    hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
120endif
121
122# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
123# which varies depending on what is being built
124define hwui_proto_include
125$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
126endef
127
128hwui_c_includes += \
129    external/skia/include/private \
130    external/skia/src/core
131
132hwui_shared_libraries := \
133    liblog \
134    libcutils \
135    libutils \
136    libEGL \
137    libGLESv2 \
138    libskia \
139    libui \
140    libgui \
141    libprotobuf-cpp-lite \
142
143ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
144    hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
145    hwui_shared_libraries += libRS libRScpp
146    hwui_c_includes += \
147        $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
148        frameworks/rs/cpp \
149        frameworks/rs
150endif
151
152
153# ------------------------
154# static library
155# ------------------------
156
157include $(CLEAR_VARS)
158
159LOCAL_MODULE_CLASS := STATIC_LIBRARIES
160LOCAL_MODULE := libhwui_static
161LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
162LOCAL_CFLAGS := $(hwui_cflags)
163LOCAL_SRC_FILES := $(hwui_src_files)
164LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
165LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
166
167include $(BUILD_STATIC_LIBRARY)
168
169# ------------------------
170# static library null gpu
171# ------------------------
172
173include $(CLEAR_VARS)
174
175LOCAL_MODULE_CLASS := STATIC_LIBRARIES
176LOCAL_MODULE := libhwui_static_null_gpu
177LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
178LOCAL_CFLAGS := \
179        $(hwui_cflags) \
180        -DHWUI_NULL_GPU
181LOCAL_SRC_FILES := \
182        $(hwui_src_files) \
183        tests/nullegl.cpp \
184        tests/nullgles.cpp
185LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
186LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
187
188include $(BUILD_STATIC_LIBRARY)
189
190# ------------------------
191# shared library
192# ------------------------
193
194include $(CLEAR_VARS)
195
196LOCAL_MODULE_CLASS := SHARED_LIBRARIES
197LOCAL_MODULE := libhwui
198LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
199LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
200
201include $(BUILD_SHARED_LIBRARY)
202
203# ------------------------
204# unit tests
205# ------------------------
206
207include $(CLEAR_VARS)
208
209LOCAL_MODULE := hwui_unit_tests
210LOCAL_MODULE_TAGS := tests
211LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
212LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
213LOCAL_CFLAGS := \
214        $(hwui_cflags) \
215        -DHWUI_NULL_GPU
216
217LOCAL_SRC_FILES += \
218    unit_tests/CanvasStateTests.cpp \
219    unit_tests/ClipAreaTests.cpp \
220    unit_tests/DamageAccumulatorTests.cpp \
221    unit_tests/DeviceInfoTests.cpp \
222    unit_tests/FatVectorTests.cpp \
223    unit_tests/LayerUpdateQueueTests.cpp \
224    unit_tests/LinearAllocatorTests.cpp \
225    unit_tests/VectorDrawableTests.cpp \
226    unit_tests/OffscreenBufferPoolTests.cpp \
227    unit_tests/StringUtilsTests.cpp
228
229ifeq (true, $(HWUI_NEW_OPS))
230    LOCAL_SRC_FILES += \
231        unit_tests/BakedOpStateTests.cpp \
232        unit_tests/RecordingCanvasTests.cpp \
233        unit_tests/OpReordererTests.cpp
234endif
235
236include $(BUILD_NATIVE_TEST)
237
238# ------------------------
239# test app
240# ------------------------
241
242include $(CLEAR_VARS)
243
244LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
245LOCAL_MODULE:= hwuitest
246LOCAL_MODULE_TAGS := tests
247LOCAL_MODULE_CLASS := EXECUTABLES
248LOCAL_MULTILIB := both
249LOCAL_MODULE_STEM_32 := hwuitest
250LOCAL_MODULE_STEM_64 := hwuitest64
251LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
252LOCAL_CFLAGS := $(hwui_cflags)
253
254# set to libhwui_static_null_gpu to skip actual GL commands
255LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
256
257LOCAL_SRC_FILES += \
258    tests/TestContext.cpp \
259    tests/TestSceneRunner.cpp \
260    tests/main.cpp
261
262LOCAL_SRC_FILES += $(call all-cpp-files-under, tests/scenes)
263
264include $(BUILD_EXECUTABLE)
265
266# ------------------------
267# Micro-bench app
268# ---------------------
269include $(CLEAR_VARS)
270
271LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
272LOCAL_MODULE:= hwuimicro
273LOCAL_MODULE_TAGS := tests
274LOCAL_MODULE_CLASS := EXECUTABLES
275LOCAL_MULTILIB := both
276LOCAL_MODULE_STEM_32 := hwuimicro
277LOCAL_MODULE_STEM_64 := hwuimicro64
278LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
279LOCAL_CFLAGS := \
280        $(hwui_cflags) \
281        -DHWUI_NULL_GPU
282LOCAL_C_INCLUDES += bionic/benchmarks/
283
284LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
285LOCAL_STATIC_LIBRARIES := libbenchmark libbase
286
287LOCAL_SRC_FILES += \
288    microbench/DisplayListCanvasBench.cpp \
289    microbench/LinearAllocatorBench.cpp \
290    microbench/PathParserBench.cpp \
291    microbench/ShadowBench.cpp
292
293ifeq (true, $(HWUI_NEW_OPS))
294    LOCAL_SRC_FILES += \
295        microbench/OpReordererBench.cpp
296endif
297
298include $(BUILD_EXECUTABLE)
299