blob: 9fe53d3b26494fb7d45947f1b449eefbb15cd09e [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",
Colin Crossf6298102017-04-19 15:25:25 -070031 ],
32
33 include_dirs: [
34 "external/skia/include/private",
35 "external/skia/src/core",
36 "external/skia/src/effects",
37 "external/skia/src/image",
38 "external/skia/src/utils",
Stan Iliev3310fb12017-03-23 16:56:51 -040039 "external/skia/src/gpu",
Derek Sollenberger02456f02018-05-30 18:08:57 -040040 "external/skia/src/shaders",
Colin Crossf6298102017-04-19 15:25:25 -070041 ],
42
43 product_variables: {
John Reck27294182018-07-11 11:21:09 -070044 eng: {
45 lto: {
46 never: true,
47 },
48 },
Colin Crossf6298102017-04-19 15:25:25 -070049 },
50}
51
52cc_defaults {
53 name: "hwui_static_deps",
54 shared_libs: [
55 "liblog",
56 "libcutils",
Yangster-macba5bf0d2018-10-09 20:48:23 -070057 "libstatslog",
Colin Crossf6298102017-04-19 15:25:25 -070058 "libutils",
59 "libEGL",
dimitry61dfd8f2018-12-28 22:49:08 +010060 "libGLESv1_CM",
Colin Crossf6298102017-04-19 15:25:25 -070061 "libGLESv2",
dimitrycab37cd2018-12-13 15:36:45 +010062 "libGLESv3",
Colin Crossf6298102017-04-19 15:25:25 -070063 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070064 "libui",
65 "libgui",
John Reck915883b2017-05-03 10:27:20 -070066 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070067 "libharfbuzz_ng",
68 "libft2",
69 "libminikin",
70 "libandroidfw",
Yichi Chen9f959552018-03-29 21:21:54 +080071 "libcrypto",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -050072 "libsync",
Colin Crossf6298102017-04-19 15:25:25 -070073 ],
74 static_libs: [
Stan Ilievd495f432017-10-09 15:49:32 -040075 "libEGL_blobCache",
Colin Crossf6298102017-04-19 15:25:25 -070076 ],
77}
78
79cc_defaults {
80 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -070081 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
82}
83
84cc_defaults {
85 name: "hwui_compile_for_perf",
86 // TODO: Non-arm?
87 cflags: [
88 "-fno-omit-frame-pointer",
89 "-marm",
90 "-mapcs",
91 ],
92}
93
94cc_defaults {
95 name: "hwui_debug",
96 cflags: ["-include debug/wrap_gles.h"],
97 srcs: [
98 "debug/wrap_gles.cpp",
99 "debug/DefaultGlesDriver.cpp",
100 "debug/GlesErrorCheckWrapper.cpp",
101 "debug/GlesDriver.cpp",
102 "debug/FatalBaseDriver.cpp",
103 "debug/NullGlesDriver.cpp",
Brian Osman8e874bb2019-04-08 12:24:46 -0400104 "debug/NullSkiaInterface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700105 ],
106 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
107}
108
109cc_defaults {
110 name: "hwui_enable_opengl_validation",
111 defaults: ["hwui_debug"],
112 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700113 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
114}
115
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800116// Build libhwui with PGO by default.
117// Location of PGO profile data is defined in build/soong/cc/pgo.go
118// and is separate from hwui.
119// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
120// or set enable_profile_use property to false.
121cc_defaults {
122 name: "hwui_pgo",
123
124 pgo: {
125 instrumentation: true,
126 profile_file: "hwui/hwui.profdata",
127 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800128 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800129 },
130}
131
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800132// Build hwui library with ThinLTO by default.
133cc_defaults {
134 name: "hwui_lto",
135 target: {
136 android: {
137 lto: {
138 thin: true,
139 },
140 },
141 },
142}
143
Colin Crossf6298102017-04-19 15:25:25 -0700144// ------------------------
145// library
146// ------------------------
147
148cc_defaults {
149 name: "libhwui_defaults",
150 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400151
152 whole_static_libs: ["libskia"],
153
Colin Crossf6298102017-04-19 15:25:25 -0700154 srcs: [
Derek Sollenberger2d142132018-01-22 10:25:26 -0500155 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500156 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700157 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700158 "hwui/Canvas.cpp",
159 "hwui/MinikinSkia.cpp",
160 "hwui/MinikinUtils.cpp",
161 "hwui/PaintImpl.cpp",
162 "hwui/Typeface.cpp",
163 "pipeline/skia/GLFunctorDrawable.cpp",
164 "pipeline/skia/LayerDrawable.cpp",
165 "pipeline/skia/RenderNodeDrawable.cpp",
166 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400167 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700168 "pipeline/skia/SkiaDisplayList.cpp",
Derek Sollenberger0057db22018-03-29 14:18:44 -0400169 "pipeline/skia/SkiaMemoryTracer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700170 "pipeline/skia/SkiaOpenGLPipeline.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700171 "pipeline/skia/SkiaPipeline.cpp",
172 "pipeline/skia/SkiaProfileRenderer.cpp",
173 "pipeline/skia/SkiaRecordingCanvas.cpp",
174 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400175 "pipeline/skia/VectorDrawableAtlas.cpp",
Chris Blume41423392018-11-06 11:47:03 -0800176 "pipeline/skia/VkFunctorDrawable.cpp",
Chris Blume5f1ac2b2018-11-05 16:10:39 -0800177 "pipeline/skia/VkInteropFunctorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700178 "renderstate/RenderState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400179 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700180 "renderthread/CanvasContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700181 "renderthread/DrawFrameTask.cpp",
182 "renderthread/EglManager.cpp",
John Reck848f6512018-12-03 13:26:43 -0800183 "renderthread/ReliableSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700184 "renderthread/VulkanManager.cpp",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -0500185 "renderthread/VulkanSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700186 "renderthread/RenderProxy.cpp",
187 "renderthread/RenderTask.cpp",
188 "renderthread/RenderThread.cpp",
189 "renderthread/TimeLord.cpp",
190 "renderthread/Frame.cpp",
191 "service/GraphicsStatsService.cpp",
Stan Iliev564ca3e2018-09-04 22:00:00 +0000192 "surfacetexture/EGLConsumer.cpp",
193 "surfacetexture/ImageConsumer.cpp",
194 "surfacetexture/SurfaceTexture.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700195 "thread/CommonPool.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700196 "utils/Blur.cpp",
197 "utils/Color.cpp",
198 "utils/GLUtils.cpp",
199 "utils/LinearAllocator.cpp",
200 "utils/StringUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700201 "utils/VectorDrawableUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700202 "AnimationContext.cpp",
203 "Animator.cpp",
204 "AnimatorManager.cpp",
John Reck9ce2bf72018-07-02 18:33:32 -0700205 "CanvasTransform.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700206 "DamageAccumulator.cpp",
207 "DeferredLayerUpdater.cpp",
208 "DeviceInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700209 "FrameInfo.cpp",
210 "FrameInfoVisualizer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700211 "GpuMemoryTracker.cpp",
John Recke170fb62018-05-07 08:12:07 -0700212 "HardwareBitmapUploader.cpp",
Stan Ilievb8811aa52018-11-08 16:25:54 -0500213 "HWUIProperties.sysprop",
Colin Crossf6298102017-04-19 15:25:25 -0700214 "Interpolator.cpp",
215 "JankTracker.cpp",
216 "Layer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700217 "LayerUpdateQueue.cpp",
218 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700219 "PathParser.cpp",
John Reck7075c792017-07-05 14:03:43 -0700220 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700221 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700222 "Properties.cpp",
223 "PropertyValuesAnimatorSet.cpp",
224 "PropertyValuesHolder.cpp",
Stan Iliev1a025a72018-09-05 16:35:11 -0400225 "Readback.cpp",
John Reck8f45d4a2018-08-15 10:17:12 -0700226 "RecordingCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700227 "RenderNode.cpp",
228 "RenderProperties.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700229 "SkiaCanvas.cpp",
John Reckbb3a3582018-09-26 11:21:08 -0700230 "TreeInfo.cpp",
John Reck283bb462018-12-13 16:40:14 -0800231 "WebViewFunctorManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700232 "VectorDrawable.cpp",
Kweku Adams228b6d22018-04-12 13:09:04 -0700233 "protos/graphicsstats.proto",
Colin Crossf6298102017-04-19 15:25:25 -0700234 ],
235
Chih-Hung Hsiehe1afb6c2018-10-22 12:25:50 -0700236 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
237 cflags: ["-Wno-implicit-fallthrough"],
238
Kweku Adams228b6d22018-04-12 13:09:04 -0700239 proto: {
240 export_proto_headers: true,
241 },
242
Colin Crossf6298102017-04-19 15:25:25 -0700243 export_include_dirs: ["."],
244}
245
246cc_library {
247 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700248 defaults: [
249 "libhwui_defaults",
250
251 // Enables fine-grained GLES error checking
252 // If enabled, every GLES call is wrapped & error checked
253 // Has moderate overhead
John Reckbdc9f1b2018-09-14 15:22:35 -0700254 //"hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700255 ],
Colin Crossf6298102017-04-19 15:25:25 -0700256}
257
258// ------------------------
259// static library null gpu
260// ------------------------
261
262cc_library_static {
263 name: "libhwui_static_debug",
264 defaults: [
265 "libhwui_defaults",
266 "hwui_debug",
267 ],
268 cflags: ["-DHWUI_NULL_GPU"],
269 srcs: [
270 "debug/nullegl.cpp",
271 ],
Colin Crossf6298102017-04-19 15:25:25 -0700272}
273
274cc_defaults {
275 name: "hwui_test_defaults",
276 defaults: ["hwui_defaults"],
277 test_suites: ["device-tests"],
278 srcs: [
279 "tests/common/scenes/*.cpp",
280 "tests/common/LeakChecker.cpp",
281 "tests/common/TestListViewSceneBase.cpp",
282 "tests/common/TestContext.cpp",
283 "tests/common/TestScene.cpp",
284 "tests/common/TestUtils.cpp",
285 ],
286}
287
288// ------------------------
289// unit tests
290// ------------------------
291
292cc_test {
293 name: "hwui_unit_tests",
294 defaults: ["hwui_test_defaults"],
295
296 static_libs: [
297 "libgmock",
298 "libhwui_static_debug",
299 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800300 shared_libs: [
301 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800302 ],
Colin Crossf6298102017-04-19 15:25:25 -0700303 cflags: [
304 "-include debug/wrap_gles.h",
305 "-DHWUI_NULL_GPU",
306 ],
307
308 srcs: [
309 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400310 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700311 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700312 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700313 "tests/unit/DamageAccumulatorTests.cpp",
314 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700315 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700316 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700317 "tests/unit/GraphicsStatsServiceTests.cpp",
318 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700319 "tests/unit/LinearAllocatorTests.cpp",
320 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700321 "tests/unit/PathInterpolatorTests.cpp",
322 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700323 "tests/unit/RenderNodeTests.cpp",
324 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800325 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400326 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700327 "tests/unit/SkiaBehaviorTests.cpp",
328 "tests/unit/SkiaDisplayListTests.cpp",
329 "tests/unit/SkiaPipelineTests.cpp",
330 "tests/unit/SkiaRenderPropertiesTests.cpp",
331 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700332 "tests/unit/StringUtilsTests.cpp",
333 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700334 "tests/unit/ThreadBaseTests.cpp",
335 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700336 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400337 "tests/unit/VectorDrawableAtlasTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800338 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700339 ],
340}
341
342// ------------------------
343// Macro-bench app
344// ------------------------
345
346cc_benchmark {
347 name: "hwuimacro",
348 defaults: ["hwui_test_defaults"],
349
350 // set to libhwui_static_debug to skip actual GL commands
351 whole_static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800352 shared_libs: [
353 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800354 ],
Colin Crossf6298102017-04-19 15:25:25 -0700355
356 srcs: [
357 "tests/macrobench/TestSceneRunner.cpp",
358 "tests/macrobench/main.cpp",
359 ],
360}
361
362// ------------------------
363// Micro-bench app
364// ---------------------
365
366cc_benchmark {
367 name: "hwuimicro",
368 defaults: ["hwui_test_defaults"],
369
370 cflags: [
371 "-include debug/wrap_gles.h",
372 "-DHWUI_NULL_GPU",
373 ],
374
375 whole_static_libs: ["libhwui_static_debug"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800376 shared_libs: [
377 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800378 ],
Colin Crossf6298102017-04-19 15:25:25 -0700379
380 srcs: [
381 "tests/microbench/main.cpp",
382 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700383 "tests/microbench/LinearAllocatorBench.cpp",
384 "tests/microbench/PathParserBench.cpp",
385 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700386 ],
387}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800388
389// ----------------------------------------
390// Phony target to build benchmarks for PGO
391// ----------------------------------------
392
393phony {
394 name: "pgo-targets-hwui",
395 required: [
396 "hwuimicro",
397 "hwuimacro",
398 ]
399}