blob: ad9aa6cdd3d9a761baf4836f87b669e69a283130 [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
Alec Mourief37c242020-03-02 21:38:09 +0000215// ------------------------
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400216// APEX
217// ------------------------
218
219cc_library_headers {
220 name: "android_graphics_apex_headers",
221
222 host_supported: true,
223 export_include_dirs: [
224 "apex/include",
225 ],
226 target: {
227 windows: {
228 enabled: true,
229 },
Tej Singh78f65b62021-03-18 16:19:55 -0700230 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400231}
232
233cc_defaults {
234 name: "android_graphics_apex",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400235 cflags: [
236 "-Wno-unused-parameter",
237 "-Wno-non-virtual-dtor",
238 "-Wno-maybe-uninitialized",
239 "-Wno-parentheses",
240 "-Wall",
241 "-Werror",
242 "-Wno-error=deprecated-declarations",
243 "-Wunused",
244 "-Wunreachable-code",
245 ],
246
247 cppflags: ["-Wno-conversion-null"],
248
249 srcs: [
250 "apex/android_matrix.cpp",
251 "apex/android_paint.cpp",
252 "apex/android_region.cpp",
Leon Scroggins IIIcd9e7b42022-04-08 15:27:57 -0400253 "apex/properties.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400254 ],
255
Tej Singh78f65b62021-03-18 16:19:55 -0700256 header_libs: ["android_graphics_apex_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400257
258 target: {
259 android: {
260 srcs: [ // sources that depend on android only libraries
261 "apex/android_bitmap.cpp",
262 "apex/android_canvas.cpp",
263 "apex/jni_runtime.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400264 ],
265 },
Derek Sollenbergerc5882c42019-10-25 11:11:32 -0400266 host: {
267 srcs: [
268 "apex/LayoutlibLoader.cpp",
269 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700270 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400271 },
272}
273
274// ------------------------
275// Android Graphics JNI
276// ------------------------
277
278cc_library_headers {
279 name: "android_graphics_jni_headers",
280
281 host_supported: true,
282 export_include_dirs: [
283 "jni",
284 ],
285 target: {
286 windows: {
287 enabled: true,
288 },
Tej Singh78f65b62021-03-18 16:19:55 -0700289 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400290}
291
292cc_defaults {
293 name: "android_graphics_jni",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400294 cflags: [
295 "-Wno-unused-parameter",
296 "-Wno-non-virtual-dtor",
297 "-Wno-maybe-uninitialized",
298 "-Wno-parentheses",
299
300 "-DGL_GLEXT_PROTOTYPES",
301 "-DEGL_EGLEXT_PROTOTYPES",
302
303 "-DU_USING_ICU_NAMESPACE=0",
304
305 "-Wall",
306 "-Werror",
307 "-Wno-error=deprecated-declarations",
308 "-Wunused",
309 "-Wunreachable-code",
310 ],
311
312 cppflags: ["-Wno-conversion-null"],
313
314 srcs: [
315 "jni/android_graphics_animation_NativeInterpolatorFactory.cpp",
316 "jni/android_graphics_animation_RenderNodeAnimator.cpp",
317 "jni/android_graphics_Canvas.cpp",
318 "jni/android_graphics_ColorSpace.cpp",
319 "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp",
320 "jni/android_graphics_drawable_VectorDrawable.cpp",
321 "jni/android_graphics_HardwareRendererObserver.cpp",
322 "jni/android_graphics_Matrix.cpp",
323 "jni/android_graphics_Picture.cpp",
324 "jni/android_graphics_DisplayListCanvas.cpp",
325 "jni/android_graphics_RenderNode.cpp",
326 "jni/android_nio_utils.cpp",
327 "jni/android_util_PathParser.cpp",
328
329 "jni/Bitmap.cpp",
330 "jni/BitmapFactory.cpp",
331 "jni/ByteBufferStreamAdaptor.cpp",
332 "jni/Camera.cpp",
333 "jni/CanvasProperty.cpp",
334 "jni/ColorFilter.cpp",
335 "jni/CreateJavaOutputStreamAdaptor.cpp",
336 "jni/FontFamily.cpp",
337 "jni/FontUtils.cpp",
338 "jni/Graphics.cpp",
339 "jni/ImageDecoder.cpp",
340 "jni/Interpolator.cpp",
341 "jni/MaskFilter.cpp",
342 "jni/NinePatch.cpp",
343 "jni/NinePatchPeeker.cpp",
344 "jni/Paint.cpp",
345 "jni/PaintFilter.cpp",
346 "jni/Path.cpp",
347 "jni/PathEffect.cpp",
348 "jni/PathMeasure.cpp",
349 "jni/Picture.cpp",
Jerome Gaillard9ce48282021-12-02 17:11:28 +0000350 "jni/Region.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400351 "jni/Shader.cpp",
Nader Jawad390d6e82020-09-24 21:35:03 -0700352 "jni/RenderEffect.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400353 "jni/Typeface.cpp",
354 "jni/Utils.cpp",
355 "jni/YuvToJpegEncoder.cpp",
356 "jni/fonts/Font.cpp",
357 "jni/fonts/FontFamily.cpp",
358 "jni/text/LineBreaker.cpp",
359 "jni/text/MeasuredText.cpp",
Seigo Nonakaf3a19152020-09-14 15:29:42 -0700360 "jni/text/TextShaper.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400361 ],
362
Tej Singh78f65b62021-03-18 16:19:55 -0700363 header_libs: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400364
365 include_dirs: [
366 "external/skia/include/private",
367 "external/skia/src/codec",
368 "external/skia/src/core",
369 "external/skia/src/effects",
370 "external/skia/src/image",
371 "external/skia/src/images",
372 ],
373
374 shared_libs: [
375 "libbase",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400376 "libcutils",
377 "libharfbuzz_ng",
378 "liblog",
379 "libminikin",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400380 "libz",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400381 "libjpeg",
382 ],
383
Tej Singh78f65b62021-03-18 16:19:55 -0700384 static_libs: [
385 "libnativehelper_lazy",
386 "libziparchive_for_incfs",
387 ],
Orion Hodson33cbf8b2021-02-08 16:17:07 +0000388
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400389 target: {
390 android: {
391 srcs: [ // sources that depend on android only libraries
392 "jni/AnimatedImageDrawable.cpp",
393 "jni/android_graphics_TextureLayer.cpp",
394 "jni/android_graphics_HardwareRenderer.cpp",
395 "jni/BitmapRegionDecoder.cpp",
396 "jni/GIFMovie.cpp",
397 "jni/GraphicsStatsService.cpp",
398 "jni/Movie.cpp",
399 "jni/MovieImpl.cpp",
400 "jni/pdf/PdfDocument.cpp",
401 "jni/pdf/PdfEditor.cpp",
402 "jni/pdf/PdfRenderer.cpp",
403 "jni/pdf/PdfUtils.cpp",
404 ],
405 shared_libs: [
406 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500407 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500408 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400409 "libmediandk",
410 "libnativedisplay",
411 "libnativewindow",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400412 "libpdfium",
413 ],
414 static_libs: [
415 "libgif",
Tej Singh78f65b62021-03-18 16:19:55 -0700416 "libstatslog_hwui",
417 "libstatspull_lazy",
418 "libstatssocket_lazy",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400419 ],
420 },
421 host: {
422 cflags: [
423 "-Wno-unused-const-variable",
424 "-Wno-unused-function",
425 ],
426 static_libs: [
427 "libandroidfw",
428 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700429 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400430 },
431}
432
Tej Singh78f65b62021-03-18 16:19:55 -0700433cc_library_static {
434 name: "libstatslog_hwui",
435 generated_sources: ["statslog_hwui.cpp"],
436 generated_headers: ["statslog_hwui.h"],
437 export_generated_headers: ["statslog_hwui.h"],
438 static_libs: [
439 "libstatssocket_lazy",
440 "libstatspull_lazy",
441 ],
442}
443
444genrule {
445 name: "statslog_hwui.h",
446 tools: ["stats-log-api-gen"],
447 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_hwui.h --module hwui" +
448 " --namespace android,uirenderer,stats",
449 out: [
450 "statslog_hwui.h",
451 ],
452}
453
454genrule {
455 name: "statslog_hwui.cpp",
456 tools: ["stats-log-api-gen"],
457 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_hwui.cpp --module hwui" +
458 " --namespace android,uirenderer,stats --importHeader statslog_hwui.h",
459 out: [
460 "statslog_hwui.cpp",
461 ],
462}
463
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400464// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700465// library
466// ------------------------
467
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400468cc_library_headers {
469 name: "libhwui_internal_headers",
470
471 host_supported: true,
472 export_include_dirs: [
473 ".",
474 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700475 header_libs: ["android_graphics_jni_headers"],
476 export_header_lib_headers: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400477}
478
Colin Crossf6298102017-04-19 15:25:25 -0700479cc_defaults {
480 name: "libhwui_defaults",
481 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400482
483 whole_static_libs: ["libskia"],
484
Colin Crossf6298102017-04-19 15:25:25 -0700485 srcs: [
John Reckdc95f102020-11-16 12:35:02 -0500486 "canvas/CanvasFrontend.cpp",
John Reck013127b2020-10-29 20:53:51 -0400487 "canvas/CanvasOpBuffer.cpp",
488 "canvas/CanvasOpRasterizer.cpp",
John Reck5cb290b2021-02-01 13:47:31 -0500489 "effects/StretchEffect.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700490 "pipeline/skia/HolePunch.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100491 "pipeline/skia/SkiaDisplayList.cpp",
492 "pipeline/skia/SkiaRecordingCanvas.cpp",
Nader Jawad197743f2021-04-19 19:45:13 -0700493 "pipeline/skia/StretchMask.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100494 "pipeline/skia/RenderNodeDrawable.cpp",
495 "pipeline/skia/ReorderBarrierDrawables.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700496 "pipeline/skia/TransformCanvas.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100497 "renderthread/Frame.cpp",
498 "renderthread/RenderTask.cpp",
499 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500500 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700501 "hwui/Bitmap.cpp",
Mike Reed0f9dce72021-02-12 21:20:33 -0500502 "hwui/BlurDrawLooper.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700503 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500504 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700505 "hwui/MinikinSkia.cpp",
506 "hwui/MinikinUtils.cpp",
507 "hwui/PaintImpl.cpp",
508 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700509 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100510 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700511 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700512 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100513 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700514 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100515 "AnimatorManager.cpp",
516 "CanvasTransform.cpp",
517 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700518 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100519 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700520 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700521 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700522 "Properties.cpp",
523 "PropertyValuesAnimatorSet.cpp",
524 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100525 "RecordingCanvas.cpp",
526 "RenderNode.cpp",
527 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100528 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700529 "SkiaCanvas.cpp",
Mike Reed74065272021-04-12 09:52:07 -0400530 "SkiaInterpolator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700531 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700532 ],
533
Kweku Adams228b6d22018-04-12 13:09:04 -0700534 proto: {
535 export_proto_headers: true,
536 },
537
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100538 target: {
539 android: {
Long Ling9e6c9fb2022-02-02 14:32:09 -0800540 header_libs: [
541 "libandroid_headers_private",
542 "libtonemap_headers",
543 ],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100544
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100545 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000546 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500547 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100548 "pipeline/skia/GLFunctorDrawable.cpp",
549 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100550 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100551 "pipeline/skia/SkiaMemoryTracer.cpp",
552 "pipeline/skia/SkiaOpenGLPipeline.cpp",
553 "pipeline/skia/SkiaPipeline.cpp",
554 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100555 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100556 "pipeline/skia/VkFunctorDrawable.cpp",
557 "pipeline/skia/VkInteropFunctorDrawable.cpp",
558 "renderstate/RenderState.cpp",
559 "renderthread/CacheManager.cpp",
560 "renderthread/CanvasContext.cpp",
561 "renderthread/DrawFrameTask.cpp",
562 "renderthread/EglManager.cpp",
563 "renderthread/ReliableSurface.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700564 "renderthread/RenderEffectCapabilityQuery.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100565 "renderthread/VulkanManager.cpp",
566 "renderthread/VulkanSurface.cpp",
567 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100568 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100569 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100570 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100571 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800572 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100573 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400574 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100575 "DeferredLayerUpdater.cpp",
576 "DeviceInfo.cpp",
577 "FrameInfo.cpp",
578 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100579 "HardwareBitmapUploader.cpp",
580 "HWUIProperties.sysprop",
581 "JankTracker.cpp",
Pablo Gamito88660d72021-08-09 14:37:56 +0000582 "FrameMetricsReporter.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100583 "Layer.cpp",
584 "LayerUpdateQueue.cpp",
585 "ProfileData.cpp",
586 "ProfileDataContainer.cpp",
587 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100588 "TreeInfo.cpp",
589 "WebViewFunctorManager.cpp",
590 "protos/graphicsstats.proto",
591 ],
592
593 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
594 cflags: ["-Wno-implicit-fallthrough"],
595 },
596 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100597 srcs: [
598 "utils/HostColorSpace.cpp",
599 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100600 export_static_lib_headers: [
601 "libarect",
602 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700603 },
604 },
Colin Crossf6298102017-04-19 15:25:25 -0700605}
606
607cc_library {
608 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100609 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700610 defaults: [
611 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400612 "android_graphics_apex",
613 "android_graphics_jni",
Collin Fijalkovichc10428f2021-04-23 14:09:16 -0700614 "linker_hugepage_aligned",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700615 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400616 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400617 target: {
618 android: {
619 version_script: "libhwui.map.txt",
Tej Singh78f65b62021-03-18 16:19:55 -0700620 },
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400621 },
Yi Kong7c0a3ad2022-01-08 01:01:20 +0800622 afdo: true,
Colin Crossf6298102017-04-19 15:25:25 -0700623}
624
Colin Crossf6298102017-04-19 15:25:25 -0700625cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700626 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700627 defaults: [
628 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700629 ],
Colin Crossf6298102017-04-19 15:25:25 -0700630}
631
632cc_defaults {
633 name: "hwui_test_defaults",
634 defaults: ["hwui_defaults"],
635 test_suites: ["device-tests"],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100636 header_libs: ["libandroid_headers_private"],
Alec Mouri680414e2020-01-28 09:22:33 -0800637 target: {
638 android: {
639 shared_libs: [
Tej Singh78f65b62021-03-18 16:19:55 -0700640 "libgui",
641 "libui",
642 ],
643 },
Alec Mouri680414e2020-01-28 09:22:33 -0800644 },
Colin Crossf6298102017-04-19 15:25:25 -0700645 srcs: [
646 "tests/common/scenes/*.cpp",
647 "tests/common/LeakChecker.cpp",
648 "tests/common/TestListViewSceneBase.cpp",
649 "tests/common/TestContext.cpp",
650 "tests/common/TestScene.cpp",
651 "tests/common/TestUtils.cpp",
652 ],
653}
654
655// ------------------------
656// unit tests
657// ------------------------
658
659cc_test {
660 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400661 defaults: [
662 "hwui_test_defaults",
663 "android_graphics_apex",
664 "android_graphics_jni",
665 ],
Colin Crossf6298102017-04-19 15:25:25 -0700666
667 static_libs: [
668 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700669 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700670 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800671 shared_libs: [
672 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800673 ],
Colin Crossf6298102017-04-19 15:25:25 -0700674 srcs: [
675 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400676 "tests/unit/ABitmapTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400677 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700678 "tests/unit/CanvasContextTests.cpp",
John Reck013127b2020-10-29 20:53:51 -0400679 "tests/unit/CanvasOpTests.cpp",
John Reckdc95f102020-11-16 12:35:02 -0500680 "tests/unit/CanvasFrontendTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700681 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700682 "tests/unit/DamageAccumulatorTests.cpp",
683 "tests/unit/DeferredLayerUpdaterTests.cpp",
John Reck064650b2021-01-19 21:29:24 -0500684 "tests/unit/EglManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700685 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700686 "tests/unit/GraphicsStatsServiceTests.cpp",
Jorim Jaggi10f328c2021-01-19 00:08:02 +0100687 "tests/unit/JankTrackerTests.cpp",
Pablo Gamitodfb85a22021-08-26 01:19:05 +0200688 "tests/unit/FrameMetricsReporterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700689 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700690 "tests/unit/LinearAllocatorTests.cpp",
691 "tests/unit/MatrixTests.cpp",
John Reck95735052020-12-15 13:39:22 -0500692 "tests/unit/OpBufferTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700693 "tests/unit/PathInterpolatorTests.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700694 "tests/unit/RenderEffectCapabilityQueryTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700695 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700696 "tests/unit/RenderNodeTests.cpp",
697 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800698 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400699 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700700 "tests/unit/SkiaBehaviorTests.cpp",
701 "tests/unit/SkiaDisplayListTests.cpp",
702 "tests/unit/SkiaPipelineTests.cpp",
703 "tests/unit/SkiaRenderPropertiesTests.cpp",
704 "tests/unit/SkiaCanvasTests.cpp",
Nader Jawadc401b232021-05-21 12:52:05 -0700705 "tests/unit/StretchEffectTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700706 "tests/unit/StringUtilsTests.cpp",
707 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700708 "tests/unit/ThreadBaseTests.cpp",
709 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700710 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800711 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700712 ],
713}
714
715// ------------------------
716// Macro-bench app
717// ------------------------
718
719cc_benchmark {
720 name: "hwuimacro",
721 defaults: ["hwui_test_defaults"],
722
John Reck23462d82019-05-29 16:55:06 -0700723 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800724 shared_libs: [
725 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800726 ],
Colin Crossf6298102017-04-19 15:25:25 -0700727
728 srcs: [
729 "tests/macrobench/TestSceneRunner.cpp",
730 "tests/macrobench/main.cpp",
731 ],
732}
733
734// ------------------------
735// Micro-bench app
736// ---------------------
737
738cc_benchmark {
739 name: "hwuimicro",
740 defaults: ["hwui_test_defaults"],
741
John Reck23462d82019-05-29 16:55:06 -0700742 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800743 shared_libs: [
744 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800745 ],
Colin Crossf6298102017-04-19 15:25:25 -0700746
747 srcs: [
748 "tests/microbench/main.cpp",
John Reckb5eeb182020-12-09 13:45:39 -0500749 "tests/microbench/CanvasOpBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700750 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700751 "tests/microbench/LinearAllocatorBench.cpp",
752 "tests/microbench/PathParserBench.cpp",
753 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700754 ],
755}