blob: 95b28d3e8c26efbf56cafed55d8912ed14b4c9f8 [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
John Reck975591a2016-01-22 16:28:07 -08005# Enables fine-grained GLES error checking
6# If set to true, every GLES call is wrapped & error checked
7# Has moderate overhead
John Reck756619d2016-04-15 11:31:09 -07008HWUI_ENABLE_OPENGL_VALIDATION := false
John Reck975591a2016-01-22 16:28:07 -08009
John Reckd2e72142015-08-17 13:11:43 -070010hwui_src_files := \
11 font/CacheTexture.cpp \
12 font/Font.cpp \
sergeyvdccca442016-03-21 15:38:21 -070013 hwui/Canvas.cpp \
14 hwui/MinikinSkia.cpp \
15 hwui/MinikinUtils.cpp \
16 hwui/PaintImpl.cpp \
sergeyvbad99182016-03-17 11:24:22 -070017 hwui/Typeface.cpp \
John Reckd2e72142015-08-17 13:11:43 -070018 renderstate/Blend.cpp \
19 renderstate/MeshState.cpp \
Chris Craik9fded232015-11-11 16:42:34 -080020 renderstate/OffscreenBufferPool.cpp \
John Reckd2e72142015-08-17 13:11:43 -070021 renderstate/PixelBufferState.cpp \
22 renderstate/RenderState.cpp \
23 renderstate/Scissor.cpp \
24 renderstate/Stencil.cpp \
25 renderstate/TextureState.cpp \
26 renderthread/CanvasContext.cpp \
27 renderthread/DrawFrameTask.cpp \
28 renderthread/EglManager.cpp \
29 renderthread/RenderProxy.cpp \
30 renderthread/RenderTask.cpp \
31 renderthread/RenderThread.cpp \
32 renderthread/TimeLord.cpp \
33 thread/TaskManager.cpp \
34 utils/Blur.cpp \
35 utils/GLUtils.cpp \
36 utils/LinearAllocator.cpp \
Derek Sollenberger4c5efe92015-07-10 13:56:39 -040037 utils/NinePatchImpl.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -070038 utils/StringUtils.cpp \
Tom Hudsonb2f5bd22015-10-15 16:41:55 -040039 utils/TestWindowContext.cpp \
Doris Liu804618d2015-11-16 22:48:34 -080040 utils/VectorDrawableUtils.cpp \
John Reckd2e72142015-08-17 13:11:43 -070041 AmbientShadow.cpp \
42 AnimationContext.cpp \
43 Animator.cpp \
44 AnimatorManager.cpp \
45 AssetAtlas.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -070046 BakedOpDispatcher.cpp \
47 BakedOpRenderer.cpp \
48 BakedOpState.cpp \
John Reckd2e72142015-08-17 13:11:43 -070049 Caches.cpp \
50 CanvasState.cpp \
51 ClipArea.cpp \
52 DamageAccumulator.cpp \
John Reckd2e72142015-08-17 13:11:43 -070053 DeferredLayerUpdater.cpp \
John Reck704bed02015-11-05 09:22:17 -080054 DeviceInfo.cpp \
John Reckd2e72142015-08-17 13:11:43 -070055 DisplayList.cpp \
John Reckd2e72142015-08-17 13:11:43 -070056 Dither.cpp \
57 Extensions.cpp \
58 FboCache.cpp \
59 FontRenderer.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -070060 FrameBuilder.cpp \
John Reckd2e72142015-08-17 13:11:43 -070061 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 \
Chris Craik5e00c7c2016-07-06 16:10:09 -070071 LayerBuilder.cpp \
John Reckd2e72142015-08-17 13:11:43 -070072 LayerRenderer.cpp \
Chris Craik0b7e8242015-10-28 16:50:44 -070073 LayerUpdateQueue.cpp \
John Reckd2e72142015-08-17 13:11:43 -070074 Matrix.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -070075 OpDumper.cpp \
John Reckd2e72142015-08-17 13:11:43 -070076 Patch.cpp \
77 PatchCache.cpp \
78 PathCache.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080079 PathParser.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -070080 PathTessellator.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 PropertyValuesAnimatorSet.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -070086 PropertyValuesHolder.cpp \
John Reck10dd0582016-03-31 16:36:16 -070087 Readback.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -070088 RecordingCanvas.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) \
sergeyv7dc370b2016-06-17 11:21:11 -0700108 tests/common/LeakChecker.cpp \
sergeyv06a62f62016-06-16 14:52:20 -0700109 tests/common/TestListViewSceneBase.cpp \
Chris Craik27e58b42015-12-07 10:01:38 -0800110 tests/common/TestContext.cpp \
111 tests/common/TestScene.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800112 tests/common/TestUtils.cpp
113
sergeyv8bd5edf2016-05-13 15:03:35 -0700114hwui_debug_common_src_files := \
115 debug/wrap_gles.cpp \
116 debug/DefaultGlesDriver.cpp \
117 debug/GlesErrorCheckWrapper.cpp \
118 debug/GlesDriver.cpp \
119 debug/FatalBaseDriver.cpp \
120 debug/NullGlesDriver.cpp
121
John Reckd2e72142015-08-17 13:11:43 -0700122hwui_cflags := \
123 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
124 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
John Reck82f5e0c2015-10-22 17:07:45 -0700125 -Wall -Wno-unused-parameter -Wunreachable-code -Werror
John Reckd2e72142015-08-17 13:11:43 -0700126
John Reckc90ed752015-11-04 07:39:44 -0800127# GCC false-positives on this warning, and since we -Werror that's
128# a problem
129hwui_cflags += -Wno-free-nonheap-object
130
John Reckf1480762016-07-03 18:28:25 -0700131# clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
132hwui_cflags += -Wno-missing-braces
133
John Reckd2e72142015-08-17 13:11:43 -0700134ifndef HWUI_COMPILE_SYMBOLS
135 hwui_cflags += -fvisibility=hidden
136endif
137
138ifdef HWUI_COMPILE_FOR_PERF
139 # TODO: Non-arm?
140 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
141endif
142
John Recke248bd12015-08-05 13:53:53 -0700143# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
144# which varies depending on what is being built
145define hwui_proto_include
146$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
147endef
148
John Reckd2e72142015-08-17 13:11:43 -0700149hwui_c_includes += \
Leon Scroggins III55078072015-07-31 10:38:40 -0400150 external/skia/include/private \
sergeyvdccca442016-03-21 15:38:21 -0700151 external/skia/src/core \
152 external/harfbuzz_ng/src \
153 external/freetype/include
John Reckd2e72142015-08-17 13:11:43 -0700154
John Reckd2e72142015-08-17 13:11:43 -0700155ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
156 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
John Reckd2e72142015-08-17 13:11:43 -0700157 hwui_c_includes += \
158 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
159 frameworks/rs/cpp \
160 frameworks/rs
161endif
162
John Reckd2e72142015-08-17 13:11:43 -0700163# ------------------------
164# static library
165# ------------------------
166
167include $(CLEAR_VARS)
168
169LOCAL_MODULE_CLASS := STATIC_LIBRARIES
170LOCAL_MODULE := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700171LOCAL_CFLAGS := $(hwui_cflags)
172LOCAL_SRC_FILES := $(hwui_src_files)
sergeyv8bd5edf2016-05-13 15:03:35 -0700173
174ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION))
175 LOCAL_CFLAGS += -include debug/wrap_gles.h
176 LOCAL_CFLAGS += -DDEBUG_OPENGL=3
177 LOCAL_SRC_FILES += $(hwui_debug_common_src_files)
178endif
179
John Recke248bd12015-08-05 13:53:53 -0700180LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
Derek Sollenberger991da312016-02-11 12:13:07 -0500181LOCAL_EXPORT_C_INCLUDE_DIRS := \
182 $(LOCAL_PATH) \
Derek Sollenberger991da312016-02-11 12:13:07 -0500183 $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700184
Derek Sollenberger991da312016-02-11 12:13:07 -0500185include $(LOCAL_PATH)/hwui_static_deps.mk
John Reckd2e72142015-08-17 13:11:43 -0700186include $(BUILD_STATIC_LIBRARY)
187
188# ------------------------
Chris Craik5fbd9db2015-10-19 11:22:11 -0700189# static library null gpu
190# ------------------------
191
192include $(CLEAR_VARS)
193
194LOCAL_MODULE_CLASS := STATIC_LIBRARIES
sergeyv8bd5edf2016-05-13 15:03:35 -0700195LOCAL_MODULE := libhwui_static_debug
Chris Craik5fbd9db2015-10-19 11:22:11 -0700196LOCAL_CFLAGS := \
197 $(hwui_cflags) \
sergeyv8bd5edf2016-05-13 15:03:35 -0700198 -include debug/wrap_gles.h \
Chris Craik5fbd9db2015-10-19 11:22:11 -0700199 -DHWUI_NULL_GPU
200LOCAL_SRC_FILES := \
201 $(hwui_src_files) \
sergeyv8bd5edf2016-05-13 15:03:35 -0700202 $(hwui_debug_common_src_files) \
203 debug/nullegl.cpp
Chris Craik5fbd9db2015-10-19 11:22:11 -0700204LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
Derek Sollenberger991da312016-02-11 12:13:07 -0500205LOCAL_EXPORT_C_INCLUDE_DIRS := \
206 $(LOCAL_PATH) \
Derek Sollenberger991da312016-02-11 12:13:07 -0500207 $(call hwui_proto_include)
Chris Craik5fbd9db2015-10-19 11:22:11 -0700208
Derek Sollenberger991da312016-02-11 12:13:07 -0500209include $(LOCAL_PATH)/hwui_static_deps.mk
Chris Craik5fbd9db2015-10-19 11:22:11 -0700210include $(BUILD_STATIC_LIBRARY)
211
212# ------------------------
John Reckd2e72142015-08-17 13:11:43 -0700213# shared library
214# ------------------------
215
216include $(CLEAR_VARS)
217
John Recka2732a22014-12-18 13:52:33 -0800218LOCAL_MODULE_CLASS := SHARED_LIBRARIES
219LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700220LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
Derek Sollenberger991da312016-02-11 12:13:07 -0500221LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
Romain Guye4d01122010-06-16 18:44:05 -0700222
Derek Sollenberger991da312016-02-11 12:13:07 -0500223include $(LOCAL_PATH)/hwui_static_deps.mk
John Recka2732a22014-12-18 13:52:33 -0800224include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800225
John Reckd2e72142015-08-17 13:11:43 -0700226# ------------------------
227# unit tests
228# ------------------------
229
230include $(CLEAR_VARS)
231
232LOCAL_MODULE := hwui_unit_tests
233LOCAL_MODULE_TAGS := tests
sergeyv8bd5edf2016-05-13 15:03:35 -0700234LOCAL_STATIC_LIBRARIES := libgmock libhwui_static_debug
John Reckdc87c522016-02-29 13:31:18 -0800235LOCAL_SHARED_LIBRARIES := libmemunreachable
Chris Craik98787e62015-11-13 10:55:30 -0800236LOCAL_CFLAGS := \
237 $(hwui_cflags) \
sergeyv8bd5edf2016-05-13 15:03:35 -0700238 -include debug/wrap_gles.h \
Chris Craik98787e62015-11-13 10:55:30 -0800239 -DHWUI_NULL_GPU
Dan Willemsene9c205b2016-03-07 12:58:33 -0800240LOCAL_C_INCLUDES := $(hwui_c_includes)
John Reckd2e72142015-08-17 13:11:43 -0700241
242LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800243 $(hwui_test_common_src_files) \
John Reckdc87c522016-02-29 13:31:18 -0800244 tests/unit/main.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -0700245 tests/unit/BakedOpDispatcherTests.cpp \
246 tests/unit/BakedOpRendererTests.cpp \
247 tests/unit/BakedOpStateTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800248 tests/unit/CanvasStateTests.cpp \
249 tests/unit/ClipAreaTests.cpp \
250 tests/unit/DamageAccumulatorTests.cpp \
251 tests/unit/DeviceInfoTests.cpp \
252 tests/unit/FatVectorTests.cpp \
Chris Craikf3754a82016-04-19 18:13:21 -0700253 tests/unit/FontRendererTests.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -0700254 tests/unit/FrameBuilderTests.cpp \
sergeyvf42bf3e2016-03-11 13:45:15 -0800255 tests/unit/GlopBuilderTests.cpp \
John Reck38e0c322015-11-10 12:19:17 -0800256 tests/unit/GpuMemoryTrackerTests.cpp \
Chris Craik04d46eb2016-04-07 13:51:07 -0700257 tests/unit/GradientCacheTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800258 tests/unit/LayerUpdateQueueTests.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -0700259 tests/unit/LeakCheckTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800260 tests/unit/LinearAllocatorTests.cpp \
Chris Craik261725f2016-02-29 12:52:33 -0800261 tests/unit/MatrixTests.cpp \
sergeyv8bd5edf2016-05-13 15:03:35 -0700262 tests/unit/MeshStateTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800263 tests/unit/OffscreenBufferPoolTests.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -0700264 tests/unit/OpDumperTests.cpp \
265 tests/unit/RecordingCanvasTests.cpp \
John Reck44b49f02016-03-25 14:29:48 -0700266 tests/unit/RenderNodeTests.cpp \
Chris Craikd4fe4d32016-06-09 16:57:11 -0700267 tests/unit/RenderPropertiesTests.cpp \
Chris Craik07d8d592016-02-03 18:43:04 -0800268 tests/unit/SkiaBehaviorTests.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -0700269 tests/unit/SkiaCanvasTests.cpp \
Chris Craik04d46eb2016-04-07 13:51:07 -0700270 tests/unit/SnapshotTests.cpp \
Andres Morales06f5bc72015-12-15 15:21:31 -0800271 tests/unit/StringUtilsTests.cpp \
Chris Craik37413282016-05-12 17:48:51 -0700272 tests/unit/TestUtilsTests.cpp \
Chris Craik07d8d592016-02-03 18:43:04 -0800273 tests/unit/TextDropShadowCacheTests.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -0700274 tests/unit/VectorDrawableTests.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700275
Derek Sollenberger991da312016-02-11 12:13:07 -0500276include $(LOCAL_PATH)/hwui_static_deps.mk
John Reckd2e72142015-08-17 13:11:43 -0700277include $(BUILD_NATIVE_TEST)
278
279# ------------------------
Chris Craik8160f202015-12-02 14:50:25 -0800280# Macro-bench app
John Reckd2e72142015-08-17 13:11:43 -0700281# ------------------------
282
283include $(CLEAR_VARS)
284
285LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
286LOCAL_MODULE:= hwuitest
287LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700288LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700289LOCAL_MULTILIB := both
290LOCAL_MODULE_STEM_32 := hwuitest
291LOCAL_MODULE_STEM_64 := hwuitest64
John Reckd2e72142015-08-17 13:11:43 -0700292LOCAL_CFLAGS := $(hwui_cflags)
Dan Willemsene9c205b2016-03-07 12:58:33 -0800293LOCAL_C_INCLUDES := $(hwui_c_includes)
John Reckd2e72142015-08-17 13:11:43 -0700294
sergeyv8bd5edf2016-05-13 15:03:35 -0700295# set to libhwui_static_debug to skip actual GL commands
Chris Craik5fbd9db2015-10-19 11:22:11 -0700296LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
sergeyv7dc370b2016-06-17 11:21:11 -0700297LOCAL_SHARED_LIBRARIES := libmemunreachable
John Reckf1480762016-07-03 18:28:25 -0700298LOCAL_STATIC_LIBRARIES := libgoogle-benchmark
John Reckd2e72142015-08-17 13:11:43 -0700299
300LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800301 $(hwui_test_common_src_files) \
Chris Craik8160f202015-12-02 14:50:25 -0800302 tests/macrobench/TestSceneRunner.cpp \
303 tests/macrobench/main.cpp
John Reckd2e72142015-08-17 13:11:43 -0700304
Derek Sollenberger991da312016-02-11 12:13:07 -0500305include $(LOCAL_PATH)/hwui_static_deps.mk
John Reckd2e72142015-08-17 13:11:43 -0700306include $(BUILD_EXECUTABLE)
John Reck4a4bc892015-10-12 07:38:22 -0700307
308# ------------------------
309# Micro-bench app
310# ---------------------
311include $(CLEAR_VARS)
312
John Reck4a4bc892015-10-12 07:38:22 -0700313LOCAL_MODULE:= hwuimicro
314LOCAL_MODULE_TAGS := tests
Chris Craik8d1f2122015-11-24 16:40:09 -0800315LOCAL_CFLAGS := \
316 $(hwui_cflags) \
sergeyv8bd5edf2016-05-13 15:03:35 -0700317 -include debug/wrap_gles.h \
Chris Craik8d1f2122015-11-24 16:40:09 -0800318 -DHWUI_NULL_GPU
John Reck4a4bc892015-10-12 07:38:22 -0700319
John Reck2bee0dd2016-03-09 08:01:37 -0800320LOCAL_C_INCLUDES := $(hwui_c_includes)
John Reck4a4bc892015-10-12 07:38:22 -0700321
sergeyv8bd5edf2016-05-13 15:03:35 -0700322LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_debug
sergeyv7dc370b2016-06-17 11:21:11 -0700323LOCAL_SHARED_LIBRARIES := libmemunreachable
John Reck4a4bc892015-10-12 07:38:22 -0700324
325LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800326 $(hwui_test_common_src_files) \
John Reck0418afa32016-03-07 13:24:25 -0800327 tests/microbench/main.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800328 tests/microbench/DisplayListCanvasBench.cpp \
John Reck2c0f9372016-03-28 09:34:35 -0700329 tests/microbench/FontBench.cpp \
Chris Craik5e00c7c2016-07-06 16:10:09 -0700330 tests/microbench/FrameBuilderBench.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800331 tests/microbench/LinearAllocatorBench.cpp \
332 tests/microbench/PathParserBench.cpp \
Chris Craikb251a2f2016-02-08 19:36:46 +0000333 tests/microbench/ShadowBench.cpp \
334 tests/microbench/TaskManagerBench.cpp
John Reck4a4bc892015-10-12 07:38:22 -0700335
Chris Craik0a24b142015-10-19 17:10:19 -0700336
Derek Sollenberger991da312016-02-11 12:13:07 -0500337include $(LOCAL_PATH)/hwui_static_deps.mk
sergeyv422e2b42016-06-20 15:27:39 -0700338include $(BUILD_NATIVE_BENCHMARK)