Android.mk revision 7de73858975fc4dbccfa1c188f6d1a12d39ce2c5
1LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
3LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
4
5BUGREPORT_FONT_CACHE_USAGE := false
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    hwui/Bitmap.cpp \
14    font/CacheTexture.cpp \
15    font/Font.cpp \
16    hwui/Canvas.cpp \
17    hwui/MinikinSkia.cpp \
18    hwui/MinikinUtils.cpp \
19    hwui/PaintImpl.cpp \
20    hwui/Typeface.cpp \
21    renderstate/Blend.cpp \
22    renderstate/MeshState.cpp \
23    renderstate/OffscreenBufferPool.cpp \
24    renderstate/PixelBufferState.cpp \
25    renderstate/RenderState.cpp \
26    renderstate/Scissor.cpp \
27    renderstate/Stencil.cpp \
28    renderstate/TextureState.cpp \
29    renderthread/CanvasContext.cpp \
30    renderthread/OpenGLPipeline.cpp \
31    renderthread/DrawFrameTask.cpp \
32    renderthread/EglManager.cpp \
33    renderthread/RenderProxy.cpp \
34    renderthread/RenderTask.cpp \
35    renderthread/RenderThread.cpp \
36    renderthread/TimeLord.cpp \
37    thread/TaskManager.cpp \
38    utils/Blur.cpp \
39    utils/GLUtils.cpp \
40    utils/LinearAllocator.cpp \
41    utils/StringUtils.cpp \
42    utils/TestWindowContext.cpp \
43    utils/VectorDrawableUtils.cpp \
44    AmbientShadow.cpp \
45    AnimationContext.cpp \
46    Animator.cpp \
47    AnimatorManager.cpp \
48    BakedOpDispatcher.cpp \
49    BakedOpRenderer.cpp \
50    BakedOpState.cpp \
51    Caches.cpp \
52    CanvasState.cpp \
53    ClipArea.cpp \
54    DamageAccumulator.cpp \
55    DeferredLayerUpdater.cpp \
56    DeviceInfo.cpp \
57    DisplayList.cpp \
58    Extensions.cpp \
59    FboCache.cpp \
60    FontRenderer.cpp \
61    FrameBuilder.cpp \
62    FrameInfo.cpp \
63    FrameInfoVisualizer.cpp \
64    GammaFontRenderer.cpp \
65    GlopBuilder.cpp \
66    GpuMemoryTracker.cpp \
67    GradientCache.cpp \
68    Image.cpp \
69    Interpolator.cpp \
70    JankTracker.cpp \
71    Layer.cpp \
72    LayerBuilder.cpp \
73    LayerUpdateQueue.cpp \
74    Matrix.cpp \
75    OpDumper.cpp \
76    Patch.cpp \
77    PatchCache.cpp \
78    PathCache.cpp \
79    PathParser.cpp \
80    PathTessellator.cpp \
81    PixelBuffer.cpp \
82    Program.cpp \
83    ProgramCache.cpp \
84    Properties.cpp \
85    PropertyValuesAnimatorSet.cpp \
86    PropertyValuesHolder.cpp \
87    Readback.cpp \
88    RecordingCanvas.cpp \
89    RenderBufferCache.cpp \
90    RenderNode.cpp \
91    RenderProperties.cpp \
92    ResourceCache.cpp \
93    ShadowTessellator.cpp \
94    SkiaCanvas.cpp \
95    SkiaCanvasProxy.cpp \
96    SkiaDisplayList.cpp \
97    SkiaShader.cpp \
98    Snapshot.cpp \
99    SpotShadow.cpp \
100    TessellationCache.cpp \
101    TextDropShadowCache.cpp \
102    Texture.cpp \
103    TextureCache.cpp \
104    VectorDrawable.cpp \
105    protos/hwui.proto
106
107hwui_test_common_src_files := \
108    $(call all-cpp-files-under, tests/common/scenes) \
109    tests/common/LeakChecker.cpp \
110    tests/common/TestListViewSceneBase.cpp \
111    tests/common/TestContext.cpp \
112    tests/common/TestScene.cpp \
113    tests/common/TestUtils.cpp
114
115hwui_debug_common_src_files := \
116    debug/wrap_gles.cpp \
117    debug/DefaultGlesDriver.cpp \
118    debug/GlesErrorCheckWrapper.cpp \
119    debug/GlesDriver.cpp \
120    debug/FatalBaseDriver.cpp \
121    debug/NullGlesDriver.cpp
122
123hwui_cflags := \
124    -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
125    -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
126    -Wall -Wno-unused-parameter -Wunreachable-code -Werror
127
128ifeq ($(TARGET_USES_HWC2),true)
129    hwui_cflags += -DUSE_HWC2
130endif
131
132# TODO: Linear blending should be enabled by default, but we are
133# TODO: making it an opt-in while it's a work in progress
134# TODO: The final test should be:
135# TODO: ifneq ($(TARGET_ENABLE_LINEAR_BLENDING),false)
136ifeq ($(TARGET_ENABLE_LINEAR_BLENDING),true)
137    hwui_cflags += -DANDROID_ENABLE_LINEAR_BLENDING
138endif
139
140# GCC false-positives on this warning, and since we -Werror that's
141# a problem
142hwui_cflags += -Wno-free-nonheap-object
143
144# clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
145hwui_cflags += -Wno-missing-braces
146
147ifeq (true, $(BUGREPORT_FONT_CACHE_USAGE))
148    hwui_src_files += \
149        font/FontCacheHistoryTracker.cpp
150    hwui_cflags += -DBUGREPORT_FONT_CACHE_USAGE
151endif
152
153ifndef HWUI_COMPILE_SYMBOLS
154    hwui_cflags += -fvisibility=hidden
155endif
156
157ifdef HWUI_COMPILE_FOR_PERF
158    # TODO: Non-arm?
159    hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
160endif
161
162# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
163# which varies depending on what is being built
164define hwui_proto_include
165$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
166endef
167
168hwui_c_includes += \
169    external/skia/include/private \
170    external/skia/src/core \
171    external/harfbuzz_ng/src \
172    external/freetype/include
173
174ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
175    hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
176    hwui_c_includes += \
177        $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
178        frameworks/rs/cpp \
179        frameworks/rs
180endif
181
182# ------------------------
183# static library
184# ------------------------
185
186include $(CLEAR_VARS)
187
188LOCAL_MODULE_CLASS := STATIC_LIBRARIES
189LOCAL_MODULE := libhwui_static
190LOCAL_CFLAGS := $(hwui_cflags)
191LOCAL_SRC_FILES := $(hwui_src_files)
192
193ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION))
194    LOCAL_CFLAGS += -include debug/wrap_gles.h
195    LOCAL_CFLAGS += -DDEBUG_OPENGL=3
196    LOCAL_SRC_FILES += $(hwui_debug_common_src_files)
197endif
198
199LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
200LOCAL_EXPORT_C_INCLUDE_DIRS := \
201        $(LOCAL_PATH) \
202        $(call hwui_proto_include)
203
204include $(LOCAL_PATH)/hwui_static_deps.mk
205include $(BUILD_STATIC_LIBRARY)
206
207# ------------------------
208# static library null gpu
209# ------------------------
210
211include $(CLEAR_VARS)
212
213LOCAL_MODULE_CLASS := STATIC_LIBRARIES
214LOCAL_MODULE := libhwui_static_debug
215LOCAL_CFLAGS := \
216        $(hwui_cflags) \
217        -include debug/wrap_gles.h \
218        -DHWUI_NULL_GPU
219LOCAL_SRC_FILES := \
220        $(hwui_src_files) \
221        $(hwui_debug_common_src_files) \
222        debug/nullegl.cpp
223LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
224LOCAL_EXPORT_C_INCLUDE_DIRS := \
225        $(LOCAL_PATH) \
226        $(call hwui_proto_include)
227
228include $(LOCAL_PATH)/hwui_static_deps.mk
229include $(BUILD_STATIC_LIBRARY)
230
231# ------------------------
232# shared library
233# ------------------------
234
235include $(CLEAR_VARS)
236
237LOCAL_MODULE_CLASS := SHARED_LIBRARIES
238LOCAL_MODULE := libhwui
239LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
240LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
241
242include $(LOCAL_PATH)/hwui_static_deps.mk
243include $(BUILD_SHARED_LIBRARY)
244
245# ------------------------
246# unit tests
247# ------------------------
248
249include $(CLEAR_VARS)
250
251LOCAL_MODULE := hwui_unit_tests
252LOCAL_MODULE_TAGS := tests
253LOCAL_STATIC_LIBRARIES := libgmock libhwui_static_debug
254LOCAL_SHARED_LIBRARIES := libmemunreachable
255LOCAL_CFLAGS := \
256        $(hwui_cflags) \
257        -include debug/wrap_gles.h \
258        -DHWUI_NULL_GPU
259LOCAL_C_INCLUDES := $(hwui_c_includes)
260
261LOCAL_SRC_FILES += \
262    $(hwui_test_common_src_files) \
263    tests/unit/main.cpp \
264    tests/unit/BakedOpDispatcherTests.cpp \
265    tests/unit/BakedOpRendererTests.cpp \
266    tests/unit/BakedOpStateTests.cpp \
267    tests/unit/CanvasStateTests.cpp \
268    tests/unit/ClipAreaTests.cpp \
269    tests/unit/DamageAccumulatorTests.cpp \
270    tests/unit/DeferredLayerUpdaterTests.cpp \
271    tests/unit/DeviceInfoTests.cpp \
272    tests/unit/FatVectorTests.cpp \
273    tests/unit/FontRendererTests.cpp \
274    tests/unit/FrameBuilderTests.cpp \
275    tests/unit/GlopBuilderTests.cpp \
276    tests/unit/GpuMemoryTrackerTests.cpp \
277    tests/unit/GradientCacheTests.cpp \
278    tests/unit/LayerUpdateQueueTests.cpp \
279    tests/unit/LeakCheckTests.cpp \
280    tests/unit/LinearAllocatorTests.cpp \
281    tests/unit/MatrixTests.cpp \
282    tests/unit/MeshStateTests.cpp \
283    tests/unit/OffscreenBufferPoolTests.cpp \
284    tests/unit/OpDumperTests.cpp \
285    tests/unit/RecordingCanvasTests.cpp \
286    tests/unit/RenderNodeTests.cpp \
287    tests/unit/RenderPropertiesTests.cpp \
288    tests/unit/SkiaBehaviorTests.cpp \
289    tests/unit/SkiaDisplayListTests.cpp \
290    tests/unit/SkiaCanvasTests.cpp \
291    tests/unit/SnapshotTests.cpp \
292    tests/unit/StringUtilsTests.cpp \
293    tests/unit/TestUtilsTests.cpp \
294    tests/unit/TextDropShadowCacheTests.cpp \
295    tests/unit/VectorDrawableTests.cpp \
296
297include $(LOCAL_PATH)/hwui_static_deps.mk
298include $(BUILD_NATIVE_TEST)
299
300# ------------------------
301# Macro-bench app
302# ------------------------
303
304include $(CLEAR_VARS)
305
306LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
307LOCAL_MODULE:= hwuimacro
308LOCAL_MODULE_TAGS := tests
309LOCAL_MULTILIB := both
310LOCAL_CFLAGS := $(hwui_cflags)
311LOCAL_C_INCLUDES := $(hwui_c_includes)
312
313# set to libhwui_static_debug to skip actual GL commands
314LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
315LOCAL_SHARED_LIBRARIES := libmemunreachable
316
317LOCAL_SRC_FILES += \
318    $(hwui_test_common_src_files) \
319    tests/macrobench/TestSceneRunner.cpp \
320    tests/macrobench/main.cpp
321
322include $(LOCAL_PATH)/hwui_static_deps.mk
323include $(BUILD_NATIVE_BENCHMARK)
324
325# ------------------------
326# Micro-bench app
327# ---------------------
328include $(CLEAR_VARS)
329
330LOCAL_MODULE:= hwuimicro
331LOCAL_MODULE_TAGS := tests
332LOCAL_CFLAGS := \
333        $(hwui_cflags) \
334        -include debug/wrap_gles.h \
335        -DHWUI_NULL_GPU
336
337LOCAL_C_INCLUDES := $(hwui_c_includes)
338
339LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_debug
340LOCAL_SHARED_LIBRARIES := libmemunreachable
341
342LOCAL_SRC_FILES += \
343    $(hwui_test_common_src_files) \
344    tests/microbench/main.cpp \
345    tests/microbench/DisplayListCanvasBench.cpp \
346    tests/microbench/FontBench.cpp \
347    tests/microbench/FrameBuilderBench.cpp \
348    tests/microbench/LinearAllocatorBench.cpp \
349    tests/microbench/PathParserBench.cpp \
350    tests/microbench/ShadowBench.cpp \
351    tests/microbench/TaskManagerBench.cpp
352
353
354include $(LOCAL_PATH)/hwui_static_deps.mk
355include $(BUILD_NATIVE_BENCHMARK)
356