blob: dd6c2bc326fdae8deb8c9e17dfa2c646bb280324 [file] [log] [blame]
Bob Badour8a6a2bc2021-02-12 17:07:05 -08001package {
2 default_applicable_licenses: ["frameworks_base_libs_hwui_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20 name: "frameworks_base_libs_hwui_license",
21 visibility: [":__subpackages__"],
22 license_kinds: [
23 "SPDX-license-identifier-Apache-2.0",
24 "SPDX-license-identifier-BSD",
25 ],
26 license_text: [
27 "NOTICE",
28 ],
29}
30
Colin Crossf6298102017-04-19 15:25:25 -070031cc_defaults {
32 name: "hwui_defaults",
33 defaults: [
34 "hwui_static_deps",
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -080035 "skia_deps",
Colin Crossf6298102017-04-19 15:25:25 -070036 //"hwui_bugreport_font_cache_usage",
37 //"hwui_compile_for_perf",
Pirama Arumuga Nainarb7913e12018-03-09 00:03:57 +000038 "hwui_lto",
Colin Crossf6298102017-04-19 15:25:25 -070039 ],
40
John Reck283bb462018-12-13 16:40:14 -080041 cpp_std: "experimental",
42
Colin Crossf6298102017-04-19 15:25:25 -070043 cflags: [
44 "-DEGL_EGLEXT_PROTOTYPES",
45 "-DGL_GLEXT_PROTOTYPES",
46 "-DATRACE_TAG=ATRACE_TAG_VIEW",
47 "-DLOG_TAG=\"OpenGLRenderer\"",
48 "-Wall",
Siarhei Vishniakou07d35cb2021-07-03 02:22:12 +000049 "-Wthread-safety",
Colin Crossf6298102017-04-19 15:25:25 -070050 "-Wno-unused-parameter",
51 "-Wunreachable-code",
52 "-Werror",
53 "-fvisibility=hidden",
54
55 // GCC false-positives on this warning, and since we -Werror that's
56 // a problem
57 "-Wno-free-nonheap-object",
Colin Crossf6298102017-04-19 15:25:25 -070058 ],
59
60 include_dirs: [
61 "external/skia/include/private",
62 "external/skia/src/core",
Colin Crossf6298102017-04-19 15:25:25 -070063 ],
64
65 product_variables: {
John Reck27294182018-07-11 11:21:09 -070066 eng: {
67 lto: {
68 never: true,
69 },
70 },
Colin Crossf6298102017-04-19 15:25:25 -070071 },
Fedor Kudasov182cbf92019-06-05 10:30:20 +010072
73 target: {
74 android: {
75 include_dirs: [
76 "external/skia/src/effects",
77 "external/skia/src/image",
78 "external/skia/src/utils",
79 "external/skia/src/gpu",
80 "external/skia/src/shaders",
81 ],
82 },
83 host: {
84 include_dirs: [
85 "external/vulkan-headers/include",
86 ],
87 cflags: [
88 "-Wno-unused-variable",
89 ],
Tej Singh78f65b62021-03-18 16:19:55 -070090 },
91 },
Colin Crossf6298102017-04-19 15:25:25 -070092}
93
94cc_defaults {
95 name: "hwui_static_deps",
Sally Qi3ea28f12022-08-22 14:05:45 -070096 defaults: [
97 "android.hardware.graphics.common-ndk_shared",
98 "android.hardware.graphics.composer3-ndk_shared",
99 ],
Colin Crossf6298102017-04-19 15:25:25 -0700100 shared_libs: [
Jerome Gaillarda02a12d2019-05-28 18:07:56 +0100101 "libbase",
Colin Crossf6298102017-04-19 15:25:25 -0700102 "libharfbuzz_ng",
Colin Crossf6298102017-04-19 15:25:25 -0700103 "libminikin",
Colin Crossf6298102017-04-19 15:25:25 -0700104 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100105
Alec Mouri45238012020-01-29 11:04:40 -0800106 static_libs: [
107 "libui-types",
108 ],
109
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100110 target: {
111 android: {
112 shared_libs: [
Alec Mourid0001fe2021-11-22 10:09:22 -0800113 "android.hardware.graphics.common@1.2",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100114 "liblog",
115 "libcutils",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100116 "libutils",
117 "libEGL",
118 "libGLESv1_CM",
119 "libGLESv2",
120 "libGLESv3",
121 "libvulkan",
Alec Mouri22d753f2019-09-05 17:11:45 -0700122 "libnativedisplay",
Derek Sollenbergere78f7c92019-07-31 15:18:47 -0400123 "libnativewindow",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100124 "libprotobuf-cpp-lite",
125 "libft2",
126 "libandroidfw",
127 "libcrypto",
128 "libsync",
129 ],
130 static_libs: [
131 "libEGL_blobCache",
Stan Ilievc9043812020-02-03 16:57:09 -0500132 "libprotoutil",
Alec Mourid0001fe2021-11-22 10:09:22 -0800133 "libshaders",
Tej Singh78f65b62021-03-18 16:19:55 -0700134 "libstatslog_hwui",
135 "libstatspull_lazy",
136 "libstatssocket_lazy",
Alec Mourid0001fe2021-11-22 10:09:22 -0800137 "libtonemap",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100138 ],
139 },
140 host: {
141 static_libs: [
142 "libandroidfw",
143 "libutils",
144 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700145 },
146 },
Colin Crossf6298102017-04-19 15:25:25 -0700147}
148
149cc_defaults {
150 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -0700151 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
152}
153
154cc_defaults {
155 name: "hwui_compile_for_perf",
156 // TODO: Non-arm?
157 cflags: [
158 "-fno-omit-frame-pointer",
159 "-marm",
160 "-mapcs",
161 ],
162}
163
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800164// Build hwui library with ThinLTO by default.
165cc_defaults {
166 name: "hwui_lto",
167 target: {
168 android: {
169 lto: {
170 thin: true,
171 },
172 },
173 },
174}
175
Colin Crossf6298102017-04-19 15:25:25 -0700176// ------------------------
Alec Mourief37c242020-03-02 21:38:09 +0000177// framework-graphics jar
178// ------------------------
179
Paul Duffin4e006622020-05-31 16:55:13 +0100180java_sdk_library {
Alec Mourief37c242020-03-02 21:38:09 +0000181 name: "framework-graphics",
Paul Duffin4e006622020-05-31 16:55:13 +0100182 defaults: ["framework-module-defaults"],
183 visibility: [
184 "//frameworks/base", // Framework
185 ],
Alec Mourief37c242020-03-02 21:38:09 +0000186
187 srcs: [
188 ":framework-graphics-srcs",
189 ],
190
191 permitted_packages: [
192 "android.graphics",
193 ],
194
Alec Mourief37c242020-03-02 21:38:09 +0000195 // TODO: once framework-graphics is officially part of the
196 // UI-rendering module this line would no longer be
197 // needed.
198 installable: true,
199
Paul Duffin4e006622020-05-31 16:55:13 +0100200 // Disable api_lint that the defaults enable
201 // TODO: enable this
202 api_lint: {
203 enabled: false,
204 },
Anton Hansson96b08ae2020-12-21 16:59:06 +0000205 // TODO: remove this
206 unsafe_ignore_missing_latest_api: true,
Alec Mourief37c242020-03-02 21:38:09 +0000207}
208
209filegroup {
210 name: "framework-graphics-srcs",
211 srcs: [
212 "apex/java/**/*.java",
213 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700214 path: "apex/java",
Alec Mourief37c242020-03-02 21:38:09 +0000215}
216
Jihoon Kangbf3a3642022-12-06 02:13:40 +0000217java_api_contribution {
218 name: "framework-graphics-public-stubs",
219 api_surface: "public",
220 api_file: "api/current.txt",
221 visibility: [
222 "//build/orchestrator/apis",
223 ],
224}
225
Alec Mourief37c242020-03-02 21:38:09 +0000226// ------------------------
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400227// APEX
228// ------------------------
229
230cc_library_headers {
231 name: "android_graphics_apex_headers",
232
233 host_supported: true,
234 export_include_dirs: [
235 "apex/include",
236 ],
237 target: {
238 windows: {
239 enabled: true,
240 },
Tej Singh78f65b62021-03-18 16:19:55 -0700241 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400242}
243
244cc_defaults {
245 name: "android_graphics_apex",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400246 cflags: [
247 "-Wno-unused-parameter",
248 "-Wno-non-virtual-dtor",
249 "-Wno-maybe-uninitialized",
250 "-Wno-parentheses",
251 "-Wall",
252 "-Werror",
253 "-Wno-error=deprecated-declarations",
254 "-Wunused",
255 "-Wunreachable-code",
256 ],
257
258 cppflags: ["-Wno-conversion-null"],
259
260 srcs: [
261 "apex/android_matrix.cpp",
262 "apex/android_paint.cpp",
263 "apex/android_region.cpp",
Leon Scroggins IIIcd9e7b42022-04-08 15:27:57 -0400264 "apex/properties.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400265 ],
266
Tej Singh78f65b62021-03-18 16:19:55 -0700267 header_libs: ["android_graphics_apex_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400268
269 target: {
270 android: {
271 srcs: [ // sources that depend on android only libraries
272 "apex/android_bitmap.cpp",
273 "apex/android_canvas.cpp",
274 "apex/jni_runtime.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400275 ],
276 },
Derek Sollenbergerc5882c42019-10-25 11:11:32 -0400277 host: {
278 srcs: [
279 "apex/LayoutlibLoader.cpp",
280 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700281 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400282 },
283}
284
285// ------------------------
286// Android Graphics JNI
287// ------------------------
288
289cc_library_headers {
290 name: "android_graphics_jni_headers",
291
292 host_supported: true,
293 export_include_dirs: [
294 "jni",
295 ],
296 target: {
297 windows: {
298 enabled: true,
299 },
Tej Singh78f65b62021-03-18 16:19:55 -0700300 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400301}
302
303cc_defaults {
304 name: "android_graphics_jni",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400305 cflags: [
306 "-Wno-unused-parameter",
307 "-Wno-non-virtual-dtor",
308 "-Wno-maybe-uninitialized",
309 "-Wno-parentheses",
310
311 "-DGL_GLEXT_PROTOTYPES",
312 "-DEGL_EGLEXT_PROTOTYPES",
313
314 "-DU_USING_ICU_NAMESPACE=0",
315
316 "-Wall",
317 "-Werror",
318 "-Wno-error=deprecated-declarations",
319 "-Wunused",
320 "-Wunreachable-code",
321 ],
322
323 cppflags: ["-Wno-conversion-null"],
324
325 srcs: [
326 "jni/android_graphics_animation_NativeInterpolatorFactory.cpp",
327 "jni/android_graphics_animation_RenderNodeAnimator.cpp",
328 "jni/android_graphics_Canvas.cpp",
329 "jni/android_graphics_ColorSpace.cpp",
330 "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp",
331 "jni/android_graphics_drawable_VectorDrawable.cpp",
332 "jni/android_graphics_HardwareRendererObserver.cpp",
333 "jni/android_graphics_Matrix.cpp",
334 "jni/android_graphics_Picture.cpp",
335 "jni/android_graphics_DisplayListCanvas.cpp",
336 "jni/android_graphics_RenderNode.cpp",
337 "jni/android_nio_utils.cpp",
338 "jni/android_util_PathParser.cpp",
339
340 "jni/Bitmap.cpp",
Nader Jawada3521852023-01-30 20:23:46 -0800341 "jni/HardwareBufferHelpers.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400342 "jni/BitmapFactory.cpp",
343 "jni/ByteBufferStreamAdaptor.cpp",
344 "jni/Camera.cpp",
345 "jni/CanvasProperty.cpp",
346 "jni/ColorFilter.cpp",
347 "jni/CreateJavaOutputStreamAdaptor.cpp",
348 "jni/FontFamily.cpp",
349 "jni/FontUtils.cpp",
John Reck5bd537e2023-01-24 20:13:45 -0500350 "jni/Gainmap.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400351 "jni/Graphics.cpp",
352 "jni/ImageDecoder.cpp",
353 "jni/Interpolator.cpp",
Angel Aguayo90c46ee2022-11-08 23:42:09 +0000354 "jni/MeshSpecification.cpp",
355 "jni/Mesh.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400356 "jni/MaskFilter.cpp",
357 "jni/NinePatch.cpp",
358 "jni/NinePatchPeeker.cpp",
359 "jni/Paint.cpp",
360 "jni/PaintFilter.cpp",
361 "jni/Path.cpp",
362 "jni/PathEffect.cpp",
Chet Haase0834e9f2022-08-15 23:01:03 +0000363 "jni/PathIterator.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400364 "jni/PathMeasure.cpp",
365 "jni/Picture.cpp",
Jerome Gaillard9ce48282021-12-02 17:11:28 +0000366 "jni/Region.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400367 "jni/Shader.cpp",
Nader Jawad390d6e82020-09-24 21:35:03 -0700368 "jni/RenderEffect.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400369 "jni/Typeface.cpp",
370 "jni/Utils.cpp",
371 "jni/YuvToJpegEncoder.cpp",
372 "jni/fonts/Font.cpp",
373 "jni/fonts/FontFamily.cpp",
374 "jni/text/LineBreaker.cpp",
375 "jni/text/MeasuredText.cpp",
Seigo Nonakaf3a19152020-09-14 15:29:42 -0700376 "jni/text/TextShaper.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400377 ],
378
Dichen Zhang3b2c0ce2022-12-14 19:58:55 +0000379 header_libs: [
380 "android_graphics_jni_headers",
381 "libnativewindow_headers",
382 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400383
384 include_dirs: [
385 "external/skia/include/private",
386 "external/skia/src/codec",
387 "external/skia/src/core",
388 "external/skia/src/effects",
389 "external/skia/src/image",
390 "external/skia/src/images",
391 ],
392
393 shared_libs: [
394 "libbase",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400395 "libcutils",
396 "libharfbuzz_ng",
Dichen Zhang3b2c0ce2022-12-14 19:58:55 +0000397 "libimage_io",
398 "libjpeg",
399 "libjpegdecoder",
400 "libjpegencoder",
401 "libjpegrecoverymap",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400402 "liblog",
403 "libminikin",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400404 "libz",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400405 ],
406
Tej Singh78f65b62021-03-18 16:19:55 -0700407 static_libs: [
408 "libnativehelper_lazy",
409 "libziparchive_for_incfs",
410 ],
Orion Hodson33cbf8b2021-02-08 16:17:07 +0000411
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400412 target: {
413 android: {
414 srcs: [ // sources that depend on android only libraries
415 "jni/AnimatedImageDrawable.cpp",
416 "jni/android_graphics_TextureLayer.cpp",
417 "jni/android_graphics_HardwareRenderer.cpp",
Nader Jawada3521852023-01-30 20:23:46 -0800418 "jni/android_graphics_HardwareBufferRenderer.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400419 "jni/BitmapRegionDecoder.cpp",
420 "jni/GIFMovie.cpp",
421 "jni/GraphicsStatsService.cpp",
422 "jni/Movie.cpp",
423 "jni/MovieImpl.cpp",
424 "jni/pdf/PdfDocument.cpp",
425 "jni/pdf/PdfEditor.cpp",
426 "jni/pdf/PdfRenderer.cpp",
427 "jni/pdf/PdfUtils.cpp",
428 ],
429 shared_libs: [
430 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500431 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500432 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400433 "libmediandk",
434 "libnativedisplay",
435 "libnativewindow",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400436 "libpdfium",
437 ],
438 static_libs: [
439 "libgif",
Tej Singh78f65b62021-03-18 16:19:55 -0700440 "libstatslog_hwui",
441 "libstatspull_lazy",
442 "libstatssocket_lazy",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400443 ],
444 },
445 host: {
446 cflags: [
447 "-Wno-unused-const-variable",
448 "-Wno-unused-function",
449 ],
450 static_libs: [
451 "libandroidfw",
452 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700453 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400454 },
455}
456
Tej Singh78f65b62021-03-18 16:19:55 -0700457cc_library_static {
458 name: "libstatslog_hwui",
459 generated_sources: ["statslog_hwui.cpp"],
460 generated_headers: ["statslog_hwui.h"],
461 export_generated_headers: ["statslog_hwui.h"],
462 static_libs: [
463 "libstatssocket_lazy",
464 "libstatspull_lazy",
465 ],
466}
467
468genrule {
469 name: "statslog_hwui.h",
470 tools: ["stats-log-api-gen"],
471 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_hwui.h --module hwui" +
472 " --namespace android,uirenderer,stats",
473 out: [
474 "statslog_hwui.h",
475 ],
476}
477
478genrule {
479 name: "statslog_hwui.cpp",
480 tools: ["stats-log-api-gen"],
481 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_hwui.cpp --module hwui" +
482 " --namespace android,uirenderer,stats --importHeader statslog_hwui.h",
483 out: [
484 "statslog_hwui.cpp",
485 ],
486}
487
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400488// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700489// library
490// ------------------------
491
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400492cc_library_headers {
493 name: "libhwui_internal_headers",
494
495 host_supported: true,
496 export_include_dirs: [
497 ".",
498 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700499 header_libs: ["android_graphics_jni_headers"],
500 export_header_lib_headers: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400501}
502
Colin Crossf6298102017-04-19 15:25:25 -0700503cc_defaults {
504 name: "libhwui_defaults",
505 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400506
507 whole_static_libs: ["libskia"],
508
Colin Crossf6298102017-04-19 15:25:25 -0700509 srcs: [
John Reckdc95f102020-11-16 12:35:02 -0500510 "canvas/CanvasFrontend.cpp",
John Reck013127b2020-10-29 20:53:51 -0400511 "canvas/CanvasOpBuffer.cpp",
512 "canvas/CanvasOpRasterizer.cpp",
John Reck5cb290b2021-02-01 13:47:31 -0500513 "effects/StretchEffect.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700514 "pipeline/skia/HolePunch.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100515 "pipeline/skia/SkiaDisplayList.cpp",
516 "pipeline/skia/SkiaRecordingCanvas.cpp",
Nader Jawad197743f2021-04-19 19:45:13 -0700517 "pipeline/skia/StretchMask.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100518 "pipeline/skia/RenderNodeDrawable.cpp",
519 "pipeline/skia/ReorderBarrierDrawables.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700520 "pipeline/skia/TransformCanvas.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100521 "renderthread/Frame.cpp",
522 "renderthread/RenderTask.cpp",
523 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500524 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700525 "hwui/Bitmap.cpp",
Mike Reed0f9dce72021-02-12 21:20:33 -0500526 "hwui/BlurDrawLooper.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700527 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500528 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700529 "hwui/MinikinSkia.cpp",
530 "hwui/MinikinUtils.cpp",
531 "hwui/PaintImpl.cpp",
532 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700533 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100534 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700535 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700536 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100537 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700538 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100539 "AnimatorManager.cpp",
540 "CanvasTransform.cpp",
541 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700542 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100543 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700544 "Matrix.cpp",
John Reck5f66fb82022-09-23 17:49:23 -0400545 "MemoryPolicy.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700546 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700547 "Properties.cpp",
548 "PropertyValuesAnimatorSet.cpp",
549 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100550 "RecordingCanvas.cpp",
551 "RenderNode.cpp",
552 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100553 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700554 "SkiaCanvas.cpp",
Mike Reed74065272021-04-12 09:52:07 -0400555 "SkiaInterpolator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700556 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700557 ],
558
Kweku Adams228b6d22018-04-12 13:09:04 -0700559 proto: {
560 export_proto_headers: true,
561 },
562
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100563 target: {
564 android: {
Long Ling9e6c9fb2022-02-02 14:32:09 -0800565 header_libs: [
566 "libandroid_headers_private",
567 "libtonemap_headers",
568 ],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100569
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100570 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000571 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500572 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100573 "pipeline/skia/GLFunctorDrawable.cpp",
574 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100575 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100576 "pipeline/skia/SkiaMemoryTracer.cpp",
577 "pipeline/skia/SkiaOpenGLPipeline.cpp",
578 "pipeline/skia/SkiaPipeline.cpp",
579 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100580 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100581 "pipeline/skia/VkFunctorDrawable.cpp",
582 "pipeline/skia/VkInteropFunctorDrawable.cpp",
583 "renderstate/RenderState.cpp",
584 "renderthread/CacheManager.cpp",
585 "renderthread/CanvasContext.cpp",
586 "renderthread/DrawFrameTask.cpp",
587 "renderthread/EglManager.cpp",
588 "renderthread/ReliableSurface.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700589 "renderthread/RenderEffectCapabilityQuery.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100590 "renderthread/VulkanManager.cpp",
591 "renderthread/VulkanSurface.cpp",
592 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100593 "renderthread/RenderThread.cpp",
Matt Buckleye9023cf2022-11-23 22:39:25 +0000594 "renderthread/HintSessionWrapper.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100595 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100596 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100597 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800598 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100599 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400600 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100601 "DeferredLayerUpdater.cpp",
602 "DeviceInfo.cpp",
603 "FrameInfo.cpp",
604 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100605 "HardwareBitmapUploader.cpp",
606 "HWUIProperties.sysprop",
607 "JankTracker.cpp",
Pablo Gamito88660d72021-08-09 14:37:56 +0000608 "FrameMetricsReporter.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100609 "Layer.cpp",
610 "LayerUpdateQueue.cpp",
611 "ProfileData.cpp",
612 "ProfileDataContainer.cpp",
613 "Readback.cpp",
Alec Mouri97326742022-11-04 01:32:24 +0000614 "Tonemapper.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100615 "TreeInfo.cpp",
616 "WebViewFunctorManager.cpp",
617 "protos/graphicsstats.proto",
618 ],
619
620 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
621 cflags: ["-Wno-implicit-fallthrough"],
622 },
623 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100624 srcs: [
625 "utils/HostColorSpace.cpp",
626 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100627 export_static_lib_headers: [
628 "libarect",
629 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700630 },
631 },
Colin Crossf6298102017-04-19 15:25:25 -0700632}
633
634cc_library {
635 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100636 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700637 defaults: [
638 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400639 "android_graphics_apex",
640 "android_graphics_jni",
Collin Fijalkovichc10428f2021-04-23 14:09:16 -0700641 "linker_hugepage_aligned",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700642 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400643 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400644 target: {
645 android: {
646 version_script: "libhwui.map.txt",
Tej Singh78f65b62021-03-18 16:19:55 -0700647 },
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400648 },
Yi Kong7c0a3ad2022-01-08 01:01:20 +0800649 afdo: true,
Colin Crossf6298102017-04-19 15:25:25 -0700650}
651
Colin Crossf6298102017-04-19 15:25:25 -0700652cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700653 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700654 defaults: [
655 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700656 ],
Colin Crossf6298102017-04-19 15:25:25 -0700657}
658
659cc_defaults {
660 name: "hwui_test_defaults",
661 defaults: ["hwui_defaults"],
Nolan Scobief89a38a2022-11-09 15:23:07 -0500662 test_suites: ["general-tests"],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100663 header_libs: ["libandroid_headers_private"],
Alec Mouri680414e2020-01-28 09:22:33 -0800664 target: {
665 android: {
666 shared_libs: [
Tej Singh78f65b62021-03-18 16:19:55 -0700667 "libgui",
668 "libui",
669 ],
670 },
Alec Mouri680414e2020-01-28 09:22:33 -0800671 },
Colin Crossf6298102017-04-19 15:25:25 -0700672 srcs: [
673 "tests/common/scenes/*.cpp",
674 "tests/common/LeakChecker.cpp",
675 "tests/common/TestListViewSceneBase.cpp",
676 "tests/common/TestContext.cpp",
677 "tests/common/TestScene.cpp",
678 "tests/common/TestUtils.cpp",
679 ],
680}
681
682// ------------------------
683// unit tests
684// ------------------------
685
686cc_test {
687 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400688 defaults: [
689 "hwui_test_defaults",
690 "android_graphics_apex",
691 "android_graphics_jni",
692 ],
Colin Crossf6298102017-04-19 15:25:25 -0700693
694 static_libs: [
695 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700696 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700697 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800698 shared_libs: [
699 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800700 ],
Colin Crossf6298102017-04-19 15:25:25 -0700701 srcs: [
702 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400703 "tests/unit/ABitmapTests.cpp",
Nolan Scobie2163e412022-10-24 19:57:43 -0400704 "tests/unit/AutoBackendTextureReleaseTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400705 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700706 "tests/unit/CanvasContextTests.cpp",
John Reck013127b2020-10-29 20:53:51 -0400707 "tests/unit/CanvasOpTests.cpp",
John Reckdc95f102020-11-16 12:35:02 -0500708 "tests/unit/CanvasFrontendTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700709 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700710 "tests/unit/DamageAccumulatorTests.cpp",
711 "tests/unit/DeferredLayerUpdaterTests.cpp",
John Reck064650b2021-01-19 21:29:24 -0500712 "tests/unit/EglManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700713 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700714 "tests/unit/GraphicsStatsServiceTests.cpp",
Jorim Jaggi10f328c2021-01-19 00:08:02 +0100715 "tests/unit/JankTrackerTests.cpp",
Pablo Gamitodfb85a22021-08-26 01:19:05 +0200716 "tests/unit/FrameMetricsReporterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700717 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700718 "tests/unit/LinearAllocatorTests.cpp",
719 "tests/unit/MatrixTests.cpp",
John Reck95735052020-12-15 13:39:22 -0500720 "tests/unit/OpBufferTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700721 "tests/unit/PathInterpolatorTests.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700722 "tests/unit/RenderEffectCapabilityQueryTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700723 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700724 "tests/unit/RenderNodeTests.cpp",
725 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800726 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400727 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700728 "tests/unit/SkiaBehaviorTests.cpp",
729 "tests/unit/SkiaDisplayListTests.cpp",
730 "tests/unit/SkiaPipelineTests.cpp",
731 "tests/unit/SkiaRenderPropertiesTests.cpp",
732 "tests/unit/SkiaCanvasTests.cpp",
Nader Jawadc401b232021-05-21 12:52:05 -0700733 "tests/unit/StretchEffectTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700734 "tests/unit/StringUtilsTests.cpp",
735 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700736 "tests/unit/ThreadBaseTests.cpp",
737 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700738 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800739 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700740 ],
741}
742
743// ------------------------
744// Macro-bench app
745// ------------------------
746
747cc_benchmark {
748 name: "hwuimacro",
749 defaults: ["hwui_test_defaults"],
750
John Reck23462d82019-05-29 16:55:06 -0700751 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800752 shared_libs: [
753 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800754 ],
Colin Crossf6298102017-04-19 15:25:25 -0700755
756 srcs: [
757 "tests/macrobench/TestSceneRunner.cpp",
758 "tests/macrobench/main.cpp",
759 ],
760}
761
762// ------------------------
763// Micro-bench app
764// ---------------------
765
766cc_benchmark {
767 name: "hwuimicro",
768 defaults: ["hwui_test_defaults"],
769
John Reck23462d82019-05-29 16:55:06 -0700770 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800771 shared_libs: [
772 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800773 ],
Colin Crossf6298102017-04-19 15:25:25 -0700774
775 srcs: [
776 "tests/microbench/main.cpp",
John Reckb5eeb182020-12-09 13:45:39 -0500777 "tests/microbench/CanvasOpBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700778 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700779 "tests/microbench/LinearAllocatorBench.cpp",
780 "tests/microbench/PathParserBench.cpp",
781 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700782 ],
783}