blob: fc4916c79d094a36fe3e6c9070f78e5757ba5e4e [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 Reck16c9d6a2015-11-17 15:51:08 -080033 utils/TestUtils.cpp \
John Reckd2e72142015-08-17 13:11:43 -070034 AmbientShadow.cpp \
35 AnimationContext.cpp \
36 Animator.cpp \
37 AnimatorManager.cpp \
38 AssetAtlas.cpp \
39 Caches.cpp \
Chris Craika1717272015-11-19 13:02:43 -080040 Canvas.cpp \
John Reckd2e72142015-08-17 13:11:43 -070041 CanvasState.cpp \
42 ClipArea.cpp \
43 DamageAccumulator.cpp \
44 DeferredDisplayList.cpp \
45 DeferredLayerUpdater.cpp \
John Reck704bed02015-11-05 09:22:17 -080046 DeviceInfo.cpp \
John Reckd2e72142015-08-17 13:11:43 -070047 DisplayList.cpp \
48 DisplayListCanvas.cpp \
49 Dither.cpp \
50 Extensions.cpp \
51 FboCache.cpp \
52 FontRenderer.cpp \
53 FrameInfo.cpp \
54 FrameInfoVisualizer.cpp \
55 GammaFontRenderer.cpp \
56 GlopBuilder.cpp \
57 GradientCache.cpp \
58 Image.cpp \
59 Interpolator.cpp \
60 JankTracker.cpp \
61 Layer.cpp \
62 LayerCache.cpp \
63 LayerRenderer.cpp \
Chris Craik0b7e8242015-10-28 16:50:44 -070064 LayerUpdateQueue.cpp \
John Reckd2e72142015-08-17 13:11:43 -070065 Matrix.cpp \
66 OpenGLRenderer.cpp \
67 Patch.cpp \
68 PatchCache.cpp \
69 PathCache.cpp \
70 PathTessellator.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080071 PathParser.cpp \
John Reckd2e72142015-08-17 13:11:43 -070072 PixelBuffer.cpp \
73 Program.cpp \
74 ProgramCache.cpp \
75 Properties.cpp \
76 RenderBufferCache.cpp \
77 RenderNode.cpp \
78 RenderProperties.cpp \
79 ResourceCache.cpp \
80 ShadowTessellator.cpp \
81 SkiaCanvas.cpp \
82 SkiaCanvasProxy.cpp \
83 SkiaShader.cpp \
84 Snapshot.cpp \
85 SpotShadow.cpp \
86 TessellationCache.cpp \
87 TextDropShadowCache.cpp \
88 Texture.cpp \
John Recke248bd12015-08-05 13:53:53 -070089 TextureCache.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080090 VectorDrawablePath.cpp \
John Recke248bd12015-08-05 13:53:53 -070091 protos/hwui.proto
John Reckd2e72142015-08-17 13:11:43 -070092
93hwui_cflags := \
94 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
95 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
John Reck82f5e0c2015-10-22 17:07:45 -070096 -Wall -Wno-unused-parameter -Wunreachable-code -Werror
John Reckd2e72142015-08-17 13:11:43 -070097
John Reckc90ed752015-11-04 07:39:44 -080098# GCC false-positives on this warning, and since we -Werror that's
99# a problem
100hwui_cflags += -Wno-free-nonheap-object
101
Chris Craikb565df12015-10-05 13:00:52 -0700102ifeq (true, $(HWUI_NEW_OPS))
103 hwui_src_files += \
Chris Craik9e7fcfd2015-11-25 13:27:33 -0800104 BakedOpDispatcher.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700105 BakedOpRenderer.cpp \
106 OpReorderer.cpp \
107 RecordingCanvas.cpp
108
109 hwui_cflags += -DHWUI_NEW_OPS
110
111endif
112
John Reckd2e72142015-08-17 13:11:43 -0700113ifndef HWUI_COMPILE_SYMBOLS
114 hwui_cflags += -fvisibility=hidden
115endif
116
117ifdef HWUI_COMPILE_FOR_PERF
118 # TODO: Non-arm?
119 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
120endif
121
John Recke248bd12015-08-05 13:53:53 -0700122# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
123# which varies depending on what is being built
124define hwui_proto_include
125$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
126endef
127
John Reckd2e72142015-08-17 13:11:43 -0700128hwui_c_includes += \
Leon Scroggins III55078072015-07-31 10:38:40 -0400129 external/skia/include/private \
John Reckd2e72142015-08-17 13:11:43 -0700130 external/skia/src/core
131
132hwui_shared_libraries := \
133 liblog \
134 libcutils \
135 libutils \
136 libEGL \
137 libGLESv2 \
138 libskia \
139 libui \
140 libgui \
John Recke248bd12015-08-05 13:53:53 -0700141 libprotobuf-cpp-lite \
John Reckd2e72142015-08-17 13:11:43 -0700142
143ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
144 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
145 hwui_shared_libraries += libRS libRScpp
146 hwui_c_includes += \
147 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
148 frameworks/rs/cpp \
149 frameworks/rs
150endif
151
152
153# ------------------------
154# static library
155# ------------------------
156
157include $(CLEAR_VARS)
158
159LOCAL_MODULE_CLASS := STATIC_LIBRARIES
160LOCAL_MODULE := libhwui_static
161LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
162LOCAL_CFLAGS := $(hwui_cflags)
163LOCAL_SRC_FILES := $(hwui_src_files)
John Recke248bd12015-08-05 13:53:53 -0700164LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
165LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700166
167include $(BUILD_STATIC_LIBRARY)
168
169# ------------------------
Chris Craik5fbd9db2015-10-19 11:22:11 -0700170# static library null gpu
171# ------------------------
172
173include $(CLEAR_VARS)
174
175LOCAL_MODULE_CLASS := STATIC_LIBRARIES
176LOCAL_MODULE := libhwui_static_null_gpu
177LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
178LOCAL_CFLAGS := \
179 $(hwui_cflags) \
180 -DHWUI_NULL_GPU
181LOCAL_SRC_FILES := \
182 $(hwui_src_files) \
183 tests/nullegl.cpp \
184 tests/nullgles.cpp
185LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
186LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
187
188include $(BUILD_STATIC_LIBRARY)
189
190# ------------------------
John Reckd2e72142015-08-17 13:11:43 -0700191# shared library
192# ------------------------
193
194include $(CLEAR_VARS)
195
John Recka2732a22014-12-18 13:52:33 -0800196LOCAL_MODULE_CLASS := SHARED_LIBRARIES
197LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700198LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
199LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Romain Guye4d01122010-06-16 18:44:05 -0700200
John Recka2732a22014-12-18 13:52:33 -0800201include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800202
John Reckd2e72142015-08-17 13:11:43 -0700203# ------------------------
204# unit tests
205# ------------------------
206
207include $(CLEAR_VARS)
208
209LOCAL_MODULE := hwui_unit_tests
210LOCAL_MODULE_TAGS := tests
211LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik5fbd9db2015-10-19 11:22:11 -0700212LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
Chris Craik98787e62015-11-13 10:55:30 -0800213LOCAL_CFLAGS := \
214 $(hwui_cflags) \
215 -DHWUI_NULL_GPU
John Reckd2e72142015-08-17 13:11:43 -0700216
217LOCAL_SRC_FILES += \
Chris Craik95571062015-09-02 12:55:52 -0700218 unit_tests/CanvasStateTests.cpp \
John Reckd2e72142015-08-17 13:11:43 -0700219 unit_tests/ClipAreaTests.cpp \
220 unit_tests/DamageAccumulatorTests.cpp \
John Reck704bed02015-11-05 09:22:17 -0800221 unit_tests/DeviceInfoTests.cpp \
Chris Craik76ace112015-10-29 12:46:19 -0700222 unit_tests/FatVectorTests.cpp \
Chris Craik0b7e8242015-10-28 16:50:44 -0700223 unit_tests/LayerUpdateQueueTests.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -0700224 unit_tests/LinearAllocatorTests.cpp \
Doris Liu804618d2015-11-16 22:48:34 -0800225 unit_tests/VectorDrawableTests.cpp \
Chris Craik9fded232015-11-11 16:42:34 -0800226 unit_tests/OffscreenBufferPoolTests.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -0700227 unit_tests/StringUtilsTests.cpp
John Reckd2e72142015-08-17 13:11:43 -0700228
Chris Craikb565df12015-10-05 13:00:52 -0700229ifeq (true, $(HWUI_NEW_OPS))
230 LOCAL_SRC_FILES += \
231 unit_tests/BakedOpStateTests.cpp \
232 unit_tests/RecordingCanvasTests.cpp \
233 unit_tests/OpReordererTests.cpp
234endif
235
John Reckd2e72142015-08-17 13:11:43 -0700236include $(BUILD_NATIVE_TEST)
237
238# ------------------------
239# test app
240# ------------------------
241
242include $(CLEAR_VARS)
243
244LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
245LOCAL_MODULE:= hwuitest
246LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700247LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700248LOCAL_MULTILIB := both
249LOCAL_MODULE_STEM_32 := hwuitest
250LOCAL_MODULE_STEM_64 := hwuitest64
251LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
252LOCAL_CFLAGS := $(hwui_cflags)
John Reckd2e72142015-08-17 13:11:43 -0700253
Chris Craik5fbd9db2015-10-19 11:22:11 -0700254# set to libhwui_static_null_gpu to skip actual GL commands
255LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700256
257LOCAL_SRC_FILES += \
258 tests/TestContext.cpp \
John Reck16c9d6a2015-11-17 15:51:08 -0800259 tests/TestSceneRunner.cpp \
John Reckd2e72142015-08-17 13:11:43 -0700260 tests/main.cpp
261
John Reck16c9d6a2015-11-17 15:51:08 -0800262LOCAL_SRC_FILES += $(call all-cpp-files-under, tests/scenes)
263
John Reckd2e72142015-08-17 13:11:43 -0700264include $(BUILD_EXECUTABLE)
John Reck4a4bc892015-10-12 07:38:22 -0700265
266# ------------------------
267# Micro-bench app
268# ---------------------
269include $(CLEAR_VARS)
270
271LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
272LOCAL_MODULE:= hwuimicro
273LOCAL_MODULE_TAGS := tests
274LOCAL_MODULE_CLASS := EXECUTABLES
275LOCAL_MULTILIB := both
276LOCAL_MODULE_STEM_32 := hwuimicro
277LOCAL_MODULE_STEM_64 := hwuimicro64
278LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik8d1f2122015-11-24 16:40:09 -0800279LOCAL_CFLAGS := \
280 $(hwui_cflags) \
281 -DHWUI_NULL_GPU
John Reck4a4bc892015-10-12 07:38:22 -0700282LOCAL_C_INCLUDES += bionic/benchmarks/
283
Chris Craik5fbd9db2015-10-19 11:22:11 -0700284LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
John Reck4a4bc892015-10-12 07:38:22 -0700285LOCAL_STATIC_LIBRARIES := libbenchmark libbase
286
287LOCAL_SRC_FILES += \
Chris Craik81a1d2a2015-10-15 17:13:00 -0700288 microbench/DisplayListCanvasBench.cpp \
John Reck82f5e0c2015-10-22 17:07:45 -0700289 microbench/LinearAllocatorBench.cpp \
Doris Liuf59cb782015-11-10 10:36:17 -0800290 microbench/PathParserBench.cpp \
John Reck82f5e0c2015-10-22 17:07:45 -0700291 microbench/ShadowBench.cpp
John Reck4a4bc892015-10-12 07:38:22 -0700292
Chris Craik0a24b142015-10-19 17:10:19 -0700293ifeq (true, $(HWUI_NEW_OPS))
294 LOCAL_SRC_FILES += \
295 microbench/OpReordererBench.cpp
296endif
297
John Reck4a4bc892015-10-12 07:38:22 -0700298include $(BUILD_EXECUTABLE)