blob: d98497bc046b1b63f39f353a50342905c8e35f16 [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 Craikb565df12015-10-05 13:00:52 -07005HWUI_NEW_OPS := false
6
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 := \
93 tests/common/TestUtils.cpp
94
John Reckd2e72142015-08-17 13:11:43 -070095hwui_cflags := \
96 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
97 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
John Reck82f5e0c2015-10-22 17:07:45 -070098 -Wall -Wno-unused-parameter -Wunreachable-code -Werror
John Reckd2e72142015-08-17 13:11:43 -070099
John Reckc90ed752015-11-04 07:39:44 -0800100# GCC false-positives on this warning, and since we -Werror that's
101# a problem
102hwui_cflags += -Wno-free-nonheap-object
103
Chris Craikb565df12015-10-05 13:00:52 -0700104ifeq (true, $(HWUI_NEW_OPS))
105 hwui_src_files += \
Chris Craik9e7fcfd2015-11-25 13:27:33 -0800106 BakedOpDispatcher.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700107 BakedOpRenderer.cpp \
108 OpReorderer.cpp \
109 RecordingCanvas.cpp
110
111 hwui_cflags += -DHWUI_NEW_OPS
112
113endif
114
John Reckd2e72142015-08-17 13:11:43 -0700115ifndef HWUI_COMPILE_SYMBOLS
116 hwui_cflags += -fvisibility=hidden
117endif
118
119ifdef HWUI_COMPILE_FOR_PERF
120 # TODO: Non-arm?
121 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
122endif
123
John Recke248bd12015-08-05 13:53:53 -0700124# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
125# which varies depending on what is being built
126define hwui_proto_include
127$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
128endef
129
John Reckd2e72142015-08-17 13:11:43 -0700130hwui_c_includes += \
Leon Scroggins III55078072015-07-31 10:38:40 -0400131 external/skia/include/private \
John Reckd2e72142015-08-17 13:11:43 -0700132 external/skia/src/core
133
134hwui_shared_libraries := \
135 liblog \
136 libcutils \
137 libutils \
138 libEGL \
139 libGLESv2 \
140 libskia \
141 libui \
142 libgui \
John Recke248bd12015-08-05 13:53:53 -0700143 libprotobuf-cpp-lite \
John Reckd2e72142015-08-17 13:11:43 -0700144
145ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
146 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
147 hwui_shared_libraries += libRS libRScpp
148 hwui_c_includes += \
149 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
150 frameworks/rs/cpp \
151 frameworks/rs
152endif
153
154
155# ------------------------
156# static library
157# ------------------------
158
159include $(CLEAR_VARS)
160
161LOCAL_MODULE_CLASS := STATIC_LIBRARIES
162LOCAL_MODULE := libhwui_static
163LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
164LOCAL_CFLAGS := $(hwui_cflags)
165LOCAL_SRC_FILES := $(hwui_src_files)
John Recke248bd12015-08-05 13:53:53 -0700166LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
167LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700168
169include $(BUILD_STATIC_LIBRARY)
170
171# ------------------------
Chris Craik5fbd9db2015-10-19 11:22:11 -0700172# static library null gpu
173# ------------------------
174
175include $(CLEAR_VARS)
176
177LOCAL_MODULE_CLASS := STATIC_LIBRARIES
178LOCAL_MODULE := libhwui_static_null_gpu
179LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
180LOCAL_CFLAGS := \
181 $(hwui_cflags) \
182 -DHWUI_NULL_GPU
183LOCAL_SRC_FILES := \
184 $(hwui_src_files) \
Chris Craik8160f202015-12-02 14:50:25 -0800185 tests/common/nullegl.cpp \
186 tests/common/nullgles.cpp
Chris Craik5fbd9db2015-10-19 11:22:11 -0700187LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
188LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
189
190include $(BUILD_STATIC_LIBRARY)
191
192# ------------------------
John Reckd2e72142015-08-17 13:11:43 -0700193# shared library
194# ------------------------
195
196include $(CLEAR_VARS)
197
John Recka2732a22014-12-18 13:52:33 -0800198LOCAL_MODULE_CLASS := SHARED_LIBRARIES
199LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700200LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
201LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Romain Guye4d01122010-06-16 18:44:05 -0700202
John Recka2732a22014-12-18 13:52:33 -0800203include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800204
John Reckd2e72142015-08-17 13:11:43 -0700205# ------------------------
206# unit tests
207# ------------------------
208
209include $(CLEAR_VARS)
210
211LOCAL_MODULE := hwui_unit_tests
212LOCAL_MODULE_TAGS := tests
213LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik5fbd9db2015-10-19 11:22:11 -0700214LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
Chris Craik98787e62015-11-13 10:55:30 -0800215LOCAL_CFLAGS := \
216 $(hwui_cflags) \
217 -DHWUI_NULL_GPU
John Reckd2e72142015-08-17 13:11:43 -0700218
219LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800220 $(hwui_test_common_src_files) \
221 tests/unit/CanvasStateTests.cpp \
222 tests/unit/ClipAreaTests.cpp \
223 tests/unit/DamageAccumulatorTests.cpp \
224 tests/unit/DeviceInfoTests.cpp \
225 tests/unit/FatVectorTests.cpp \
226 tests/unit/LayerUpdateQueueTests.cpp \
227 tests/unit/LinearAllocatorTests.cpp \
228 tests/unit/VectorDrawableTests.cpp \
229 tests/unit/OffscreenBufferPoolTests.cpp \
230 tests/unit/StringUtilsTests.cpp
John Reckd2e72142015-08-17 13:11:43 -0700231
Chris Craikb565df12015-10-05 13:00:52 -0700232ifeq (true, $(HWUI_NEW_OPS))
233 LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800234 tests/unit/BakedOpStateTests.cpp \
235 tests/unit/RecordingCanvasTests.cpp \
236 tests/unit/OpReordererTests.cpp
Chris Craikb565df12015-10-05 13:00:52 -0700237endif
238
John Reckd2e72142015-08-17 13:11:43 -0700239include $(BUILD_NATIVE_TEST)
240
241# ------------------------
Chris Craik8160f202015-12-02 14:50:25 -0800242# Macro-bench app
John Reckd2e72142015-08-17 13:11:43 -0700243# ------------------------
244
245include $(CLEAR_VARS)
246
247LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
248LOCAL_MODULE:= hwuitest
249LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700250LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700251LOCAL_MULTILIB := both
252LOCAL_MODULE_STEM_32 := hwuitest
253LOCAL_MODULE_STEM_64 := hwuitest64
254LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
255LOCAL_CFLAGS := $(hwui_cflags)
John Reckd2e72142015-08-17 13:11:43 -0700256
Chris Craik5fbd9db2015-10-19 11:22:11 -0700257# set to libhwui_static_null_gpu to skip actual GL commands
258LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700259
260LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800261 $(hwui_test_common_src_files) \
262 tests/macrobench/TestContext.cpp \
263 tests/macrobench/TestSceneRunner.cpp \
264 tests/macrobench/main.cpp
John Reckd2e72142015-08-17 13:11:43 -0700265
Chris Craik8160f202015-12-02 14:50:25 -0800266LOCAL_SRC_FILES += $(call all-cpp-files-under, tests/common/scenes)
John Reck16c9d6a2015-11-17 15:51:08 -0800267
John Reckd2e72142015-08-17 13:11:43 -0700268include $(BUILD_EXECUTABLE)
John Reck4a4bc892015-10-12 07:38:22 -0700269
270# ------------------------
271# Micro-bench app
272# ---------------------
273include $(CLEAR_VARS)
274
275LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
276LOCAL_MODULE:= hwuimicro
277LOCAL_MODULE_TAGS := tests
278LOCAL_MODULE_CLASS := EXECUTABLES
279LOCAL_MULTILIB := both
280LOCAL_MODULE_STEM_32 := hwuimicro
281LOCAL_MODULE_STEM_64 := hwuimicro64
282LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik8d1f2122015-11-24 16:40:09 -0800283LOCAL_CFLAGS := \
284 $(hwui_cflags) \
285 -DHWUI_NULL_GPU
John Reck4a4bc892015-10-12 07:38:22 -0700286LOCAL_C_INCLUDES += bionic/benchmarks/
287
Chris Craik5fbd9db2015-10-19 11:22:11 -0700288LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
John Reck4a4bc892015-10-12 07:38:22 -0700289LOCAL_STATIC_LIBRARIES := libbenchmark libbase
290
291LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800292 $(hwui_test_common_src_files) \
293 tests/microbench/DisplayListCanvasBench.cpp \
294 tests/microbench/LinearAllocatorBench.cpp \
295 tests/microbench/PathParserBench.cpp \
296 tests/microbench/ShadowBench.cpp
John Reck4a4bc892015-10-12 07:38:22 -0700297
Chris Craik0a24b142015-10-19 17:10:19 -0700298ifeq (true, $(HWUI_NEW_OPS))
299 LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800300 tests/microbench/OpReordererBench.cpp
Chris Craik0a24b142015-10-19 17:10:19 -0700301endif
302
John Reck4a4bc892015-10-12 07:38:22 -0700303include $(BUILD_EXECUTABLE)