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