blob: d391be665371b6c2aa0484bc72b431b70258280b [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",
Yi Kong3ccc52f2023-03-22 17:09:50 +090058
59 // Do not de-optimise cold code paths in AFDO.
60 // Some code paths might be infrequently executed but critical to latency.
61 "-fno-profile-sample-accurate",
Colin Crossf6298102017-04-19 15:25:25 -070062 ],
63
64 include_dirs: [
65 "external/skia/include/private",
66 "external/skia/src/core",
Colin Crossf6298102017-04-19 15:25:25 -070067 ],
68
69 product_variables: {
John Reck27294182018-07-11 11:21:09 -070070 eng: {
71 lto: {
72 never: true,
73 },
74 },
Colin Crossf6298102017-04-19 15:25:25 -070075 },
Fedor Kudasov182cbf92019-06-05 10:30:20 +010076
77 target: {
78 android: {
79 include_dirs: [
80 "external/skia/src/effects",
81 "external/skia/src/image",
82 "external/skia/src/utils",
83 "external/skia/src/gpu",
84 "external/skia/src/shaders",
85 ],
86 },
87 host: {
88 include_dirs: [
89 "external/vulkan-headers/include",
90 ],
91 cflags: [
92 "-Wno-unused-variable",
93 ],
Tej Singh78f65b62021-03-18 16:19:55 -070094 },
95 },
Colin Crossf6298102017-04-19 15:25:25 -070096}
97
98cc_defaults {
99 name: "hwui_static_deps",
Marc Kassis8c1f7e92022-11-08 16:18:49 +0100100 defaults: [
101 "android.hardware.graphics.common-ndk_shared",
Sally Qi126c0382022-08-22 14:05:45 -0700102 "android.hardware.graphics.composer3-ndk_shared",
Marc Kassis8c1f7e92022-11-08 16:18:49 +0100103 ],
Colin Crossf6298102017-04-19 15:25:25 -0700104 shared_libs: [
Jerome Gaillarda02a12d2019-05-28 18:07:56 +0100105 "libbase",
Colin Crossf6298102017-04-19 15:25:25 -0700106 "libharfbuzz_ng",
Colin Crossf6298102017-04-19 15:25:25 -0700107 "libminikin",
Colin Crossf6298102017-04-19 15:25:25 -0700108 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100109
Alec Mouri45238012020-01-29 11:04:40 -0800110 static_libs: [
111 "libui-types",
112 ],
113
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100114 target: {
115 android: {
116 shared_libs: [
Alec Mourid0001fe2021-11-22 10:09:22 -0800117 "android.hardware.graphics.common@1.2",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100118 "liblog",
119 "libcutils",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100120 "libutils",
121 "libEGL",
122 "libGLESv1_CM",
123 "libGLESv2",
124 "libGLESv3",
125 "libvulkan",
Alec Mouri22d753f2019-09-05 17:11:45 -0700126 "libnativedisplay",
Derek Sollenbergere78f7c92019-07-31 15:18:47 -0400127 "libnativewindow",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100128 "libprotobuf-cpp-lite",
129 "libft2",
130 "libandroidfw",
131 "libcrypto",
132 "libsync",
133 ],
134 static_libs: [
135 "libEGL_blobCache",
Stan Ilievc9043812020-02-03 16:57:09 -0500136 "libprotoutil",
Alec Mourid0001fe2021-11-22 10:09:22 -0800137 "libshaders",
Tej Singh78f65b62021-03-18 16:19:55 -0700138 "libstatslog_hwui",
139 "libstatspull_lazy",
140 "libstatssocket_lazy",
Alec Mourid0001fe2021-11-22 10:09:22 -0800141 "libtonemap",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100142 ],
143 },
144 host: {
145 static_libs: [
146 "libandroidfw",
147 "libutils",
148 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700149 },
150 },
Colin Crossf6298102017-04-19 15:25:25 -0700151}
152
153cc_defaults {
154 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -0700155 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
156}
157
158cc_defaults {
159 name: "hwui_compile_for_perf",
160 // TODO: Non-arm?
161 cflags: [
162 "-fno-omit-frame-pointer",
163 "-marm",
164 "-mapcs",
165 ],
166}
167
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800168// Build hwui library with ThinLTO by default.
169cc_defaults {
170 name: "hwui_lto",
171 target: {
172 android: {
173 lto: {
174 thin: true,
175 },
176 },
177 },
178}
179
Colin Crossf6298102017-04-19 15:25:25 -0700180// ------------------------
Alec Mourief37c242020-03-02 21:38:09 +0000181// framework-graphics jar
182// ------------------------
183
Paul Duffin4e006622020-05-31 16:55:13 +0100184java_sdk_library {
Alec Mourief37c242020-03-02 21:38:09 +0000185 name: "framework-graphics",
Paul Duffin4e006622020-05-31 16:55:13 +0100186 defaults: ["framework-module-defaults"],
187 visibility: [
188 "//frameworks/base", // Framework
189 ],
Alec Mourief37c242020-03-02 21:38:09 +0000190
191 srcs: [
192 ":framework-graphics-srcs",
193 ],
194
195 permitted_packages: [
196 "android.graphics",
197 ],
198
Alec Mourief37c242020-03-02 21:38:09 +0000199 // TODO: once framework-graphics is officially part of the
200 // UI-rendering module this line would no longer be
201 // needed.
202 installable: true,
203
Paul Duffin4e006622020-05-31 16:55:13 +0100204 // Disable api_lint that the defaults enable
205 // TODO: enable this
206 api_lint: {
207 enabled: false,
208 },
Anton Hansson96b08ae2020-12-21 16:59:06 +0000209 // TODO: remove this
210 unsafe_ignore_missing_latest_api: true,
Alec Mourief37c242020-03-02 21:38:09 +0000211}
212
213filegroup {
214 name: "framework-graphics-srcs",
215 srcs: [
216 "apex/java/**/*.java",
217 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700218 path: "apex/java",
Alec Mourief37c242020-03-02 21:38:09 +0000219}
220
Jihoon Kangbf3a3642022-12-06 02:13:40 +0000221java_api_contribution {
222 name: "framework-graphics-public-stubs",
223 api_surface: "public",
224 api_file: "api/current.txt",
225 visibility: [
226 "//build/orchestrator/apis",
227 ],
228}
229
Alec Mourief37c242020-03-02 21:38:09 +0000230// ------------------------
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400231// APEX
232// ------------------------
233
234cc_library_headers {
235 name: "android_graphics_apex_headers",
236
237 host_supported: true,
238 export_include_dirs: [
239 "apex/include",
240 ],
241 target: {
242 windows: {
243 enabled: true,
244 },
Tej Singh78f65b62021-03-18 16:19:55 -0700245 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400246}
247
248cc_defaults {
249 name: "android_graphics_apex",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400250 cflags: [
251 "-Wno-unused-parameter",
252 "-Wno-non-virtual-dtor",
253 "-Wno-maybe-uninitialized",
254 "-Wno-parentheses",
255 "-Wall",
256 "-Werror",
257 "-Wno-error=deprecated-declarations",
258 "-Wunused",
259 "-Wunreachable-code",
260 ],
261
262 cppflags: ["-Wno-conversion-null"],
263
264 srcs: [
265 "apex/android_matrix.cpp",
266 "apex/android_paint.cpp",
267 "apex/android_region.cpp",
Leon Scroggins IIIcd9e7b42022-04-08 15:27:57 -0400268 "apex/properties.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400269 ],
270
Tej Singh78f65b62021-03-18 16:19:55 -0700271 header_libs: ["android_graphics_apex_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400272
273 target: {
274 android: {
275 srcs: [ // sources that depend on android only libraries
276 "apex/android_bitmap.cpp",
277 "apex/android_canvas.cpp",
278 "apex/jni_runtime.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400279 ],
280 },
Derek Sollenbergerc5882c42019-10-25 11:11:32 -0400281 host: {
282 srcs: [
283 "apex/LayoutlibLoader.cpp",
284 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700285 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400286 },
287}
288
289// ------------------------
290// Android Graphics JNI
291// ------------------------
292
293cc_library_headers {
294 name: "android_graphics_jni_headers",
295
296 host_supported: true,
297 export_include_dirs: [
298 "jni",
299 ],
300 target: {
301 windows: {
302 enabled: true,
303 },
Tej Singh78f65b62021-03-18 16:19:55 -0700304 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400305}
306
307cc_defaults {
308 name: "android_graphics_jni",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400309 cflags: [
310 "-Wno-unused-parameter",
311 "-Wno-non-virtual-dtor",
312 "-Wno-maybe-uninitialized",
313 "-Wno-parentheses",
314
315 "-DGL_GLEXT_PROTOTYPES",
316 "-DEGL_EGLEXT_PROTOTYPES",
317
318 "-DU_USING_ICU_NAMESPACE=0",
319
320 "-Wall",
321 "-Werror",
322 "-Wno-error=deprecated-declarations",
323 "-Wunused",
324 "-Wunreachable-code",
325 ],
326
327 cppflags: ["-Wno-conversion-null"],
328
329 srcs: [
330 "jni/android_graphics_animation_NativeInterpolatorFactory.cpp",
331 "jni/android_graphics_animation_RenderNodeAnimator.cpp",
332 "jni/android_graphics_Canvas.cpp",
333 "jni/android_graphics_ColorSpace.cpp",
334 "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp",
335 "jni/android_graphics_drawable_VectorDrawable.cpp",
336 "jni/android_graphics_HardwareRendererObserver.cpp",
337 "jni/android_graphics_Matrix.cpp",
338 "jni/android_graphics_Picture.cpp",
339 "jni/android_graphics_DisplayListCanvas.cpp",
340 "jni/android_graphics_RenderNode.cpp",
341 "jni/android_nio_utils.cpp",
342 "jni/android_util_PathParser.cpp",
343
344 "jni/Bitmap.cpp",
345 "jni/BitmapFactory.cpp",
346 "jni/ByteBufferStreamAdaptor.cpp",
347 "jni/Camera.cpp",
348 "jni/CanvasProperty.cpp",
349 "jni/ColorFilter.cpp",
350 "jni/CreateJavaOutputStreamAdaptor.cpp",
351 "jni/FontFamily.cpp",
352 "jni/FontUtils.cpp",
353 "jni/Graphics.cpp",
354 "jni/ImageDecoder.cpp",
355 "jni/Interpolator.cpp",
356 "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",
363 "jni/PathMeasure.cpp",
364 "jni/Picture.cpp",
Jerome Gaillard9ce48282021-12-02 17:11:28 +0000365 "jni/Region.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400366 "jni/Shader.cpp",
Nader Jawad390d6e82020-09-24 21:35:03 -0700367 "jni/RenderEffect.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400368 "jni/Typeface.cpp",
369 "jni/Utils.cpp",
370 "jni/YuvToJpegEncoder.cpp",
371 "jni/fonts/Font.cpp",
372 "jni/fonts/FontFamily.cpp",
373 "jni/text/LineBreaker.cpp",
374 "jni/text/MeasuredText.cpp",
Seigo Nonakaf3a19152020-09-14 15:29:42 -0700375 "jni/text/TextShaper.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400376 ],
377
Tej Singh78f65b62021-03-18 16:19:55 -0700378 header_libs: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400379
380 include_dirs: [
381 "external/skia/include/private",
382 "external/skia/src/codec",
383 "external/skia/src/core",
384 "external/skia/src/effects",
385 "external/skia/src/image",
386 "external/skia/src/images",
387 ],
388
389 shared_libs: [
390 "libbase",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400391 "libcutils",
392 "libharfbuzz_ng",
393 "liblog",
394 "libminikin",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400395 "libz",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400396 "libjpeg",
397 ],
398
Tej Singh78f65b62021-03-18 16:19:55 -0700399 static_libs: [
400 "libnativehelper_lazy",
401 "libziparchive_for_incfs",
402 ],
Orion Hodson33cbf8b2021-02-08 16:17:07 +0000403
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400404 target: {
405 android: {
406 srcs: [ // sources that depend on android only libraries
407 "jni/AnimatedImageDrawable.cpp",
408 "jni/android_graphics_TextureLayer.cpp",
409 "jni/android_graphics_HardwareRenderer.cpp",
410 "jni/BitmapRegionDecoder.cpp",
411 "jni/GIFMovie.cpp",
412 "jni/GraphicsStatsService.cpp",
413 "jni/Movie.cpp",
414 "jni/MovieImpl.cpp",
415 "jni/pdf/PdfDocument.cpp",
416 "jni/pdf/PdfEditor.cpp",
417 "jni/pdf/PdfRenderer.cpp",
418 "jni/pdf/PdfUtils.cpp",
419 ],
420 shared_libs: [
421 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500422 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500423 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400424 "libmediandk",
425 "libnativedisplay",
426 "libnativewindow",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400427 "libpdfium",
428 ],
429 static_libs: [
430 "libgif",
Tej Singh78f65b62021-03-18 16:19:55 -0700431 "libstatslog_hwui",
432 "libstatspull_lazy",
433 "libstatssocket_lazy",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400434 ],
435 },
436 host: {
437 cflags: [
438 "-Wno-unused-const-variable",
439 "-Wno-unused-function",
440 ],
441 static_libs: [
442 "libandroidfw",
443 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700444 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400445 },
446}
447
Tej Singh78f65b62021-03-18 16:19:55 -0700448cc_library_static {
449 name: "libstatslog_hwui",
450 generated_sources: ["statslog_hwui.cpp"],
451 generated_headers: ["statslog_hwui.h"],
452 export_generated_headers: ["statslog_hwui.h"],
453 static_libs: [
454 "libstatssocket_lazy",
455 "libstatspull_lazy",
456 ],
457}
458
459genrule {
460 name: "statslog_hwui.h",
461 tools: ["stats-log-api-gen"],
462 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_hwui.h --module hwui" +
463 " --namespace android,uirenderer,stats",
464 out: [
465 "statslog_hwui.h",
466 ],
467}
468
469genrule {
470 name: "statslog_hwui.cpp",
471 tools: ["stats-log-api-gen"],
472 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_hwui.cpp --module hwui" +
473 " --namespace android,uirenderer,stats --importHeader statslog_hwui.h",
474 out: [
475 "statslog_hwui.cpp",
476 ],
477}
478
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400479// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700480// library
481// ------------------------
482
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400483cc_library_headers {
484 name: "libhwui_internal_headers",
485
486 host_supported: true,
487 export_include_dirs: [
488 ".",
489 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700490 header_libs: ["android_graphics_jni_headers"],
491 export_header_lib_headers: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400492}
493
Colin Crossf6298102017-04-19 15:25:25 -0700494cc_defaults {
495 name: "libhwui_defaults",
496 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400497
498 whole_static_libs: ["libskia"],
499
Colin Crossf6298102017-04-19 15:25:25 -0700500 srcs: [
John Reckdc95f102020-11-16 12:35:02 -0500501 "canvas/CanvasFrontend.cpp",
John Reck013127b2020-10-29 20:53:51 -0400502 "canvas/CanvasOpBuffer.cpp",
503 "canvas/CanvasOpRasterizer.cpp",
John Reck5cb290b2021-02-01 13:47:31 -0500504 "effects/StretchEffect.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700505 "pipeline/skia/HolePunch.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100506 "pipeline/skia/SkiaDisplayList.cpp",
507 "pipeline/skia/SkiaRecordingCanvas.cpp",
Nader Jawad197743f2021-04-19 19:45:13 -0700508 "pipeline/skia/StretchMask.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100509 "pipeline/skia/RenderNodeDrawable.cpp",
510 "pipeline/skia/ReorderBarrierDrawables.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700511 "pipeline/skia/TransformCanvas.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100512 "renderthread/Frame.cpp",
513 "renderthread/RenderTask.cpp",
514 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500515 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700516 "hwui/Bitmap.cpp",
Mike Reed0f9dce72021-02-12 21:20:33 -0500517 "hwui/BlurDrawLooper.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700518 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500519 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700520 "hwui/MinikinSkia.cpp",
521 "hwui/MinikinUtils.cpp",
522 "hwui/PaintImpl.cpp",
523 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700524 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100525 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700526 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700527 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100528 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700529 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100530 "AnimatorManager.cpp",
531 "CanvasTransform.cpp",
532 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700533 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100534 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700535 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700536 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700537 "Properties.cpp",
538 "PropertyValuesAnimatorSet.cpp",
539 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100540 "RecordingCanvas.cpp",
541 "RenderNode.cpp",
542 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100543 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700544 "SkiaCanvas.cpp",
Mike Reed74065272021-04-12 09:52:07 -0400545 "SkiaInterpolator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700546 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700547 ],
548
Kweku Adams228b6d22018-04-12 13:09:04 -0700549 proto: {
550 export_proto_headers: true,
551 },
552
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100553 target: {
554 android: {
Long Ling9e6c9fb2022-02-02 14:32:09 -0800555 header_libs: [
556 "libandroid_headers_private",
557 "libtonemap_headers",
558 ],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100559
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100560 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000561 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500562 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100563 "pipeline/skia/GLFunctorDrawable.cpp",
564 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100565 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100566 "pipeline/skia/SkiaMemoryTracer.cpp",
567 "pipeline/skia/SkiaOpenGLPipeline.cpp",
568 "pipeline/skia/SkiaPipeline.cpp",
569 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100570 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100571 "pipeline/skia/VkFunctorDrawable.cpp",
572 "pipeline/skia/VkInteropFunctorDrawable.cpp",
573 "renderstate/RenderState.cpp",
574 "renderthread/CacheManager.cpp",
575 "renderthread/CanvasContext.cpp",
576 "renderthread/DrawFrameTask.cpp",
577 "renderthread/EglManager.cpp",
578 "renderthread/ReliableSurface.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700579 "renderthread/RenderEffectCapabilityQuery.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100580 "renderthread/VulkanManager.cpp",
581 "renderthread/VulkanSurface.cpp",
582 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100583 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100584 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100585 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100586 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800587 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100588 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400589 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100590 "DeferredLayerUpdater.cpp",
591 "DeviceInfo.cpp",
592 "FrameInfo.cpp",
593 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100594 "HardwareBitmapUploader.cpp",
595 "HWUIProperties.sysprop",
596 "JankTracker.cpp",
Pablo Gamito88660d72021-08-09 14:37:56 +0000597 "FrameMetricsReporter.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100598 "Layer.cpp",
599 "LayerUpdateQueue.cpp",
600 "ProfileData.cpp",
601 "ProfileDataContainer.cpp",
602 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100603 "TreeInfo.cpp",
604 "WebViewFunctorManager.cpp",
605 "protos/graphicsstats.proto",
606 ],
607
608 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
609 cflags: ["-Wno-implicit-fallthrough"],
610 },
611 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100612 srcs: [
613 "utils/HostColorSpace.cpp",
614 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100615 export_static_lib_headers: [
616 "libarect",
617 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700618 },
619 },
Colin Crossf6298102017-04-19 15:25:25 -0700620}
621
622cc_library {
623 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100624 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700625 defaults: [
626 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400627 "android_graphics_apex",
628 "android_graphics_jni",
Collin Fijalkovichc10428f2021-04-23 14:09:16 -0700629 "linker_hugepage_aligned",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700630 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400631 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400632 target: {
633 android: {
634 version_script: "libhwui.map.txt",
Tej Singh78f65b62021-03-18 16:19:55 -0700635 },
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400636 },
Yi Kong7c0a3ad2022-01-08 01:01:20 +0800637 afdo: true,
Colin Crossf6298102017-04-19 15:25:25 -0700638}
639
Colin Crossf6298102017-04-19 15:25:25 -0700640cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700641 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700642 defaults: [
643 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700644 ],
Colin Crossf6298102017-04-19 15:25:25 -0700645}
646
647cc_defaults {
648 name: "hwui_test_defaults",
649 defaults: ["hwui_defaults"],
Nolan Scobie1aa54912022-11-09 15:23:07 -0500650 test_suites: ["general-tests"],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100651 header_libs: ["libandroid_headers_private"],
Alec Mouri680414e2020-01-28 09:22:33 -0800652 target: {
653 android: {
654 shared_libs: [
Tej Singh78f65b62021-03-18 16:19:55 -0700655 "libgui",
656 "libui",
657 ],
658 },
Alec Mouri680414e2020-01-28 09:22:33 -0800659 },
Colin Crossf6298102017-04-19 15:25:25 -0700660 srcs: [
661 "tests/common/scenes/*.cpp",
662 "tests/common/LeakChecker.cpp",
663 "tests/common/TestListViewSceneBase.cpp",
664 "tests/common/TestContext.cpp",
665 "tests/common/TestScene.cpp",
666 "tests/common/TestUtils.cpp",
667 ],
668}
669
670// ------------------------
671// unit tests
672// ------------------------
673
674cc_test {
675 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400676 defaults: [
677 "hwui_test_defaults",
678 "android_graphics_apex",
679 "android_graphics_jni",
680 ],
Colin Crossf6298102017-04-19 15:25:25 -0700681
682 static_libs: [
683 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700684 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700685 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800686 shared_libs: [
687 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800688 ],
Colin Crossf6298102017-04-19 15:25:25 -0700689 srcs: [
690 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400691 "tests/unit/ABitmapTests.cpp",
Nolan Scobie892cac22022-10-24 19:57:43 -0400692 "tests/unit/AutoBackendTextureReleaseTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400693 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700694 "tests/unit/CanvasContextTests.cpp",
John Reck013127b2020-10-29 20:53:51 -0400695 "tests/unit/CanvasOpTests.cpp",
John Reckdc95f102020-11-16 12:35:02 -0500696 "tests/unit/CanvasFrontendTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700697 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700698 "tests/unit/DamageAccumulatorTests.cpp",
699 "tests/unit/DeferredLayerUpdaterTests.cpp",
John Reck064650b2021-01-19 21:29:24 -0500700 "tests/unit/EglManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700701 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700702 "tests/unit/GraphicsStatsServiceTests.cpp",
Jorim Jaggi10f328c2021-01-19 00:08:02 +0100703 "tests/unit/JankTrackerTests.cpp",
Pablo Gamitodfb85a22021-08-26 01:19:05 +0200704 "tests/unit/FrameMetricsReporterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700705 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700706 "tests/unit/LinearAllocatorTests.cpp",
707 "tests/unit/MatrixTests.cpp",
John Reck95735052020-12-15 13:39:22 -0500708 "tests/unit/OpBufferTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700709 "tests/unit/PathInterpolatorTests.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700710 "tests/unit/RenderEffectCapabilityQueryTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700711 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700712 "tests/unit/RenderNodeTests.cpp",
713 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800714 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400715 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700716 "tests/unit/SkiaBehaviorTests.cpp",
717 "tests/unit/SkiaDisplayListTests.cpp",
718 "tests/unit/SkiaPipelineTests.cpp",
719 "tests/unit/SkiaRenderPropertiesTests.cpp",
720 "tests/unit/SkiaCanvasTests.cpp",
Nader Jawadc401b232021-05-21 12:52:05 -0700721 "tests/unit/StretchEffectTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700722 "tests/unit/StringUtilsTests.cpp",
723 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700724 "tests/unit/ThreadBaseTests.cpp",
725 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700726 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800727 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700728 ],
729}
730
731// ------------------------
732// Macro-bench app
733// ------------------------
734
735cc_benchmark {
736 name: "hwuimacro",
737 defaults: ["hwui_test_defaults"],
738
John Reck23462d82019-05-29 16:55:06 -0700739 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800740 shared_libs: [
741 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800742 ],
Colin Crossf6298102017-04-19 15:25:25 -0700743
744 srcs: [
745 "tests/macrobench/TestSceneRunner.cpp",
746 "tests/macrobench/main.cpp",
747 ],
748}
749
750// ------------------------
751// Micro-bench app
752// ---------------------
753
754cc_benchmark {
755 name: "hwuimicro",
756 defaults: ["hwui_test_defaults"],
757
John Reck23462d82019-05-29 16:55:06 -0700758 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800759 shared_libs: [
760 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800761 ],
Colin Crossf6298102017-04-19 15:25:25 -0700762
763 srcs: [
764 "tests/microbench/main.cpp",
John Reckb5eeb182020-12-09 13:45:39 -0500765 "tests/microbench/CanvasOpBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700766 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700767 "tests/microbench/LinearAllocatorBench.cpp",
768 "tests/microbench/PathParserBench.cpp",
769 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700770 ],
771}