blob: a7cbf5e562d161811c6c07facb12f3f9e4fadd82 [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 Craikf0a76082016-03-03 21:07:54 +00005HWUI_NEW_OPS := true
sergeyv5bb56262016-10-10 12:25:06 -07006BUGREPORT_FONT_CACHE_USAGE := false
Chris Craikb565df12015-10-05 13:00:52 -07007
John Reck975591a2016-01-22 16:28:07 -08008# Enables fine-grained GLES error checking
9# If set to true, every GLES call is wrapped & error checked
10# Has moderate overhead
John Reck756619d2016-04-15 11:31:09 -070011HWUI_ENABLE_OPENGL_VALIDATION := false
John Reck975591a2016-01-22 16:28:07 -080012
John Reckd2e72142015-08-17 13:11:43 -070013hwui_src_files := \
14 font/CacheTexture.cpp \
15 font/Font.cpp \
sergeyvdccca442016-03-21 15:38:21 -070016 hwui/Canvas.cpp \
17 hwui/MinikinSkia.cpp \
18 hwui/MinikinUtils.cpp \
19 hwui/PaintImpl.cpp \
sergeyvbad99182016-03-17 11:24:22 -070020 hwui/Typeface.cpp \
John Reckd2e72142015-08-17 13:11:43 -070021 renderstate/Blend.cpp \
22 renderstate/MeshState.cpp \
Chris Craik9fded232015-11-11 16:42:34 -080023 renderstate/OffscreenBufferPool.cpp \
John Reckd2e72142015-08-17 13:11:43 -070024 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/DrawFrameTask.cpp \
31 renderthread/EglManager.cpp \
32 renderthread/RenderProxy.cpp \
33 renderthread/RenderTask.cpp \
34 renderthread/RenderThread.cpp \
35 renderthread/TimeLord.cpp \
36 thread/TaskManager.cpp \
37 utils/Blur.cpp \
38 utils/GLUtils.cpp \
39 utils/LinearAllocator.cpp \
Derek Sollenberger4c5efe92015-07-10 13:56:39 -040040 utils/NinePatchImpl.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -070041 utils/StringUtils.cpp \
Tom Hudsonb2f5bd22015-10-15 16:41:55 -040042 utils/TestWindowContext.cpp \
Doris Liu804618d2015-11-16 22:48:34 -080043 utils/VectorDrawableUtils.cpp \
John Reckd2e72142015-08-17 13:11:43 -070044 AmbientShadow.cpp \
45 AnimationContext.cpp \
46 Animator.cpp \
47 AnimatorManager.cpp \
48 AssetAtlas.cpp \
49 Caches.cpp \
50 CanvasState.cpp \
51 ClipArea.cpp \
52 DamageAccumulator.cpp \
53 DeferredDisplayList.cpp \
54 DeferredLayerUpdater.cpp \
John Reck704bed02015-11-05 09:22:17 -080055 DeviceInfo.cpp \
John Reckd2e72142015-08-17 13:11:43 -070056 DisplayList.cpp \
57 DisplayListCanvas.cpp \
58 Dither.cpp \
59 Extensions.cpp \
60 FboCache.cpp \
61 FontRenderer.cpp \
62 FrameInfo.cpp \
63 FrameInfoVisualizer.cpp \
64 GammaFontRenderer.cpp \
65 GlopBuilder.cpp \
John Reck38e0c322015-11-10 12:19:17 -080066 GpuMemoryTracker.cpp \
John Reckd2e72142015-08-17 13:11:43 -070067 GradientCache.cpp \
68 Image.cpp \
69 Interpolator.cpp \
70 JankTracker.cpp \
71 Layer.cpp \
72 LayerCache.cpp \
73 LayerRenderer.cpp \
Chris Craik0b7e8242015-10-28 16:50:44 -070074 LayerUpdateQueue.cpp \
John Reckd2e72142015-08-17 13:11:43 -070075 Matrix.cpp \
76 OpenGLRenderer.cpp \
77 Patch.cpp \
78 PatchCache.cpp \
79 PathCache.cpp \
80 PathTessellator.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080081 PathParser.cpp \
John Reckd2e72142015-08-17 13:11:43 -070082 PixelBuffer.cpp \
83 Program.cpp \
84 ProgramCache.cpp \
85 Properties.cpp \
Doris Liu766431a2016-02-04 22:17:11 +000086 PropertyValuesHolder.cpp \
87 PropertyValuesAnimatorSet.cpp \
John Reck10dd0582016-03-31 16:36:16 -070088 Readback.cpp \
John Reckd2e72142015-08-17 13:11:43 -070089 RenderBufferCache.cpp \
90 RenderNode.cpp \
91 RenderProperties.cpp \
92 ResourceCache.cpp \
93 ShadowTessellator.cpp \
94 SkiaCanvas.cpp \
95 SkiaCanvasProxy.cpp \
96 SkiaShader.cpp \
97 Snapshot.cpp \
98 SpotShadow.cpp \
99 TessellationCache.cpp \
100 TextDropShadowCache.cpp \
101 Texture.cpp \
John Recke248bd12015-08-05 13:53:53 -0700102 TextureCache.cpp \
Doris Liu4bbc2932015-12-01 17:59:40 -0800103 VectorDrawable.cpp \
John Recke248bd12015-08-05 13:53:53 -0700104 protos/hwui.proto
John Reckd2e72142015-08-17 13:11:43 -0700105
Chris Craik8160f202015-12-02 14:50:25 -0800106hwui_test_common_src_files := \
Chris Craik27e58b42015-12-07 10:01:38 -0800107 $(call all-cpp-files-under, tests/common/scenes) \
108 tests/common/TestContext.cpp \
109 tests/common/TestScene.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800110 tests/common/TestUtils.cpp
111
John Reckd2e72142015-08-17 13:11:43 -0700112hwui_cflags := \
113 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
114 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
John Reck82f5e0c2015-10-22 17:07:45 -0700115 -Wall -Wno-unused-parameter -Wunreachable-code -Werror
John Reckd2e72142015-08-17 13:11:43 -0700116
John Reck2d5b8d72016-07-28 15:36:11 -0700117ifeq ($(TARGET_USES_HWC2),true)
118 hwui_cflags += -DUSE_HWC2
119endif
120
John Reckc90ed752015-11-04 07:39:44 -0800121# GCC false-positives on this warning, and since we -Werror that's
122# a problem
123hwui_cflags += -Wno-free-nonheap-object
124
Chris Craikb565df12015-10-05 13:00:52 -0700125ifeq (true, $(HWUI_NEW_OPS))
126 hwui_src_files += \
Chris Craik9e7fcfd2015-11-25 13:27:33 -0800127 BakedOpDispatcher.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700128 BakedOpRenderer.cpp \
Chris Craike4db79d2015-12-22 16:32:23 -0800129 BakedOpState.cpp \
Chris Craikf158b492016-01-12 14:45:08 -0800130 FrameBuilder.cpp \
131 LayerBuilder.cpp \
Chris Craik91eff222016-02-22 13:39:33 -0800132 OpDumper.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700133 RecordingCanvas.cpp
134
135 hwui_cflags += -DHWUI_NEW_OPS
136
137endif
138
sergeyvaf102be2016-09-09 18:02:07 -0700139ifeq (true, $(BUGREPORT_FONT_CACHE_USAGE))
140 hwui_src_files += \
141 font/FontCacheHistoryTracker.cpp
142 hwui_cflags += -DBUGREPORT_FONT_CACHE_USAGE
143endif
144
145
John Reckd2e72142015-08-17 13:11:43 -0700146ifndef HWUI_COMPILE_SYMBOLS
147 hwui_cflags += -fvisibility=hidden
148endif
149
150ifdef HWUI_COMPILE_FOR_PERF
151 # TODO: Non-arm?
152 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
153endif
154
John Recke248bd12015-08-05 13:53:53 -0700155# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
156# which varies depending on what is being built
157define hwui_proto_include
158$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
159endef
160
John Reckd2e72142015-08-17 13:11:43 -0700161hwui_c_includes += \
Leon Scroggins III55078072015-07-31 10:38:40 -0400162 external/skia/include/private \
sergeyvdccca442016-03-21 15:38:21 -0700163 external/skia/src/core \
164 external/harfbuzz_ng/src \
165 external/freetype/include
John Reckd2e72142015-08-17 13:11:43 -0700166
John Reckd2e72142015-08-17 13:11:43 -0700167ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
168 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
John Reckd2e72142015-08-17 13:11:43 -0700169 hwui_c_includes += \
170 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
171 frameworks/rs/cpp \
172 frameworks/rs
173endif
174
John Reck975591a2016-01-22 16:28:07 -0800175ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION))
176 hwui_cflags += -include debug/wrap_gles.h
177 hwui_src_files += debug/wrap_gles.cpp
178 hwui_c_includes += frameworks/native/opengl/libs/GLES2
179 hwui_cflags += -DDEBUG_OPENGL=3
180endif
181
John Reckd2e72142015-08-17 13:11:43 -0700182
183# ------------------------
184# static library
185# ------------------------
186
187include $(CLEAR_VARS)
188
189LOCAL_MODULE_CLASS := STATIC_LIBRARIES
190LOCAL_MODULE := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700191LOCAL_CFLAGS := $(hwui_cflags)
192LOCAL_SRC_FILES := $(hwui_src_files)
John Recke248bd12015-08-05 13:53:53 -0700193LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
Derek Sollenberger991da312016-02-11 12:13:07 -0500194LOCAL_EXPORT_C_INCLUDE_DIRS := \
195 $(LOCAL_PATH) \
Derek Sollenberger991da312016-02-11 12:13:07 -0500196 $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700197
Derek Sollenberger991da312016-02-11 12:13:07 -0500198include $(LOCAL_PATH)/hwui_static_deps.mk
John Reckd2e72142015-08-17 13:11:43 -0700199include $(BUILD_STATIC_LIBRARY)
200
201# ------------------------
Chris Craik5fbd9db2015-10-19 11:22:11 -0700202# static library null gpu
203# ------------------------
204
205include $(CLEAR_VARS)
206
207LOCAL_MODULE_CLASS := STATIC_LIBRARIES
208LOCAL_MODULE := libhwui_static_null_gpu
Chris Craik5fbd9db2015-10-19 11:22:11 -0700209LOCAL_CFLAGS := \
210 $(hwui_cflags) \
211 -DHWUI_NULL_GPU
212LOCAL_SRC_FILES := \
213 $(hwui_src_files) \
John Reck975591a2016-01-22 16:28:07 -0800214 debug/nullegl.cpp \
215 debug/nullgles.cpp
Chris Craik5fbd9db2015-10-19 11:22:11 -0700216LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
Derek Sollenberger991da312016-02-11 12:13:07 -0500217LOCAL_EXPORT_C_INCLUDE_DIRS := \
218 $(LOCAL_PATH) \
Derek Sollenberger991da312016-02-11 12:13:07 -0500219 $(call hwui_proto_include)
Chris Craik5fbd9db2015-10-19 11:22:11 -0700220
Derek Sollenberger991da312016-02-11 12:13:07 -0500221include $(LOCAL_PATH)/hwui_static_deps.mk
Chris Craik5fbd9db2015-10-19 11:22:11 -0700222include $(BUILD_STATIC_LIBRARY)
223
224# ------------------------
John Reckd2e72142015-08-17 13:11:43 -0700225# shared library
226# ------------------------
227
228include $(CLEAR_VARS)
229
John Recka2732a22014-12-18 13:52:33 -0800230LOCAL_MODULE_CLASS := SHARED_LIBRARIES
231LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700232LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
Derek Sollenberger991da312016-02-11 12:13:07 -0500233LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
Romain Guye4d01122010-06-16 18:44:05 -0700234
Derek Sollenberger991da312016-02-11 12:13:07 -0500235include $(LOCAL_PATH)/hwui_static_deps.mk
John Recka2732a22014-12-18 13:52:33 -0800236include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800237
John Reckd2e72142015-08-17 13:11:43 -0700238# ------------------------
239# unit tests
240# ------------------------
241
242include $(CLEAR_VARS)
243
244LOCAL_MODULE := hwui_unit_tests
245LOCAL_MODULE_TAGS := tests
Chris Craik5fbd9db2015-10-19 11:22:11 -0700246LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
John Reckdc87c522016-02-29 13:31:18 -0800247LOCAL_SHARED_LIBRARIES := libmemunreachable
Chris Craik98787e62015-11-13 10:55:30 -0800248LOCAL_CFLAGS := \
249 $(hwui_cflags) \
250 -DHWUI_NULL_GPU
Dan Willemsene9c205b2016-03-07 12:58:33 -0800251LOCAL_C_INCLUDES := $(hwui_c_includes)
John Reckd2e72142015-08-17 13:11:43 -0700252
253LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800254 $(hwui_test_common_src_files) \
John Reckdc87c522016-02-29 13:31:18 -0800255 tests/unit/main.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800256 tests/unit/CanvasStateTests.cpp \
257 tests/unit/ClipAreaTests.cpp \
258 tests/unit/DamageAccumulatorTests.cpp \
259 tests/unit/DeviceInfoTests.cpp \
260 tests/unit/FatVectorTests.cpp \
Chris Craikf3754a82016-04-19 18:13:21 -0700261 tests/unit/FontRendererTests.cpp \
sergeyvf42bf3e2016-03-11 13:45:15 -0800262 tests/unit/GlopBuilderTests.cpp \
John Reck38e0c322015-11-10 12:19:17 -0800263 tests/unit/GpuMemoryTrackerTests.cpp \
Chris Craik04d46eb2016-04-07 13:51:07 -0700264 tests/unit/GradientCacheTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800265 tests/unit/LayerUpdateQueueTests.cpp \
266 tests/unit/LinearAllocatorTests.cpp \
Chris Craik261725f2016-02-29 12:52:33 -0800267 tests/unit/MatrixTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800268 tests/unit/OffscreenBufferPoolTests.cpp \
John Reck44b49f02016-03-25 14:29:48 -0700269 tests/unit/RenderNodeTests.cpp \
Chris Craikd4fe4d32016-06-09 16:57:11 -0700270 tests/unit/RenderPropertiesTests.cpp \
Chris Craik07d8d592016-02-03 18:43:04 -0800271 tests/unit/SkiaBehaviorTests.cpp \
Chris Craik04d46eb2016-04-07 13:51:07 -0700272 tests/unit/SnapshotTests.cpp \
Andres Morales06f5bc72015-12-15 15:21:31 -0800273 tests/unit/StringUtilsTests.cpp \
Chris Craik37413282016-05-12 17:48:51 -0700274 tests/unit/TestUtilsTests.cpp \
Chris Craik07d8d592016-02-03 18:43:04 -0800275 tests/unit/TextDropShadowCacheTests.cpp \
Chris Craik04d46eb2016-04-07 13:51:07 -0700276 tests/unit/VectorDrawableTests.cpp
John Reckd2e72142015-08-17 13:11:43 -0700277
Chris Craikb565df12015-10-05 13:00:52 -0700278ifeq (true, $(HWUI_NEW_OPS))
279 LOCAL_SRC_FILES += \
Chris Craik419a1e72016-03-08 16:24:12 -0800280 tests/unit/BakedOpDispatcherTests.cpp \
Chris Craik02806282016-03-11 19:16:21 -0800281 tests/unit/BakedOpRendererTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800282 tests/unit/BakedOpStateTests.cpp \
Chris Craikf158b492016-01-12 14:45:08 -0800283 tests/unit/FrameBuilderTests.cpp \
John Reck1b94f9b2016-01-19 09:42:15 -0800284 tests/unit/LeakCheckTests.cpp \
Chris Craik91eff222016-02-22 13:39:33 -0800285 tests/unit/OpDumperTests.cpp \
Derek Sollenberger35934cc2016-03-23 14:59:10 -0400286 tests/unit/RecordingCanvasTests.cpp \
287 tests/unit/SkiaCanvasTests.cpp
Chris Craikb565df12015-10-05 13:00:52 -0700288endif
289
Derek Sollenberger991da312016-02-11 12:13:07 -0500290include $(LOCAL_PATH)/hwui_static_deps.mk
John Reckd2e72142015-08-17 13:11:43 -0700291include $(BUILD_NATIVE_TEST)
292
293# ------------------------
Chris Craik8160f202015-12-02 14:50:25 -0800294# Macro-bench app
John Reckd2e72142015-08-17 13:11:43 -0700295# ------------------------
296
297include $(CLEAR_VARS)
298
299LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
300LOCAL_MODULE:= hwuitest
301LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700302LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700303LOCAL_MULTILIB := both
304LOCAL_MODULE_STEM_32 := hwuitest
305LOCAL_MODULE_STEM_64 := hwuitest64
John Reckd2e72142015-08-17 13:11:43 -0700306LOCAL_CFLAGS := $(hwui_cflags)
Dan Willemsene9c205b2016-03-07 12:58:33 -0800307LOCAL_C_INCLUDES := $(hwui_c_includes)
John Reckd2e72142015-08-17 13:11:43 -0700308
Chris Craik5fbd9db2015-10-19 11:22:11 -0700309# set to libhwui_static_null_gpu to skip actual GL commands
310LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700311
312LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800313 $(hwui_test_common_src_files) \
Chris Craik8160f202015-12-02 14:50:25 -0800314 tests/macrobench/TestSceneRunner.cpp \
315 tests/macrobench/main.cpp
John Reckd2e72142015-08-17 13:11:43 -0700316
Derek Sollenberger991da312016-02-11 12:13:07 -0500317include $(LOCAL_PATH)/hwui_static_deps.mk
John Reckd2e72142015-08-17 13:11:43 -0700318include $(BUILD_EXECUTABLE)
John Reck4a4bc892015-10-12 07:38:22 -0700319
320# ------------------------
321# Micro-bench app
322# ---------------------
323include $(CLEAR_VARS)
324
325LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
326LOCAL_MODULE:= hwuimicro
327LOCAL_MODULE_TAGS := tests
328LOCAL_MODULE_CLASS := EXECUTABLES
329LOCAL_MULTILIB := both
330LOCAL_MODULE_STEM_32 := hwuimicro
331LOCAL_MODULE_STEM_64 := hwuimicro64
Chris Craik8d1f2122015-11-24 16:40:09 -0800332LOCAL_CFLAGS := \
333 $(hwui_cflags) \
334 -DHWUI_NULL_GPU
John Reck4a4bc892015-10-12 07:38:22 -0700335
John Reck2bee0dd2016-03-09 08:01:37 -0800336LOCAL_C_INCLUDES := $(hwui_c_includes)
John Reck4a4bc892015-10-12 07:38:22 -0700337
Chris Craik5fbd9db2015-10-19 11:22:11 -0700338LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
John Reck0418afa32016-03-07 13:24:25 -0800339LOCAL_STATIC_LIBRARIES := libgoogle-benchmark
John Reck4a4bc892015-10-12 07:38:22 -0700340
341LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800342 $(hwui_test_common_src_files) \
John Reck0418afa32016-03-07 13:24:25 -0800343 tests/microbench/main.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800344 tests/microbench/DisplayListCanvasBench.cpp \
John Reck2c0f9372016-03-28 09:34:35 -0700345 tests/microbench/FontBench.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800346 tests/microbench/LinearAllocatorBench.cpp \
347 tests/microbench/PathParserBench.cpp \
Chris Craikb251a2f2016-02-08 19:36:46 +0000348 tests/microbench/ShadowBench.cpp \
349 tests/microbench/TaskManagerBench.cpp
John Reck4a4bc892015-10-12 07:38:22 -0700350
John Reck7db5ffb2016-01-15 13:17:09 -0800351ifeq (true, $(HWUI_NEW_OPS))
352 LOCAL_SRC_FILES += \
353 tests/microbench/FrameBuilderBench.cpp
354endif
Chris Craik0a24b142015-10-19 17:10:19 -0700355
Derek Sollenberger991da312016-02-11 12:13:07 -0500356include $(LOCAL_PATH)/hwui_static_deps.mk
John Reck4a4bc892015-10-12 07:38:22 -0700357include $(BUILD_EXECUTABLE)