blob: 6f924d35e4ef3b342f0de5eef26e216e3991d292 [file] [log] [blame]
Romain Guye4d01122010-06-16 18:44:05 -07001LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
Dan Albert88ba3392014-09-11 16:20:16 -07003LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Romain Guye4d01122010-06-16 18:44:05 -07004
Chris Craike60a52a2015-12-16 16:05:49 -08005HWUI_NEW_OPS := false
Chris Craikb565df12015-10-05 13:00:52 -07006
John Reckd2e72142015-08-17 13:11:43 -07007hwui_src_files := \
8 font/CacheTexture.cpp \
9 font/Font.cpp \
10 renderstate/Blend.cpp \
11 renderstate/MeshState.cpp \
Chris Craik9fded232015-11-11 16:42:34 -080012 renderstate/OffscreenBufferPool.cpp \
John Reckd2e72142015-08-17 13:11:43 -070013 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 \
Derek Sollenberger4c5efe92015-07-10 13:56:39 -040029 utils/NinePatchImpl.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -070030 utils/StringUtils.cpp \
Tom Hudsonb2f5bd22015-10-15 16:41:55 -040031 utils/TestWindowContext.cpp \
Doris Liu804618d2015-11-16 22:48:34 -080032 utils/VectorDrawableUtils.cpp \
John Reckd2e72142015-08-17 13:11:43 -070033 AmbientShadow.cpp \
34 AnimationContext.cpp \
35 Animator.cpp \
36 AnimatorManager.cpp \
37 AssetAtlas.cpp \
38 Caches.cpp \
Chris Craika1717272015-11-19 13:02:43 -080039 Canvas.cpp \
John Reckd2e72142015-08-17 13:11:43 -070040 CanvasState.cpp \
41 ClipArea.cpp \
42 DamageAccumulator.cpp \
43 DeferredDisplayList.cpp \
44 DeferredLayerUpdater.cpp \
John Reck704bed02015-11-05 09:22:17 -080045 DeviceInfo.cpp \
John Reckd2e72142015-08-17 13:11:43 -070046 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 \
Chris Craik0b7e8242015-10-28 16:50:44 -070063 LayerUpdateQueue.cpp \
John Reckd2e72142015-08-17 13:11:43 -070064 Matrix.cpp \
65 OpenGLRenderer.cpp \
66 Patch.cpp \
67 PatchCache.cpp \
68 PathCache.cpp \
69 PathTessellator.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080070 PathParser.cpp \
John Reckd2e72142015-08-17 13:11:43 -070071 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 \
John Recke248bd12015-08-05 13:53:53 -070088 TextureCache.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080089 VectorDrawablePath.cpp \
John Recke248bd12015-08-05 13:53:53 -070090 protos/hwui.proto
John Reckd2e72142015-08-17 13:11:43 -070091
Chris Craik8160f202015-12-02 14:50:25 -080092hwui_test_common_src_files := \
Chris Craik27e58b42015-12-07 10:01:38 -080093 $(call all-cpp-files-under, tests/common/scenes) \
94 tests/common/TestContext.cpp \
95 tests/common/TestScene.cpp \
Chris Craik8160f202015-12-02 14:50:25 -080096 tests/common/TestUtils.cpp
97
John Reckd2e72142015-08-17 13:11:43 -070098hwui_cflags := \
99 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
100 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
John Reck82f5e0c2015-10-22 17:07:45 -0700101 -Wall -Wno-unused-parameter -Wunreachable-code -Werror
John Reckd2e72142015-08-17 13:11:43 -0700102
John Reckc90ed752015-11-04 07:39:44 -0800103# GCC false-positives on this warning, and since we -Werror that's
104# a problem
105hwui_cflags += -Wno-free-nonheap-object
106
Chris Craikb565df12015-10-05 13:00:52 -0700107ifeq (true, $(HWUI_NEW_OPS))
108 hwui_src_files += \
Chris Craik9e7fcfd2015-11-25 13:27:33 -0800109 BakedOpDispatcher.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700110 BakedOpRenderer.cpp \
Chris Craike4db79d2015-12-22 16:32:23 -0800111 BakedOpState.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700112 OpReorderer.cpp \
113 RecordingCanvas.cpp
114
115 hwui_cflags += -DHWUI_NEW_OPS
116
117endif
118
John Reckd2e72142015-08-17 13:11:43 -0700119ifndef HWUI_COMPILE_SYMBOLS
120 hwui_cflags += -fvisibility=hidden
121endif
122
123ifdef HWUI_COMPILE_FOR_PERF
124 # TODO: Non-arm?
125 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
126endif
127
John Recke248bd12015-08-05 13:53:53 -0700128# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
129# which varies depending on what is being built
130define hwui_proto_include
131$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
132endef
133
John Reckd2e72142015-08-17 13:11:43 -0700134hwui_c_includes += \
Leon Scroggins III55078072015-07-31 10:38:40 -0400135 external/skia/include/private \
John Reckd2e72142015-08-17 13:11:43 -0700136 external/skia/src/core
137
138hwui_shared_libraries := \
139 liblog \
140 libcutils \
141 libutils \
142 libEGL \
143 libGLESv2 \
144 libskia \
145 libui \
146 libgui \
John Recke248bd12015-08-05 13:53:53 -0700147 libprotobuf-cpp-lite \
John Reckd2e72142015-08-17 13:11:43 -0700148
149ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
150 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
151 hwui_shared_libraries += libRS libRScpp
152 hwui_c_includes += \
153 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
154 frameworks/rs/cpp \
155 frameworks/rs
156endif
157
158
159# ------------------------
160# static library
161# ------------------------
162
163include $(CLEAR_VARS)
164
165LOCAL_MODULE_CLASS := STATIC_LIBRARIES
166LOCAL_MODULE := libhwui_static
167LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
168LOCAL_CFLAGS := $(hwui_cflags)
169LOCAL_SRC_FILES := $(hwui_src_files)
John Recke248bd12015-08-05 13:53:53 -0700170LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
171LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700172
173include $(BUILD_STATIC_LIBRARY)
174
175# ------------------------
Chris Craik5fbd9db2015-10-19 11:22:11 -0700176# static library null gpu
177# ------------------------
178
179include $(CLEAR_VARS)
180
181LOCAL_MODULE_CLASS := STATIC_LIBRARIES
182LOCAL_MODULE := libhwui_static_null_gpu
183LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
184LOCAL_CFLAGS := \
185 $(hwui_cflags) \
186 -DHWUI_NULL_GPU
187LOCAL_SRC_FILES := \
188 $(hwui_src_files) \
Chris Craik8160f202015-12-02 14:50:25 -0800189 tests/common/nullegl.cpp \
190 tests/common/nullgles.cpp
Chris Craik5fbd9db2015-10-19 11:22:11 -0700191LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
192LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
193
194include $(BUILD_STATIC_LIBRARY)
195
196# ------------------------
John Reckd2e72142015-08-17 13:11:43 -0700197# shared library
198# ------------------------
199
200include $(CLEAR_VARS)
201
John Recka2732a22014-12-18 13:52:33 -0800202LOCAL_MODULE_CLASS := SHARED_LIBRARIES
203LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700204LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
205LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Romain Guye4d01122010-06-16 18:44:05 -0700206
John Recka2732a22014-12-18 13:52:33 -0800207include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800208
John Reckd2e72142015-08-17 13:11:43 -0700209# ------------------------
210# unit tests
211# ------------------------
212
213include $(CLEAR_VARS)
214
215LOCAL_MODULE := hwui_unit_tests
216LOCAL_MODULE_TAGS := tests
217LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik5fbd9db2015-10-19 11:22:11 -0700218LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
Chris Craik98787e62015-11-13 10:55:30 -0800219LOCAL_CFLAGS := \
220 $(hwui_cflags) \
221 -DHWUI_NULL_GPU
John Reckd2e72142015-08-17 13:11:43 -0700222
223LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800224 $(hwui_test_common_src_files) \
225 tests/unit/CanvasStateTests.cpp \
226 tests/unit/ClipAreaTests.cpp \
227 tests/unit/DamageAccumulatorTests.cpp \
228 tests/unit/DeviceInfoTests.cpp \
229 tests/unit/FatVectorTests.cpp \
230 tests/unit/LayerUpdateQueueTests.cpp \
231 tests/unit/LinearAllocatorTests.cpp \
232 tests/unit/VectorDrawableTests.cpp \
233 tests/unit/OffscreenBufferPoolTests.cpp \
234 tests/unit/StringUtilsTests.cpp
John Reckd2e72142015-08-17 13:11:43 -0700235
Chris Craikb565df12015-10-05 13:00:52 -0700236ifeq (true, $(HWUI_NEW_OPS))
237 LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800238 tests/unit/BakedOpStateTests.cpp \
239 tests/unit/RecordingCanvasTests.cpp \
240 tests/unit/OpReordererTests.cpp
Chris Craikb565df12015-10-05 13:00:52 -0700241endif
242
John Reckd2e72142015-08-17 13:11:43 -0700243include $(BUILD_NATIVE_TEST)
244
245# ------------------------
Chris Craik8160f202015-12-02 14:50:25 -0800246# Macro-bench app
John Reckd2e72142015-08-17 13:11:43 -0700247# ------------------------
248
249include $(CLEAR_VARS)
250
251LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
252LOCAL_MODULE:= hwuitest
253LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700254LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700255LOCAL_MULTILIB := both
256LOCAL_MODULE_STEM_32 := hwuitest
257LOCAL_MODULE_STEM_64 := hwuitest64
258LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
259LOCAL_CFLAGS := $(hwui_cflags)
John Reckd2e72142015-08-17 13:11:43 -0700260
Chris Craik5fbd9db2015-10-19 11:22:11 -0700261# set to libhwui_static_null_gpu to skip actual GL commands
262LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700263
264LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800265 $(hwui_test_common_src_files) \
Chris Craik8160f202015-12-02 14:50:25 -0800266 tests/macrobench/TestSceneRunner.cpp \
267 tests/macrobench/main.cpp
John Reckd2e72142015-08-17 13:11:43 -0700268
269include $(BUILD_EXECUTABLE)
John Reck4a4bc892015-10-12 07:38:22 -0700270
271# ------------------------
272# Micro-bench app
273# ---------------------
274include $(CLEAR_VARS)
275
276LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
277LOCAL_MODULE:= hwuimicro
278LOCAL_MODULE_TAGS := tests
279LOCAL_MODULE_CLASS := EXECUTABLES
280LOCAL_MULTILIB := both
281LOCAL_MODULE_STEM_32 := hwuimicro
282LOCAL_MODULE_STEM_64 := hwuimicro64
283LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik8d1f2122015-11-24 16:40:09 -0800284LOCAL_CFLAGS := \
285 $(hwui_cflags) \
286 -DHWUI_NULL_GPU
John Reck4a4bc892015-10-12 07:38:22 -0700287LOCAL_C_INCLUDES += bionic/benchmarks/
288
Chris Craik5fbd9db2015-10-19 11:22:11 -0700289LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
John Reck4a4bc892015-10-12 07:38:22 -0700290LOCAL_STATIC_LIBRARIES := libbenchmark libbase
291
292LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800293 $(hwui_test_common_src_files) \
294 tests/microbench/DisplayListCanvasBench.cpp \
295 tests/microbench/LinearAllocatorBench.cpp \
296 tests/microbench/PathParserBench.cpp \
297 tests/microbench/ShadowBench.cpp
John Reck4a4bc892015-10-12 07:38:22 -0700298
Chris Craik0a24b142015-10-19 17:10:19 -0700299ifeq (true, $(HWUI_NEW_OPS))
300 LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800301 tests/microbench/OpReordererBench.cpp
Chris Craik0a24b142015-10-19 17:10:19 -0700302endif
303
John Reck4a4bc892015-10-12 07:38:22 -0700304include $(BUILD_EXECUTABLE)