blob: e0896ce311ac876d2f83cb9d5a89bb9ff99cb60e [file] [log] [blame]
Colin Crossf6298102017-04-19 15:25:25 -07001cc_defaults {
2 name: "hwui_defaults",
3 defaults: [
4 "hwui_static_deps",
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -08005 "skia_deps",
Colin Crossf6298102017-04-19 15:25:25 -07006 //"hwui_bugreport_font_cache_usage",
7 //"hwui_compile_for_perf",
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -08008 "hwui_pgo",
Pirama Arumuga Nainarb7913e12018-03-09 00:03:57 +00009 "hwui_lto",
Colin Crossf6298102017-04-19 15:25:25 -070010 ],
11
John Reck283bb462018-12-13 16:40:14 -080012 cpp_std: "experimental",
13
Colin Crossf6298102017-04-19 15:25:25 -070014 cflags: [
15 "-DEGL_EGLEXT_PROTOTYPES",
16 "-DGL_GLEXT_PROTOTYPES",
17 "-DATRACE_TAG=ATRACE_TAG_VIEW",
18 "-DLOG_TAG=\"OpenGLRenderer\"",
19 "-Wall",
20 "-Wno-unused-parameter",
21 "-Wunreachable-code",
22 "-Werror",
23 "-fvisibility=hidden",
24
25 // GCC false-positives on this warning, and since we -Werror that's
26 // a problem
27 "-Wno-free-nonheap-object",
28
29 // clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
30 "-Wno-missing-braces",
Yi Kong304d4bd2019-10-14 01:53:46 -070031
32 // Clang is producing non-determistic binary when the new pass manager is
33 // enabled. Disable the new PM as a temporary workaround.
34 // b/142372146
35 "-fno-experimental-new-pass-manager",
Colin Crossf6298102017-04-19 15:25:25 -070036 ],
37
38 include_dirs: [
39 "external/skia/include/private",
40 "external/skia/src/core",
41 "external/skia/src/effects",
42 "external/skia/src/image",
43 "external/skia/src/utils",
Stan Iliev3310fb12017-03-23 16:56:51 -040044 "external/skia/src/gpu",
Derek Sollenberger02456f02018-05-30 18:08:57 -040045 "external/skia/src/shaders",
Colin Crossf6298102017-04-19 15:25:25 -070046 ],
47
48 product_variables: {
John Reck27294182018-07-11 11:21:09 -070049 eng: {
50 lto: {
51 never: true,
52 },
53 },
Colin Crossf6298102017-04-19 15:25:25 -070054 },
55}
56
57cc_defaults {
58 name: "hwui_static_deps",
59 shared_libs: [
60 "liblog",
61 "libcutils",
Yangster-macba5bf0d2018-10-09 20:48:23 -070062 "libstatslog",
Colin Crossf6298102017-04-19 15:25:25 -070063 "libutils",
64 "libEGL",
dimitry61dfd8f2018-12-28 22:49:08 +010065 "libGLESv1_CM",
Colin Crossf6298102017-04-19 15:25:25 -070066 "libGLESv2",
dimitrycab37cd2018-12-13 15:36:45 +010067 "libGLESv3",
Colin Crossf6298102017-04-19 15:25:25 -070068 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070069 "libui",
70 "libgui",
John Reck915883b2017-05-03 10:27:20 -070071 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070072 "libharfbuzz_ng",
73 "libft2",
74 "libminikin",
75 "libandroidfw",
Yichi Chen9f959552018-03-29 21:21:54 +080076 "libcrypto",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -050077 "libsync",
Colin Crossf6298102017-04-19 15:25:25 -070078 ],
79 static_libs: [
Stan Ilievd495f432017-10-09 15:49:32 -040080 "libEGL_blobCache",
Colin Crossf6298102017-04-19 15:25:25 -070081 ],
82}
83
84cc_defaults {
85 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -070086 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
87}
88
89cc_defaults {
90 name: "hwui_compile_for_perf",
91 // TODO: Non-arm?
92 cflags: [
93 "-fno-omit-frame-pointer",
94 "-marm",
95 "-mapcs",
96 ],
97}
98
99cc_defaults {
100 name: "hwui_debug",
101 cflags: ["-include debug/wrap_gles.h"],
102 srcs: [
103 "debug/wrap_gles.cpp",
104 "debug/DefaultGlesDriver.cpp",
105 "debug/GlesErrorCheckWrapper.cpp",
106 "debug/GlesDriver.cpp",
107 "debug/FatalBaseDriver.cpp",
108 "debug/NullGlesDriver.cpp",
109 ],
110 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
111}
112
113cc_defaults {
114 name: "hwui_enable_opengl_validation",
115 defaults: ["hwui_debug"],
116 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700117 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
118}
119
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800120// Build libhwui with PGO by default.
121// Location of PGO profile data is defined in build/soong/cc/pgo.go
122// and is separate from hwui.
123// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
124// or set enable_profile_use property to false.
125cc_defaults {
126 name: "hwui_pgo",
127
128 pgo: {
129 instrumentation: true,
130 profile_file: "hwui/hwui.profdata",
131 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800132 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800133 },
134}
135
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800136// Build hwui library with ThinLTO by default.
137cc_defaults {
138 name: "hwui_lto",
139 target: {
140 android: {
141 lto: {
142 thin: true,
143 },
144 },
145 },
146}
147
Colin Crossf6298102017-04-19 15:25:25 -0700148// ------------------------
149// library
150// ------------------------
151
152cc_defaults {
153 name: "libhwui_defaults",
154 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400155
156 whole_static_libs: ["libskia"],
157
Colin Crossf6298102017-04-19 15:25:25 -0700158 srcs: [
Derek Sollenberger2d142132018-01-22 10:25:26 -0500159 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500160 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700161 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700162 "hwui/Canvas.cpp",
163 "hwui/MinikinSkia.cpp",
164 "hwui/MinikinUtils.cpp",
165 "hwui/PaintImpl.cpp",
166 "hwui/Typeface.cpp",
167 "pipeline/skia/GLFunctorDrawable.cpp",
168 "pipeline/skia/LayerDrawable.cpp",
169 "pipeline/skia/RenderNodeDrawable.cpp",
170 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400171 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700172 "pipeline/skia/SkiaDisplayList.cpp",
Derek Sollenberger0057db22018-03-29 14:18:44 -0400173 "pipeline/skia/SkiaMemoryTracer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700174 "pipeline/skia/SkiaOpenGLPipeline.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700175 "pipeline/skia/SkiaPipeline.cpp",
176 "pipeline/skia/SkiaProfileRenderer.cpp",
177 "pipeline/skia/SkiaRecordingCanvas.cpp",
178 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400179 "pipeline/skia/VectorDrawableAtlas.cpp",
Chris Blume41423392018-11-06 11:47:03 -0800180 "pipeline/skia/VkFunctorDrawable.cpp",
Chris Blume5f1ac2b2018-11-05 16:10:39 -0800181 "pipeline/skia/VkInteropFunctorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700182 "renderstate/RenderState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400183 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700184 "renderthread/CanvasContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700185 "renderthread/DrawFrameTask.cpp",
186 "renderthread/EglManager.cpp",
John Reck848f6512018-12-03 13:26:43 -0800187 "renderthread/ReliableSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700188 "renderthread/VulkanManager.cpp",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -0500189 "renderthread/VulkanSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700190 "renderthread/RenderProxy.cpp",
191 "renderthread/RenderTask.cpp",
192 "renderthread/RenderThread.cpp",
193 "renderthread/TimeLord.cpp",
194 "renderthread/Frame.cpp",
195 "service/GraphicsStatsService.cpp",
Stan Iliev564ca3e2018-09-04 22:00:00 +0000196 "surfacetexture/EGLConsumer.cpp",
197 "surfacetexture/ImageConsumer.cpp",
198 "surfacetexture/SurfaceTexture.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700199 "thread/CommonPool.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700200 "utils/Blur.cpp",
201 "utils/Color.cpp",
202 "utils/GLUtils.cpp",
203 "utils/LinearAllocator.cpp",
204 "utils/StringUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700205 "utils/VectorDrawableUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700206 "AnimationContext.cpp",
207 "Animator.cpp",
208 "AnimatorManager.cpp",
John Reck9ce2bf72018-07-02 18:33:32 -0700209 "CanvasTransform.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700210 "DamageAccumulator.cpp",
211 "DeferredLayerUpdater.cpp",
212 "DeviceInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700213 "FrameInfo.cpp",
214 "FrameInfoVisualizer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700215 "GpuMemoryTracker.cpp",
John Recke170fb62018-05-07 08:12:07 -0700216 "HardwareBitmapUploader.cpp",
Stan Ilievb8811aa52018-11-08 16:25:54 -0500217 "HWUIProperties.sysprop",
Colin Crossf6298102017-04-19 15:25:25 -0700218 "Interpolator.cpp",
219 "JankTracker.cpp",
220 "Layer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700221 "LayerUpdateQueue.cpp",
222 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700223 "PathParser.cpp",
John Reck7075c792017-07-05 14:03:43 -0700224 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700225 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700226 "Properties.cpp",
227 "PropertyValuesAnimatorSet.cpp",
228 "PropertyValuesHolder.cpp",
Stan Iliev1a025a72018-09-05 16:35:11 -0400229 "Readback.cpp",
John Reck8f45d4a2018-08-15 10:17:12 -0700230 "RecordingCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700231 "RenderNode.cpp",
232 "RenderProperties.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700233 "SkiaCanvas.cpp",
John Reckbb3a3582018-09-26 11:21:08 -0700234 "TreeInfo.cpp",
John Reck283bb462018-12-13 16:40:14 -0800235 "WebViewFunctorManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700236 "VectorDrawable.cpp",
Kweku Adams228b6d22018-04-12 13:09:04 -0700237 "protos/graphicsstats.proto",
Colin Crossf6298102017-04-19 15:25:25 -0700238 ],
239
Chih-Hung Hsiehe1afb6c2018-10-22 12:25:50 -0700240 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
241 cflags: ["-Wno-implicit-fallthrough"],
242
Kweku Adams228b6d22018-04-12 13:09:04 -0700243 proto: {
244 export_proto_headers: true,
245 },
246
Colin Crossf6298102017-04-19 15:25:25 -0700247 export_include_dirs: ["."],
248}
249
250cc_library {
251 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700252 defaults: [
253 "libhwui_defaults",
254
255 // Enables fine-grained GLES error checking
256 // If enabled, every GLES call is wrapped & error checked
257 // Has moderate overhead
John Reckbdc9f1b2018-09-14 15:22:35 -0700258 //"hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700259 ],
Colin Crossf6298102017-04-19 15:25:25 -0700260}
261
262// ------------------------
263// static library null gpu
264// ------------------------
265
266cc_library_static {
267 name: "libhwui_static_debug",
268 defaults: [
269 "libhwui_defaults",
270 "hwui_debug",
271 ],
272 cflags: ["-DHWUI_NULL_GPU"],
273 srcs: [
274 "debug/nullegl.cpp",
275 ],
Colin Crossf6298102017-04-19 15:25:25 -0700276}
277
278cc_defaults {
279 name: "hwui_test_defaults",
280 defaults: ["hwui_defaults"],
281 test_suites: ["device-tests"],
282 srcs: [
283 "tests/common/scenes/*.cpp",
284 "tests/common/LeakChecker.cpp",
285 "tests/common/TestListViewSceneBase.cpp",
286 "tests/common/TestContext.cpp",
287 "tests/common/TestScene.cpp",
288 "tests/common/TestUtils.cpp",
289 ],
290}
291
292// ------------------------
293// unit tests
294// ------------------------
295
296cc_test {
297 name: "hwui_unit_tests",
298 defaults: ["hwui_test_defaults"],
299
300 static_libs: [
301 "libgmock",
302 "libhwui_static_debug",
303 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800304 shared_libs: [
305 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800306 ],
Colin Crossf6298102017-04-19 15:25:25 -0700307 cflags: [
308 "-include debug/wrap_gles.h",
309 "-DHWUI_NULL_GPU",
310 ],
311
312 srcs: [
313 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400314 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700315 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700316 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700317 "tests/unit/DamageAccumulatorTests.cpp",
318 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700319 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700320 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700321 "tests/unit/GraphicsStatsServiceTests.cpp",
322 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700323 "tests/unit/LinearAllocatorTests.cpp",
324 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700325 "tests/unit/PathInterpolatorTests.cpp",
326 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700327 "tests/unit/RenderNodeTests.cpp",
328 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800329 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400330 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700331 "tests/unit/SkiaBehaviorTests.cpp",
332 "tests/unit/SkiaDisplayListTests.cpp",
333 "tests/unit/SkiaPipelineTests.cpp",
334 "tests/unit/SkiaRenderPropertiesTests.cpp",
335 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700336 "tests/unit/StringUtilsTests.cpp",
337 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700338 "tests/unit/ThreadBaseTests.cpp",
339 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700340 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400341 "tests/unit/VectorDrawableAtlasTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800342 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700343 ],
344}
345
346// ------------------------
347// Macro-bench app
348// ------------------------
349
350cc_benchmark {
351 name: "hwuimacro",
352 defaults: ["hwui_test_defaults"],
353
354 // set to libhwui_static_debug to skip actual GL commands
355 whole_static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800356 shared_libs: [
357 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800358 ],
Colin Crossf6298102017-04-19 15:25:25 -0700359
360 srcs: [
361 "tests/macrobench/TestSceneRunner.cpp",
362 "tests/macrobench/main.cpp",
363 ],
364}
365
366// ------------------------
367// Micro-bench app
368// ---------------------
369
370cc_benchmark {
371 name: "hwuimicro",
372 defaults: ["hwui_test_defaults"],
373
374 cflags: [
375 "-include debug/wrap_gles.h",
376 "-DHWUI_NULL_GPU",
377 ],
378
379 whole_static_libs: ["libhwui_static_debug"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800380 shared_libs: [
381 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800382 ],
Colin Crossf6298102017-04-19 15:25:25 -0700383
384 srcs: [
385 "tests/microbench/main.cpp",
386 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700387 "tests/microbench/LinearAllocatorBench.cpp",
388 "tests/microbench/PathParserBench.cpp",
389 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700390 ],
391}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800392
393// ----------------------------------------
394// Phony target to build benchmarks for PGO
395// ----------------------------------------
396
397phony {
398 name: "pgo-targets-hwui",
399 required: [
400 "hwuimicro",
401 "hwuimacro",
402 ]
403}