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