blob: c94273b74ac7247ef450905e8f0c6582ed6b38cf [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",
96 shared_libs: [
Jerome Gaillarda02a12d2019-05-28 18:07:56 +010097 "libbase",
Colin Crossf6298102017-04-19 15:25:25 -070098 "libharfbuzz_ng",
Colin Crossf6298102017-04-19 15:25:25 -070099 "libminikin",
Colin Crossf6298102017-04-19 15:25:25 -0700100 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100101
Alec Mouri45238012020-01-29 11:04:40 -0800102 static_libs: [
103 "libui-types",
104 ],
105
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100106 target: {
107 android: {
108 shared_libs: [
Alec Mourid0001fe2021-11-22 10:09:22 -0800109 "android.hardware.graphics.common-V3-ndk",
110 "android.hardware.graphics.common@1.2",
Alec Mouria7bd3b92022-04-14 23:24:28 +0000111 "android.hardware.graphics.composer3-V1-ndk",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100112 "liblog",
113 "libcutils",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100114 "libutils",
115 "libEGL",
116 "libGLESv1_CM",
117 "libGLESv2",
118 "libGLESv3",
119 "libvulkan",
Alec Mouri22d753f2019-09-05 17:11:45 -0700120 "libnativedisplay",
Derek Sollenbergere78f7c92019-07-31 15:18:47 -0400121 "libnativewindow",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100122 "libprotobuf-cpp-lite",
123 "libft2",
124 "libandroidfw",
125 "libcrypto",
126 "libsync",
127 ],
128 static_libs: [
129 "libEGL_blobCache",
Stan Ilievc9043812020-02-03 16:57:09 -0500130 "libprotoutil",
Alec Mourid0001fe2021-11-22 10:09:22 -0800131 "libshaders",
Tej Singh78f65b62021-03-18 16:19:55 -0700132 "libstatslog_hwui",
133 "libstatspull_lazy",
134 "libstatssocket_lazy",
Alec Mourid0001fe2021-11-22 10:09:22 -0800135 "libtonemap",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100136 ],
137 },
138 host: {
139 static_libs: [
140 "libandroidfw",
141 "libutils",
142 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700143 },
144 },
Colin Crossf6298102017-04-19 15:25:25 -0700145}
146
147cc_defaults {
148 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -0700149 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
150}
151
152cc_defaults {
153 name: "hwui_compile_for_perf",
154 // TODO: Non-arm?
155 cflags: [
156 "-fno-omit-frame-pointer",
157 "-marm",
158 "-mapcs",
159 ],
160}
161
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800162// Build hwui library with ThinLTO by default.
163cc_defaults {
164 name: "hwui_lto",
165 target: {
166 android: {
167 lto: {
168 thin: true,
169 },
170 },
171 },
172}
173
Colin Crossf6298102017-04-19 15:25:25 -0700174// ------------------------
Alec Mourief37c242020-03-02 21:38:09 +0000175// framework-graphics jar
176// ------------------------
177
Paul Duffin4e006622020-05-31 16:55:13 +0100178java_sdk_library {
Alec Mourief37c242020-03-02 21:38:09 +0000179 name: "framework-graphics",
Paul Duffin4e006622020-05-31 16:55:13 +0100180 defaults: ["framework-module-defaults"],
181 visibility: [
182 "//frameworks/base", // Framework
183 ],
Alec Mourief37c242020-03-02 21:38:09 +0000184
185 srcs: [
186 ":framework-graphics-srcs",
187 ],
188
189 permitted_packages: [
190 "android.graphics",
191 ],
192
Alec Mourief37c242020-03-02 21:38:09 +0000193 // TODO: once framework-graphics is officially part of the
194 // UI-rendering module this line would no longer be
195 // needed.
196 installable: true,
197
Paul Duffin4e006622020-05-31 16:55:13 +0100198 // Disable api_lint that the defaults enable
199 // TODO: enable this
200 api_lint: {
201 enabled: false,
202 },
Anton Hansson96b08ae2020-12-21 16:59:06 +0000203 // TODO: remove this
204 unsafe_ignore_missing_latest_api: true,
Alec Mourief37c242020-03-02 21:38:09 +0000205}
206
207filegroup {
208 name: "framework-graphics-srcs",
209 srcs: [
210 "apex/java/**/*.java",
211 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700212 path: "apex/java",
Alec Mourief37c242020-03-02 21:38:09 +0000213}
214
Jihoon Kangbf3a3642022-12-06 02:13:40 +0000215java_api_contribution {
216 name: "framework-graphics-public-stubs",
217 api_surface: "public",
218 api_file: "api/current.txt",
219 visibility: [
220 "//build/orchestrator/apis",
221 ],
222}
223
Alec Mourief37c242020-03-02 21:38:09 +0000224// ------------------------
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400225// APEX
226// ------------------------
227
228cc_library_headers {
229 name: "android_graphics_apex_headers",
230
231 host_supported: true,
232 export_include_dirs: [
233 "apex/include",
234 ],
235 target: {
236 windows: {
237 enabled: true,
238 },
Tej Singh78f65b62021-03-18 16:19:55 -0700239 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400240}
241
242cc_defaults {
243 name: "android_graphics_apex",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400244 cflags: [
245 "-Wno-unused-parameter",
246 "-Wno-non-virtual-dtor",
247 "-Wno-maybe-uninitialized",
248 "-Wno-parentheses",
249 "-Wall",
250 "-Werror",
251 "-Wno-error=deprecated-declarations",
252 "-Wunused",
253 "-Wunreachable-code",
254 ],
255
256 cppflags: ["-Wno-conversion-null"],
257
258 srcs: [
259 "apex/android_matrix.cpp",
260 "apex/android_paint.cpp",
261 "apex/android_region.cpp",
Leon Scroggins IIIcd9e7b42022-04-08 15:27:57 -0400262 "apex/properties.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400263 ],
264
Tej Singh78f65b62021-03-18 16:19:55 -0700265 header_libs: ["android_graphics_apex_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400266
267 target: {
268 android: {
269 srcs: [ // sources that depend on android only libraries
270 "apex/android_bitmap.cpp",
271 "apex/android_canvas.cpp",
272 "apex/jni_runtime.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400273 ],
274 },
Derek Sollenbergerc5882c42019-10-25 11:11:32 -0400275 host: {
276 srcs: [
277 "apex/LayoutlibLoader.cpp",
278 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700279 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400280 },
281}
282
283// ------------------------
284// Android Graphics JNI
285// ------------------------
286
287cc_library_headers {
288 name: "android_graphics_jni_headers",
289
290 host_supported: true,
291 export_include_dirs: [
292 "jni",
293 ],
294 target: {
295 windows: {
296 enabled: true,
297 },
Tej Singh78f65b62021-03-18 16:19:55 -0700298 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400299}
300
301cc_defaults {
302 name: "android_graphics_jni",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400303 cflags: [
304 "-Wno-unused-parameter",
305 "-Wno-non-virtual-dtor",
306 "-Wno-maybe-uninitialized",
307 "-Wno-parentheses",
308
309 "-DGL_GLEXT_PROTOTYPES",
310 "-DEGL_EGLEXT_PROTOTYPES",
311
312 "-DU_USING_ICU_NAMESPACE=0",
313
314 "-Wall",
315 "-Werror",
316 "-Wno-error=deprecated-declarations",
317 "-Wunused",
318 "-Wunreachable-code",
319 ],
320
321 cppflags: ["-Wno-conversion-null"],
322
323 srcs: [
324 "jni/android_graphics_animation_NativeInterpolatorFactory.cpp",
325 "jni/android_graphics_animation_RenderNodeAnimator.cpp",
326 "jni/android_graphics_Canvas.cpp",
327 "jni/android_graphics_ColorSpace.cpp",
328 "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp",
329 "jni/android_graphics_drawable_VectorDrawable.cpp",
330 "jni/android_graphics_HardwareRendererObserver.cpp",
331 "jni/android_graphics_Matrix.cpp",
332 "jni/android_graphics_Picture.cpp",
333 "jni/android_graphics_DisplayListCanvas.cpp",
334 "jni/android_graphics_RenderNode.cpp",
335 "jni/android_nio_utils.cpp",
336 "jni/android_util_PathParser.cpp",
337
338 "jni/Bitmap.cpp",
339 "jni/BitmapFactory.cpp",
340 "jni/ByteBufferStreamAdaptor.cpp",
341 "jni/Camera.cpp",
342 "jni/CanvasProperty.cpp",
343 "jni/ColorFilter.cpp",
344 "jni/CreateJavaOutputStreamAdaptor.cpp",
345 "jni/FontFamily.cpp",
346 "jni/FontUtils.cpp",
347 "jni/Graphics.cpp",
348 "jni/ImageDecoder.cpp",
349 "jni/Interpolator.cpp",
350 "jni/MaskFilter.cpp",
351 "jni/NinePatch.cpp",
352 "jni/NinePatchPeeker.cpp",
353 "jni/Paint.cpp",
354 "jni/PaintFilter.cpp",
355 "jni/Path.cpp",
356 "jni/PathEffect.cpp",
357 "jni/PathMeasure.cpp",
358 "jni/Picture.cpp",
Jerome Gaillard9ce48282021-12-02 17:11:28 +0000359 "jni/Region.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400360 "jni/Shader.cpp",
Nader Jawad390d6e82020-09-24 21:35:03 -0700361 "jni/RenderEffect.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400362 "jni/Typeface.cpp",
363 "jni/Utils.cpp",
364 "jni/YuvToJpegEncoder.cpp",
365 "jni/fonts/Font.cpp",
366 "jni/fonts/FontFamily.cpp",
367 "jni/text/LineBreaker.cpp",
368 "jni/text/MeasuredText.cpp",
Seigo Nonakaf3a19152020-09-14 15:29:42 -0700369 "jni/text/TextShaper.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400370 ],
371
Tej Singh78f65b62021-03-18 16:19:55 -0700372 header_libs: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400373
374 include_dirs: [
375 "external/skia/include/private",
376 "external/skia/src/codec",
377 "external/skia/src/core",
378 "external/skia/src/effects",
379 "external/skia/src/image",
380 "external/skia/src/images",
381 ],
382
383 shared_libs: [
384 "libbase",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400385 "libcutils",
386 "libharfbuzz_ng",
387 "liblog",
388 "libminikin",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400389 "libz",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400390 "libjpeg",
391 ],
392
Tej Singh78f65b62021-03-18 16:19:55 -0700393 static_libs: [
394 "libnativehelper_lazy",
395 "libziparchive_for_incfs",
396 ],
Orion Hodson33cbf8b2021-02-08 16:17:07 +0000397
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400398 target: {
399 android: {
400 srcs: [ // sources that depend on android only libraries
401 "jni/AnimatedImageDrawable.cpp",
402 "jni/android_graphics_TextureLayer.cpp",
403 "jni/android_graphics_HardwareRenderer.cpp",
404 "jni/BitmapRegionDecoder.cpp",
405 "jni/GIFMovie.cpp",
406 "jni/GraphicsStatsService.cpp",
407 "jni/Movie.cpp",
408 "jni/MovieImpl.cpp",
409 "jni/pdf/PdfDocument.cpp",
410 "jni/pdf/PdfEditor.cpp",
411 "jni/pdf/PdfRenderer.cpp",
412 "jni/pdf/PdfUtils.cpp",
413 ],
414 shared_libs: [
415 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500416 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500417 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400418 "libmediandk",
419 "libnativedisplay",
420 "libnativewindow",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400421 "libpdfium",
422 ],
423 static_libs: [
424 "libgif",
Tej Singh78f65b62021-03-18 16:19:55 -0700425 "libstatslog_hwui",
426 "libstatspull_lazy",
427 "libstatssocket_lazy",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400428 ],
429 },
430 host: {
431 cflags: [
432 "-Wno-unused-const-variable",
433 "-Wno-unused-function",
434 ],
435 static_libs: [
436 "libandroidfw",
437 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700438 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400439 },
440}
441
Tej Singh78f65b62021-03-18 16:19:55 -0700442cc_library_static {
443 name: "libstatslog_hwui",
444 generated_sources: ["statslog_hwui.cpp"],
445 generated_headers: ["statslog_hwui.h"],
446 export_generated_headers: ["statslog_hwui.h"],
447 static_libs: [
448 "libstatssocket_lazy",
449 "libstatspull_lazy",
450 ],
451}
452
453genrule {
454 name: "statslog_hwui.h",
455 tools: ["stats-log-api-gen"],
456 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_hwui.h --module hwui" +
457 " --namespace android,uirenderer,stats",
458 out: [
459 "statslog_hwui.h",
460 ],
461}
462
463genrule {
464 name: "statslog_hwui.cpp",
465 tools: ["stats-log-api-gen"],
466 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_hwui.cpp --module hwui" +
467 " --namespace android,uirenderer,stats --importHeader statslog_hwui.h",
468 out: [
469 "statslog_hwui.cpp",
470 ],
471}
472
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400473// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700474// library
475// ------------------------
476
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400477cc_library_headers {
478 name: "libhwui_internal_headers",
479
480 host_supported: true,
481 export_include_dirs: [
482 ".",
483 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700484 header_libs: ["android_graphics_jni_headers"],
485 export_header_lib_headers: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400486}
487
Colin Crossf6298102017-04-19 15:25:25 -0700488cc_defaults {
489 name: "libhwui_defaults",
490 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400491
492 whole_static_libs: ["libskia"],
493
Colin Crossf6298102017-04-19 15:25:25 -0700494 srcs: [
John Reckdc95f102020-11-16 12:35:02 -0500495 "canvas/CanvasFrontend.cpp",
John Reck013127b2020-10-29 20:53:51 -0400496 "canvas/CanvasOpBuffer.cpp",
497 "canvas/CanvasOpRasterizer.cpp",
John Reck5cb290b2021-02-01 13:47:31 -0500498 "effects/StretchEffect.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700499 "pipeline/skia/HolePunch.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100500 "pipeline/skia/SkiaDisplayList.cpp",
501 "pipeline/skia/SkiaRecordingCanvas.cpp",
Nader Jawad197743f2021-04-19 19:45:13 -0700502 "pipeline/skia/StretchMask.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100503 "pipeline/skia/RenderNodeDrawable.cpp",
504 "pipeline/skia/ReorderBarrierDrawables.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700505 "pipeline/skia/TransformCanvas.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100506 "renderthread/Frame.cpp",
507 "renderthread/RenderTask.cpp",
508 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500509 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700510 "hwui/Bitmap.cpp",
Mike Reed0f9dce72021-02-12 21:20:33 -0500511 "hwui/BlurDrawLooper.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700512 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500513 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700514 "hwui/MinikinSkia.cpp",
515 "hwui/MinikinUtils.cpp",
516 "hwui/PaintImpl.cpp",
517 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700518 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100519 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700520 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700521 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100522 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700523 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100524 "AnimatorManager.cpp",
525 "CanvasTransform.cpp",
526 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700527 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100528 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700529 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700530 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700531 "Properties.cpp",
532 "PropertyValuesAnimatorSet.cpp",
533 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100534 "RecordingCanvas.cpp",
535 "RenderNode.cpp",
536 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100537 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700538 "SkiaCanvas.cpp",
Mike Reed74065272021-04-12 09:52:07 -0400539 "SkiaInterpolator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700540 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700541 ],
542
Kweku Adams228b6d22018-04-12 13:09:04 -0700543 proto: {
544 export_proto_headers: true,
545 },
546
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100547 target: {
548 android: {
Long Ling9e6c9fb2022-02-02 14:32:09 -0800549 header_libs: [
550 "libandroid_headers_private",
551 "libtonemap_headers",
552 ],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100553
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100554 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000555 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500556 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100557 "pipeline/skia/GLFunctorDrawable.cpp",
558 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100559 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100560 "pipeline/skia/SkiaMemoryTracer.cpp",
561 "pipeline/skia/SkiaOpenGLPipeline.cpp",
562 "pipeline/skia/SkiaPipeline.cpp",
563 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100564 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100565 "pipeline/skia/VkFunctorDrawable.cpp",
566 "pipeline/skia/VkInteropFunctorDrawable.cpp",
567 "renderstate/RenderState.cpp",
568 "renderthread/CacheManager.cpp",
569 "renderthread/CanvasContext.cpp",
570 "renderthread/DrawFrameTask.cpp",
571 "renderthread/EglManager.cpp",
572 "renderthread/ReliableSurface.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700573 "renderthread/RenderEffectCapabilityQuery.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100574 "renderthread/VulkanManager.cpp",
575 "renderthread/VulkanSurface.cpp",
576 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100577 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100578 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100579 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100580 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800581 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100582 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400583 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100584 "DeferredLayerUpdater.cpp",
585 "DeviceInfo.cpp",
586 "FrameInfo.cpp",
587 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100588 "HardwareBitmapUploader.cpp",
589 "HWUIProperties.sysprop",
590 "JankTracker.cpp",
Pablo Gamito88660d72021-08-09 14:37:56 +0000591 "FrameMetricsReporter.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100592 "Layer.cpp",
593 "LayerUpdateQueue.cpp",
594 "ProfileData.cpp",
595 "ProfileDataContainer.cpp",
596 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100597 "TreeInfo.cpp",
598 "WebViewFunctorManager.cpp",
599 "protos/graphicsstats.proto",
600 ],
601
602 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
603 cflags: ["-Wno-implicit-fallthrough"],
604 },
605 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100606 srcs: [
607 "utils/HostColorSpace.cpp",
608 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100609 export_static_lib_headers: [
610 "libarect",
611 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700612 },
613 },
Colin Crossf6298102017-04-19 15:25:25 -0700614}
615
616cc_library {
617 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100618 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700619 defaults: [
620 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400621 "android_graphics_apex",
622 "android_graphics_jni",
Collin Fijalkovichc10428f2021-04-23 14:09:16 -0700623 "linker_hugepage_aligned",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700624 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400625 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400626 target: {
627 android: {
628 version_script: "libhwui.map.txt",
Tej Singh78f65b62021-03-18 16:19:55 -0700629 },
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400630 },
Yi Kong7c0a3ad2022-01-08 01:01:20 +0800631 afdo: true,
Colin Crossf6298102017-04-19 15:25:25 -0700632}
633
Colin Crossf6298102017-04-19 15:25:25 -0700634cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700635 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700636 defaults: [
637 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700638 ],
Colin Crossf6298102017-04-19 15:25:25 -0700639}
640
641cc_defaults {
642 name: "hwui_test_defaults",
643 defaults: ["hwui_defaults"],
644 test_suites: ["device-tests"],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100645 header_libs: ["libandroid_headers_private"],
Alec Mouri680414e2020-01-28 09:22:33 -0800646 target: {
647 android: {
648 shared_libs: [
Tej Singh78f65b62021-03-18 16:19:55 -0700649 "libgui",
650 "libui",
651 ],
652 },
Alec Mouri680414e2020-01-28 09:22:33 -0800653 },
Colin Crossf6298102017-04-19 15:25:25 -0700654 srcs: [
655 "tests/common/scenes/*.cpp",
656 "tests/common/LeakChecker.cpp",
657 "tests/common/TestListViewSceneBase.cpp",
658 "tests/common/TestContext.cpp",
659 "tests/common/TestScene.cpp",
660 "tests/common/TestUtils.cpp",
661 ],
662}
663
664// ------------------------
665// unit tests
666// ------------------------
667
668cc_test {
669 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400670 defaults: [
671 "hwui_test_defaults",
672 "android_graphics_apex",
673 "android_graphics_jni",
674 ],
Colin Crossf6298102017-04-19 15:25:25 -0700675
676 static_libs: [
677 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700678 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700679 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800680 shared_libs: [
681 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800682 ],
Colin Crossf6298102017-04-19 15:25:25 -0700683 srcs: [
684 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400685 "tests/unit/ABitmapTests.cpp",
Nolan Scobie892cac22022-10-24 19:57:43 -0400686 "tests/unit/AutoBackendTextureReleaseTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400687 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700688 "tests/unit/CanvasContextTests.cpp",
John Reck013127b2020-10-29 20:53:51 -0400689 "tests/unit/CanvasOpTests.cpp",
John Reckdc95f102020-11-16 12:35:02 -0500690 "tests/unit/CanvasFrontendTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700691 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700692 "tests/unit/DamageAccumulatorTests.cpp",
693 "tests/unit/DeferredLayerUpdaterTests.cpp",
John Reck064650b2021-01-19 21:29:24 -0500694 "tests/unit/EglManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700695 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700696 "tests/unit/GraphicsStatsServiceTests.cpp",
Jorim Jaggi10f328c2021-01-19 00:08:02 +0100697 "tests/unit/JankTrackerTests.cpp",
Pablo Gamitodfb85a22021-08-26 01:19:05 +0200698 "tests/unit/FrameMetricsReporterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700699 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700700 "tests/unit/LinearAllocatorTests.cpp",
701 "tests/unit/MatrixTests.cpp",
John Reck95735052020-12-15 13:39:22 -0500702 "tests/unit/OpBufferTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700703 "tests/unit/PathInterpolatorTests.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700704 "tests/unit/RenderEffectCapabilityQueryTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700705 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700706 "tests/unit/RenderNodeTests.cpp",
707 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800708 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400709 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700710 "tests/unit/SkiaBehaviorTests.cpp",
711 "tests/unit/SkiaDisplayListTests.cpp",
712 "tests/unit/SkiaPipelineTests.cpp",
713 "tests/unit/SkiaRenderPropertiesTests.cpp",
714 "tests/unit/SkiaCanvasTests.cpp",
Nader Jawadc401b232021-05-21 12:52:05 -0700715 "tests/unit/StretchEffectTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700716 "tests/unit/StringUtilsTests.cpp",
717 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700718 "tests/unit/ThreadBaseTests.cpp",
719 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700720 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800721 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700722 ],
723}
724
725// ------------------------
726// Macro-bench app
727// ------------------------
728
729cc_benchmark {
730 name: "hwuimacro",
731 defaults: ["hwui_test_defaults"],
732
John Reck23462d82019-05-29 16:55:06 -0700733 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800734 shared_libs: [
735 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800736 ],
Colin Crossf6298102017-04-19 15:25:25 -0700737
738 srcs: [
739 "tests/macrobench/TestSceneRunner.cpp",
740 "tests/macrobench/main.cpp",
741 ],
742}
743
744// ------------------------
745// Micro-bench app
746// ---------------------
747
748cc_benchmark {
749 name: "hwuimicro",
750 defaults: ["hwui_test_defaults"],
751
John Reck23462d82019-05-29 16:55:06 -0700752 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800753 shared_libs: [
754 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800755 ],
Colin Crossf6298102017-04-19 15:25:25 -0700756
757 srcs: [
758 "tests/microbench/main.cpp",
John Reckb5eeb182020-12-09 13:45:39 -0500759 "tests/microbench/CanvasOpBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700760 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700761 "tests/microbench/LinearAllocatorBench.cpp",
762 "tests/microbench/PathParserBench.cpp",
763 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700764 ],
765}