blob: 953d7051a03d303ecebefe88836b6bd3ae7e8828 [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
Chris Craikb565df12015-10-05 13:00:52 -07006
John Reck975591a2016-01-22 16:28:07 -08007# Enables fine-grained GLES error checking
8# If set to true, every GLES call is wrapped & error checked
9# Has moderate overhead
John Reck756619d2016-04-15 11:31:09 -070010HWUI_ENABLE_OPENGL_VALIDATION := false
John Reck975591a2016-01-22 16:28:07 -080011
John Reckd2e72142015-08-17 13:11:43 -070012hwui_src_files := \
13 font/CacheTexture.cpp \
14 font/Font.cpp \
sergeyvdccca442016-03-21 15:38:21 -070015 hwui/Canvas.cpp \
16 hwui/MinikinSkia.cpp \
17 hwui/MinikinUtils.cpp \
18 hwui/PaintImpl.cpp \
sergeyvbad99182016-03-17 11:24:22 -070019 hwui/Typeface.cpp \
John Reckd2e72142015-08-17 13:11:43 -070020 renderstate/Blend.cpp \
21 renderstate/MeshState.cpp \
Chris Craik9fded232015-11-11 16:42:34 -080022 renderstate/OffscreenBufferPool.cpp \
John Reckd2e72142015-08-17 13:11:43 -070023 renderstate/PixelBufferState.cpp \
24 renderstate/RenderState.cpp \
25 renderstate/Scissor.cpp \
26 renderstate/Stencil.cpp \
27 renderstate/TextureState.cpp \
28 renderthread/CanvasContext.cpp \
29 renderthread/DrawFrameTask.cpp \
30 renderthread/EglManager.cpp \
31 renderthread/RenderProxy.cpp \
32 renderthread/RenderTask.cpp \
33 renderthread/RenderThread.cpp \
34 renderthread/TimeLord.cpp \
35 thread/TaskManager.cpp \
36 utils/Blur.cpp \
37 utils/GLUtils.cpp \
38 utils/LinearAllocator.cpp \
Derek Sollenberger4c5efe92015-07-10 13:56:39 -040039 utils/NinePatchImpl.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -070040 utils/StringUtils.cpp \
Tom Hudsonb2f5bd22015-10-15 16:41:55 -040041 utils/TestWindowContext.cpp \
Doris Liu804618d2015-11-16 22:48:34 -080042 utils/VectorDrawableUtils.cpp \
John Reckd2e72142015-08-17 13:11:43 -070043 AmbientShadow.cpp \
44 AnimationContext.cpp \
45 Animator.cpp \
46 AnimatorManager.cpp \
47 AssetAtlas.cpp \
48 Caches.cpp \
49 CanvasState.cpp \
50 ClipArea.cpp \
51 DamageAccumulator.cpp \
52 DeferredDisplayList.cpp \
53 DeferredLayerUpdater.cpp \
John Reck704bed02015-11-05 09:22:17 -080054 DeviceInfo.cpp \
John Reckd2e72142015-08-17 13:11:43 -070055 DisplayList.cpp \
56 DisplayListCanvas.cpp \
57 Dither.cpp \
58 Extensions.cpp \
59 FboCache.cpp \
60 FontRenderer.cpp \
61 FrameInfo.cpp \
62 FrameInfoVisualizer.cpp \
63 GammaFontRenderer.cpp \
64 GlopBuilder.cpp \
John Reck38e0c322015-11-10 12:19:17 -080065 GpuMemoryTracker.cpp \
John Reckd2e72142015-08-17 13:11:43 -070066 GradientCache.cpp \
67 Image.cpp \
68 Interpolator.cpp \
69 JankTracker.cpp \
70 Layer.cpp \
71 LayerCache.cpp \
72 LayerRenderer.cpp \
Chris Craik0b7e8242015-10-28 16:50:44 -070073 LayerUpdateQueue.cpp \
John Reckd2e72142015-08-17 13:11:43 -070074 Matrix.cpp \
75 OpenGLRenderer.cpp \
76 Patch.cpp \
77 PatchCache.cpp \
78 PathCache.cpp \
79 PathTessellator.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080080 PathParser.cpp \
John Reckd2e72142015-08-17 13:11:43 -070081 PixelBuffer.cpp \
82 Program.cpp \
83 ProgramCache.cpp \
84 Properties.cpp \
Doris Liu766431a2016-02-04 22:17:11 +000085 PropertyValuesHolder.cpp \
86 PropertyValuesAnimatorSet.cpp \
John Reck10dd0582016-03-31 16:36:16 -070087 Readback.cpp \
John Reckd2e72142015-08-17 13:11:43 -070088 RenderBufferCache.cpp \
89 RenderNode.cpp \
90 RenderProperties.cpp \
91 ResourceCache.cpp \
92 ShadowTessellator.cpp \
93 SkiaCanvas.cpp \
94 SkiaCanvasProxy.cpp \
95 SkiaShader.cpp \
96 Snapshot.cpp \
97 SpotShadow.cpp \
98 TessellationCache.cpp \
99 TextDropShadowCache.cpp \
100 Texture.cpp \
John Recke248bd12015-08-05 13:53:53 -0700101 TextureCache.cpp \
Doris Liu4bbc2932015-12-01 17:59:40 -0800102 VectorDrawable.cpp \
John Recke248bd12015-08-05 13:53:53 -0700103 protos/hwui.proto
John Reckd2e72142015-08-17 13:11:43 -0700104
Chris Craik8160f202015-12-02 14:50:25 -0800105hwui_test_common_src_files := \
Chris Craik27e58b42015-12-07 10:01:38 -0800106 $(call all-cpp-files-under, tests/common/scenes) \
sergeyv06a62f62016-06-16 14:52:20 -0700107 tests/common/TestListViewSceneBase.cpp \
Chris Craik27e58b42015-12-07 10:01:38 -0800108 tests/common/TestContext.cpp \
109 tests/common/TestScene.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800110 tests/common/TestUtils.cpp
111
sergeyv8bd5edf2016-05-13 15:03:35 -0700112hwui_debug_common_src_files := \
113 debug/wrap_gles.cpp \
114 debug/DefaultGlesDriver.cpp \
115 debug/GlesErrorCheckWrapper.cpp \
116 debug/GlesDriver.cpp \
117 debug/FatalBaseDriver.cpp \
118 debug/NullGlesDriver.cpp
119
John Reckd2e72142015-08-17 13:11:43 -0700120hwui_cflags := \
121 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
122 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
John Reck82f5e0c2015-10-22 17:07:45 -0700123 -Wall -Wno-unused-parameter -Wunreachable-code -Werror
John Reckd2e72142015-08-17 13:11:43 -0700124
John Reckc90ed752015-11-04 07:39:44 -0800125# GCC false-positives on this warning, and since we -Werror that's
126# a problem
127hwui_cflags += -Wno-free-nonheap-object
128
Chris Craikb565df12015-10-05 13:00:52 -0700129ifeq (true, $(HWUI_NEW_OPS))
130 hwui_src_files += \
Chris Craik9e7fcfd2015-11-25 13:27:33 -0800131 BakedOpDispatcher.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700132 BakedOpRenderer.cpp \
Chris Craike4db79d2015-12-22 16:32:23 -0800133 BakedOpState.cpp \
Chris Craikf158b492016-01-12 14:45:08 -0800134 FrameBuilder.cpp \
135 LayerBuilder.cpp \
Chris Craik91eff222016-02-22 13:39:33 -0800136 OpDumper.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700137 RecordingCanvas.cpp
138
139 hwui_cflags += -DHWUI_NEW_OPS
140
141endif
142
John Reckd2e72142015-08-17 13:11:43 -0700143ifndef HWUI_COMPILE_SYMBOLS
144 hwui_cflags += -fvisibility=hidden
145endif
146
147ifdef HWUI_COMPILE_FOR_PERF
148 # TODO: Non-arm?
149 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
150endif
151
John Recke248bd12015-08-05 13:53:53 -0700152# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
153# which varies depending on what is being built
154define hwui_proto_include
155$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
156endef
157
John Reckd2e72142015-08-17 13:11:43 -0700158hwui_c_includes += \
Leon Scroggins III55078072015-07-31 10:38:40 -0400159 external/skia/include/private \
sergeyvdccca442016-03-21 15:38:21 -0700160 external/skia/src/core \
161 external/harfbuzz_ng/src \
162 external/freetype/include
John Reckd2e72142015-08-17 13:11:43 -0700163
John Reckd2e72142015-08-17 13:11:43 -0700164ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
165 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
John Reckd2e72142015-08-17 13:11:43 -0700166 hwui_c_includes += \
167 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
168 frameworks/rs/cpp \
169 frameworks/rs
170endif
171
John Reckd2e72142015-08-17 13:11:43 -0700172# ------------------------
173# static library
174# ------------------------
175
176include $(CLEAR_VARS)
177
178LOCAL_MODULE_CLASS := STATIC_LIBRARIES
179LOCAL_MODULE := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700180LOCAL_CFLAGS := $(hwui_cflags)
181LOCAL_SRC_FILES := $(hwui_src_files)
sergeyv8bd5edf2016-05-13 15:03:35 -0700182
183ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION))
184 LOCAL_CFLAGS += -include debug/wrap_gles.h
185 LOCAL_CFLAGS += -DDEBUG_OPENGL=3
186 LOCAL_SRC_FILES += $(hwui_debug_common_src_files)
187endif
188
John Recke248bd12015-08-05 13:53:53 -0700189LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
Derek Sollenberger991da312016-02-11 12:13:07 -0500190LOCAL_EXPORT_C_INCLUDE_DIRS := \
191 $(LOCAL_PATH) \
Derek Sollenberger991da312016-02-11 12:13:07 -0500192 $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700193
Derek Sollenberger991da312016-02-11 12:13:07 -0500194include $(LOCAL_PATH)/hwui_static_deps.mk
John Reckd2e72142015-08-17 13:11:43 -0700195include $(BUILD_STATIC_LIBRARY)
196
197# ------------------------
Chris Craik5fbd9db2015-10-19 11:22:11 -0700198# static library null gpu
199# ------------------------
200
201include $(CLEAR_VARS)
202
203LOCAL_MODULE_CLASS := STATIC_LIBRARIES
sergeyv8bd5edf2016-05-13 15:03:35 -0700204LOCAL_MODULE := libhwui_static_debug
Chris Craik5fbd9db2015-10-19 11:22:11 -0700205LOCAL_CFLAGS := \
206 $(hwui_cflags) \
sergeyv8bd5edf2016-05-13 15:03:35 -0700207 -include debug/wrap_gles.h \
Chris Craik5fbd9db2015-10-19 11:22:11 -0700208 -DHWUI_NULL_GPU
209LOCAL_SRC_FILES := \
210 $(hwui_src_files) \
sergeyv8bd5edf2016-05-13 15:03:35 -0700211 $(hwui_debug_common_src_files) \
212 debug/nullegl.cpp
Chris Craik5fbd9db2015-10-19 11:22:11 -0700213LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
Derek Sollenberger991da312016-02-11 12:13:07 -0500214LOCAL_EXPORT_C_INCLUDE_DIRS := \
215 $(LOCAL_PATH) \
Derek Sollenberger991da312016-02-11 12:13:07 -0500216 $(call hwui_proto_include)
Chris Craik5fbd9db2015-10-19 11:22:11 -0700217
Derek Sollenberger991da312016-02-11 12:13:07 -0500218include $(LOCAL_PATH)/hwui_static_deps.mk
Chris Craik5fbd9db2015-10-19 11:22:11 -0700219include $(BUILD_STATIC_LIBRARY)
220
221# ------------------------
John Reckd2e72142015-08-17 13:11:43 -0700222# shared library
223# ------------------------
224
225include $(CLEAR_VARS)
226
John Recka2732a22014-12-18 13:52:33 -0800227LOCAL_MODULE_CLASS := SHARED_LIBRARIES
228LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700229LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
Derek Sollenberger991da312016-02-11 12:13:07 -0500230LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
Romain Guye4d01122010-06-16 18:44:05 -0700231
Derek Sollenberger991da312016-02-11 12:13:07 -0500232include $(LOCAL_PATH)/hwui_static_deps.mk
John Recka2732a22014-12-18 13:52:33 -0800233include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800234
John Reckd2e72142015-08-17 13:11:43 -0700235# ------------------------
236# unit tests
237# ------------------------
238
239include $(CLEAR_VARS)
240
241LOCAL_MODULE := hwui_unit_tests
242LOCAL_MODULE_TAGS := tests
sergeyv8bd5edf2016-05-13 15:03:35 -0700243LOCAL_STATIC_LIBRARIES := libgmock libhwui_static_debug
John Reckdc87c522016-02-29 13:31:18 -0800244LOCAL_SHARED_LIBRARIES := libmemunreachable
Chris Craik98787e62015-11-13 10:55:30 -0800245LOCAL_CFLAGS := \
246 $(hwui_cflags) \
sergeyv8bd5edf2016-05-13 15:03:35 -0700247 -include debug/wrap_gles.h \
Chris Craik98787e62015-11-13 10:55:30 -0800248 -DHWUI_NULL_GPU
Dan Willemsene9c205b2016-03-07 12:58:33 -0800249LOCAL_C_INCLUDES := $(hwui_c_includes)
John Reckd2e72142015-08-17 13:11:43 -0700250
251LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800252 $(hwui_test_common_src_files) \
John Reckdc87c522016-02-29 13:31:18 -0800253 tests/unit/main.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800254 tests/unit/CanvasStateTests.cpp \
255 tests/unit/ClipAreaTests.cpp \
256 tests/unit/DamageAccumulatorTests.cpp \
257 tests/unit/DeviceInfoTests.cpp \
258 tests/unit/FatVectorTests.cpp \
Chris Craikf3754a82016-04-19 18:13:21 -0700259 tests/unit/FontRendererTests.cpp \
sergeyvf42bf3e2016-03-11 13:45:15 -0800260 tests/unit/GlopBuilderTests.cpp \
John Reck38e0c322015-11-10 12:19:17 -0800261 tests/unit/GpuMemoryTrackerTests.cpp \
Chris Craik04d46eb2016-04-07 13:51:07 -0700262 tests/unit/GradientCacheTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800263 tests/unit/LayerUpdateQueueTests.cpp \
264 tests/unit/LinearAllocatorTests.cpp \
Chris Craik261725f2016-02-29 12:52:33 -0800265 tests/unit/MatrixTests.cpp \
sergeyv8bd5edf2016-05-13 15:03:35 -0700266 tests/unit/MeshStateTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800267 tests/unit/OffscreenBufferPoolTests.cpp \
John Reck44b49f02016-03-25 14:29:48 -0700268 tests/unit/RenderNodeTests.cpp \
Chris Craikd4fe4d32016-06-09 16:57:11 -0700269 tests/unit/RenderPropertiesTests.cpp \
Chris Craik07d8d592016-02-03 18:43:04 -0800270 tests/unit/SkiaBehaviorTests.cpp \
Chris Craik04d46eb2016-04-07 13:51:07 -0700271 tests/unit/SnapshotTests.cpp \
Andres Morales06f5bc72015-12-15 15:21:31 -0800272 tests/unit/StringUtilsTests.cpp \
Chris Craik37413282016-05-12 17:48:51 -0700273 tests/unit/TestUtilsTests.cpp \
Chris Craik07d8d592016-02-03 18:43:04 -0800274 tests/unit/TextDropShadowCacheTests.cpp \
Chris Craik04d46eb2016-04-07 13:51:07 -0700275 tests/unit/VectorDrawableTests.cpp
John Reckd2e72142015-08-17 13:11:43 -0700276
Chris Craikb565df12015-10-05 13:00:52 -0700277ifeq (true, $(HWUI_NEW_OPS))
278 LOCAL_SRC_FILES += \
Chris Craik419a1e72016-03-08 16:24:12 -0800279 tests/unit/BakedOpDispatcherTests.cpp \
Chris Craik02806282016-03-11 19:16:21 -0800280 tests/unit/BakedOpRendererTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800281 tests/unit/BakedOpStateTests.cpp \
Chris Craikf158b492016-01-12 14:45:08 -0800282 tests/unit/FrameBuilderTests.cpp \
John Reck1b94f9b2016-01-19 09:42:15 -0800283 tests/unit/LeakCheckTests.cpp \
Chris Craik91eff222016-02-22 13:39:33 -0800284 tests/unit/OpDumperTests.cpp \
Derek Sollenberger35934cc2016-03-23 14:59:10 -0400285 tests/unit/RecordingCanvasTests.cpp \
286 tests/unit/SkiaCanvasTests.cpp
Chris Craikb565df12015-10-05 13:00:52 -0700287endif
288
Derek Sollenberger991da312016-02-11 12:13:07 -0500289include $(LOCAL_PATH)/hwui_static_deps.mk
John Reckd2e72142015-08-17 13:11:43 -0700290include $(BUILD_NATIVE_TEST)
291
292# ------------------------
Chris Craik8160f202015-12-02 14:50:25 -0800293# Macro-bench app
John Reckd2e72142015-08-17 13:11:43 -0700294# ------------------------
295
296include $(CLEAR_VARS)
297
298LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
299LOCAL_MODULE:= hwuitest
300LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700301LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700302LOCAL_MULTILIB := both
303LOCAL_MODULE_STEM_32 := hwuitest
304LOCAL_MODULE_STEM_64 := hwuitest64
John Reckd2e72142015-08-17 13:11:43 -0700305LOCAL_CFLAGS := $(hwui_cflags)
Dan Willemsene9c205b2016-03-07 12:58:33 -0800306LOCAL_C_INCLUDES := $(hwui_c_includes)
John Reckd2e72142015-08-17 13:11:43 -0700307
sergeyv8bd5edf2016-05-13 15:03:35 -0700308# set to libhwui_static_debug to skip actual GL commands
Chris Craik5fbd9db2015-10-19 11:22:11 -0700309LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700310
311LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800312 $(hwui_test_common_src_files) \
Chris Craik8160f202015-12-02 14:50:25 -0800313 tests/macrobench/TestSceneRunner.cpp \
314 tests/macrobench/main.cpp
John Reckd2e72142015-08-17 13:11:43 -0700315
Derek Sollenberger991da312016-02-11 12:13:07 -0500316include $(LOCAL_PATH)/hwui_static_deps.mk
John Reckd2e72142015-08-17 13:11:43 -0700317include $(BUILD_EXECUTABLE)
John Reck4a4bc892015-10-12 07:38:22 -0700318
319# ------------------------
320# Micro-bench app
321# ---------------------
322include $(CLEAR_VARS)
323
324LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
325LOCAL_MODULE:= hwuimicro
326LOCAL_MODULE_TAGS := tests
327LOCAL_MODULE_CLASS := EXECUTABLES
328LOCAL_MULTILIB := both
329LOCAL_MODULE_STEM_32 := hwuimicro
330LOCAL_MODULE_STEM_64 := hwuimicro64
Chris Craik8d1f2122015-11-24 16:40:09 -0800331LOCAL_CFLAGS := \
332 $(hwui_cflags) \
sergeyv8bd5edf2016-05-13 15:03:35 -0700333 -include debug/wrap_gles.h \
Chris Craik8d1f2122015-11-24 16:40:09 -0800334 -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
sergeyv8bd5edf2016-05-13 15:03:35 -0700338LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_debug
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)