blob: 0a232d6272bdecd80a8a9f1c1a84f7c91ffffe0a [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 Nainar0dfd4be2017-11-16 22:40:00 -080038 "hwui_pgo",
Pirama Arumuga Nainarb7913e12018-03-09 00:03:57 +000039 "hwui_lto",
Colin Crossf6298102017-04-19 15:25:25 -070040 ],
41
John Reck283bb462018-12-13 16:40:14 -080042 cpp_std: "experimental",
43
Colin Crossf6298102017-04-19 15:25:25 -070044 cflags: [
45 "-DEGL_EGLEXT_PROTOTYPES",
46 "-DGL_GLEXT_PROTOTYPES",
47 "-DATRACE_TAG=ATRACE_TAG_VIEW",
48 "-DLOG_TAG=\"OpenGLRenderer\"",
49 "-Wall",
50 "-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: [
109 "liblog",
110 "libcutils",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100111 "libutils",
112 "libEGL",
113 "libGLESv1_CM",
114 "libGLESv2",
115 "libGLESv3",
116 "libvulkan",
Alec Mouri22d753f2019-09-05 17:11:45 -0700117 "libnativedisplay",
Derek Sollenbergere78f7c92019-07-31 15:18:47 -0400118 "libnativewindow",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100119 "libprotobuf-cpp-lite",
120 "libft2",
121 "libandroidfw",
122 "libcrypto",
123 "libsync",
124 ],
125 static_libs: [
126 "libEGL_blobCache",
Stan Ilievc9043812020-02-03 16:57:09 -0500127 "libprotoutil",
Tej Singh78f65b62021-03-18 16:19:55 -0700128 "libstatslog_hwui",
129 "libstatspull_lazy",
130 "libstatssocket_lazy",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100131 ],
132 },
133 host: {
134 static_libs: [
135 "libandroidfw",
136 "libutils",
137 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700138 },
139 },
Colin Crossf6298102017-04-19 15:25:25 -0700140}
141
142cc_defaults {
143 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -0700144 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
145}
146
147cc_defaults {
148 name: "hwui_compile_for_perf",
149 // TODO: Non-arm?
150 cflags: [
151 "-fno-omit-frame-pointer",
152 "-marm",
153 "-mapcs",
154 ],
155}
156
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800157// Build libhwui with PGO by default.
158// Location of PGO profile data is defined in build/soong/cc/pgo.go
159// and is separate from hwui.
160// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
161// or set enable_profile_use property to false.
162cc_defaults {
163 name: "hwui_pgo",
164
165 pgo: {
166 instrumentation: true,
167 profile_file: "hwui/hwui.profdata",
168 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800169 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800170 },
171}
172
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800173// Build hwui library with ThinLTO by default.
174cc_defaults {
175 name: "hwui_lto",
176 target: {
177 android: {
178 lto: {
179 thin: true,
180 },
181 },
182 },
183}
184
Colin Crossf6298102017-04-19 15:25:25 -0700185// ------------------------
Alec Mourief37c242020-03-02 21:38:09 +0000186// framework-graphics jar
187// ------------------------
188
Paul Duffin4e006622020-05-31 16:55:13 +0100189java_sdk_library {
Alec Mourief37c242020-03-02 21:38:09 +0000190 name: "framework-graphics",
Paul Duffin4e006622020-05-31 16:55:13 +0100191 defaults: ["framework-module-defaults"],
192 visibility: [
193 "//frameworks/base", // Framework
194 ],
Alec Mourief37c242020-03-02 21:38:09 +0000195
196 srcs: [
197 ":framework-graphics-srcs",
198 ],
199
200 permitted_packages: [
201 "android.graphics",
202 ],
203
Alec Mourief37c242020-03-02 21:38:09 +0000204 // TODO: once framework-graphics is officially part of the
205 // UI-rendering module this line would no longer be
206 // needed.
207 installable: true,
208
Paul Duffin4e006622020-05-31 16:55:13 +0100209 // Disable api_lint that the defaults enable
210 // TODO: enable this
211 api_lint: {
212 enabled: false,
213 },
Anton Hansson96b08ae2020-12-21 16:59:06 +0000214 // TODO: remove this
215 unsafe_ignore_missing_latest_api: true,
Alec Mourief37c242020-03-02 21:38:09 +0000216}
217
218filegroup {
219 name: "framework-graphics-srcs",
220 srcs: [
221 "apex/java/**/*.java",
222 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700223 path: "apex/java",
Alec Mourief37c242020-03-02 21:38:09 +0000224}
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",
264 ],
265
Tej Singh78f65b62021-03-18 16:19:55 -0700266 header_libs: ["android_graphics_apex_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400267
268 target: {
269 android: {
270 srcs: [ // sources that depend on android only libraries
271 "apex/android_bitmap.cpp",
272 "apex/android_canvas.cpp",
273 "apex/jni_runtime.cpp",
274 "apex/renderthread.cpp",
275 ],
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",
341 "jni/BitmapFactory.cpp",
342 "jni/ByteBufferStreamAdaptor.cpp",
343 "jni/Camera.cpp",
344 "jni/CanvasProperty.cpp",
345 "jni/ColorFilter.cpp",
346 "jni/CreateJavaOutputStreamAdaptor.cpp",
347 "jni/FontFamily.cpp",
348 "jni/FontUtils.cpp",
349 "jni/Graphics.cpp",
350 "jni/ImageDecoder.cpp",
351 "jni/Interpolator.cpp",
352 "jni/MaskFilter.cpp",
353 "jni/NinePatch.cpp",
354 "jni/NinePatchPeeker.cpp",
355 "jni/Paint.cpp",
356 "jni/PaintFilter.cpp",
357 "jni/Path.cpp",
358 "jni/PathEffect.cpp",
359 "jni/PathMeasure.cpp",
360 "jni/Picture.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400361 "jni/Shader.cpp",
Nader Jawad390d6e82020-09-24 21:35:03 -0700362 "jni/RenderEffect.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400363 "jni/Typeface.cpp",
364 "jni/Utils.cpp",
365 "jni/YuvToJpegEncoder.cpp",
366 "jni/fonts/Font.cpp",
367 "jni/fonts/FontFamily.cpp",
368 "jni/text/LineBreaker.cpp",
369 "jni/text/MeasuredText.cpp",
Seigo Nonakaf3a19152020-09-14 15:29:42 -0700370 "jni/text/TextShaper.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400371 ],
372
Tej Singh78f65b62021-03-18 16:19:55 -0700373 header_libs: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400374
375 include_dirs: [
376 "external/skia/include/private",
377 "external/skia/src/codec",
378 "external/skia/src/core",
379 "external/skia/src/effects",
380 "external/skia/src/image",
381 "external/skia/src/images",
382 ],
383
384 shared_libs: [
385 "libbase",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400386 "libcutils",
387 "libharfbuzz_ng",
388 "liblog",
389 "libminikin",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400390 "libz",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400391 "libjpeg",
392 ],
393
Tej Singh78f65b62021-03-18 16:19:55 -0700394 static_libs: [
395 "libnativehelper_lazy",
396 "libziparchive_for_incfs",
397 ],
Orion Hodson33cbf8b2021-02-08 16:17:07 +0000398
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400399 target: {
400 android: {
401 srcs: [ // sources that depend on android only libraries
402 "jni/AnimatedImageDrawable.cpp",
403 "jni/android_graphics_TextureLayer.cpp",
404 "jni/android_graphics_HardwareRenderer.cpp",
405 "jni/BitmapRegionDecoder.cpp",
406 "jni/GIFMovie.cpp",
407 "jni/GraphicsStatsService.cpp",
408 "jni/Movie.cpp",
409 "jni/MovieImpl.cpp",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500410 "jni/Region.cpp", // requires libbinder_ndk
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400411 "jni/pdf/PdfDocument.cpp",
412 "jni/pdf/PdfEditor.cpp",
413 "jni/pdf/PdfRenderer.cpp",
414 "jni/pdf/PdfUtils.cpp",
415 ],
416 shared_libs: [
417 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500418 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500419 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400420 "libmediandk",
421 "libnativedisplay",
422 "libnativewindow",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400423 "libpdfium",
424 ],
425 static_libs: [
426 "libgif",
Tej Singh78f65b62021-03-18 16:19:55 -0700427 "libstatslog_hwui",
428 "libstatspull_lazy",
429 "libstatssocket_lazy",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400430 ],
431 },
432 host: {
433 cflags: [
434 "-Wno-unused-const-variable",
435 "-Wno-unused-function",
436 ],
437 static_libs: [
438 "libandroidfw",
439 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700440 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400441 },
442}
443
Tej Singh78f65b62021-03-18 16:19:55 -0700444cc_library_static {
445 name: "libstatslog_hwui",
446 generated_sources: ["statslog_hwui.cpp"],
447 generated_headers: ["statslog_hwui.h"],
448 export_generated_headers: ["statslog_hwui.h"],
449 static_libs: [
450 "libstatssocket_lazy",
451 "libstatspull_lazy",
452 ],
453}
454
455genrule {
456 name: "statslog_hwui.h",
457 tools: ["stats-log-api-gen"],
458 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_hwui.h --module hwui" +
459 " --namespace android,uirenderer,stats",
460 out: [
461 "statslog_hwui.h",
462 ],
463}
464
465genrule {
466 name: "statslog_hwui.cpp",
467 tools: ["stats-log-api-gen"],
468 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_hwui.cpp --module hwui" +
469 " --namespace android,uirenderer,stats --importHeader statslog_hwui.h",
470 out: [
471 "statslog_hwui.cpp",
472 ],
473}
474
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400475// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700476// library
477// ------------------------
478
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400479cc_library_headers {
480 name: "libhwui_internal_headers",
481
482 host_supported: true,
483 export_include_dirs: [
484 ".",
485 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700486 header_libs: ["android_graphics_jni_headers"],
487 export_header_lib_headers: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400488}
489
Colin Crossf6298102017-04-19 15:25:25 -0700490cc_defaults {
491 name: "libhwui_defaults",
492 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400493
494 whole_static_libs: ["libskia"],
495
Colin Crossf6298102017-04-19 15:25:25 -0700496 srcs: [
John Reckdc95f102020-11-16 12:35:02 -0500497 "canvas/CanvasFrontend.cpp",
John Reck013127b2020-10-29 20:53:51 -0400498 "canvas/CanvasOpBuffer.cpp",
499 "canvas/CanvasOpRasterizer.cpp",
John Reck5cb290b2021-02-01 13:47:31 -0500500 "effects/StretchEffect.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700501 "pipeline/skia/HolePunch.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100502 "pipeline/skia/SkiaDisplayList.cpp",
503 "pipeline/skia/SkiaRecordingCanvas.cpp",
Nader Jawad197743f2021-04-19 19:45:13 -0700504 "pipeline/skia/StretchMask.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100505 "pipeline/skia/RenderNodeDrawable.cpp",
506 "pipeline/skia/ReorderBarrierDrawables.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700507 "pipeline/skia/TransformCanvas.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100508 "renderthread/Frame.cpp",
509 "renderthread/RenderTask.cpp",
510 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500511 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700512 "hwui/Bitmap.cpp",
Mike Reed0f9dce72021-02-12 21:20:33 -0500513 "hwui/BlurDrawLooper.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700514 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500515 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700516 "hwui/MinikinSkia.cpp",
517 "hwui/MinikinUtils.cpp",
518 "hwui/PaintImpl.cpp",
519 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700520 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100521 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700522 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700523 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100524 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700525 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100526 "AnimatorManager.cpp",
527 "CanvasTransform.cpp",
528 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700529 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100530 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700531 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700532 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700533 "Properties.cpp",
534 "PropertyValuesAnimatorSet.cpp",
535 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100536 "RecordingCanvas.cpp",
537 "RenderNode.cpp",
538 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100539 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700540 "SkiaCanvas.cpp",
Mike Reed74065272021-04-12 09:52:07 -0400541 "SkiaInterpolator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700542 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700543 ],
544
Kweku Adams228b6d22018-04-12 13:09:04 -0700545 proto: {
546 export_proto_headers: true,
547 },
548
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100549 target: {
550 android: {
Tej Singh78f65b62021-03-18 16:19:55 -0700551 header_libs: ["libandroid_headers_private"],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100552
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100553 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000554 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500555 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100556 "pipeline/skia/GLFunctorDrawable.cpp",
557 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100558 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100559 "pipeline/skia/SkiaMemoryTracer.cpp",
560 "pipeline/skia/SkiaOpenGLPipeline.cpp",
561 "pipeline/skia/SkiaPipeline.cpp",
562 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100563 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100564 "pipeline/skia/VkFunctorDrawable.cpp",
565 "pipeline/skia/VkInteropFunctorDrawable.cpp",
566 "renderstate/RenderState.cpp",
567 "renderthread/CacheManager.cpp",
568 "renderthread/CanvasContext.cpp",
569 "renderthread/DrawFrameTask.cpp",
570 "renderthread/EglManager.cpp",
571 "renderthread/ReliableSurface.cpp",
572 "renderthread/VulkanManager.cpp",
573 "renderthread/VulkanSurface.cpp",
574 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100575 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100576 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100577 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100578 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800579 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100580 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400581 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100582 "DeferredLayerUpdater.cpp",
583 "DeviceInfo.cpp",
584 "FrameInfo.cpp",
585 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100586 "HardwareBitmapUploader.cpp",
587 "HWUIProperties.sysprop",
588 "JankTracker.cpp",
589 "Layer.cpp",
590 "LayerUpdateQueue.cpp",
591 "ProfileData.cpp",
592 "ProfileDataContainer.cpp",
593 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100594 "TreeInfo.cpp",
595 "WebViewFunctorManager.cpp",
596 "protos/graphicsstats.proto",
597 ],
598
599 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
600 cflags: ["-Wno-implicit-fallthrough"],
601 },
602 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100603 srcs: [
604 "utils/HostColorSpace.cpp",
605 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100606 export_static_lib_headers: [
607 "libarect",
608 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700609 },
610 },
Colin Crossf6298102017-04-19 15:25:25 -0700611}
612
613cc_library {
614 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100615 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700616 defaults: [
617 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400618 "android_graphics_apex",
619 "android_graphics_jni",
Collin Fijalkovichc10428f2021-04-23 14:09:16 -0700620 "linker_hugepage_aligned",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700621 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400622 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400623 target: {
624 android: {
625 version_script: "libhwui.map.txt",
Tej Singh78f65b62021-03-18 16:19:55 -0700626 },
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400627 },
Colin Crossf6298102017-04-19 15:25:25 -0700628}
629
Colin Crossf6298102017-04-19 15:25:25 -0700630cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700631 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700632 defaults: [
633 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700634 ],
Colin Crossf6298102017-04-19 15:25:25 -0700635}
636
637cc_defaults {
638 name: "hwui_test_defaults",
639 defaults: ["hwui_defaults"],
640 test_suites: ["device-tests"],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100641 header_libs: ["libandroid_headers_private"],
Alec Mouri680414e2020-01-28 09:22:33 -0800642 target: {
643 android: {
644 shared_libs: [
Tej Singh78f65b62021-03-18 16:19:55 -0700645 "libgui",
646 "libui",
647 ],
648 },
Alec Mouri680414e2020-01-28 09:22:33 -0800649 },
Colin Crossf6298102017-04-19 15:25:25 -0700650 srcs: [
651 "tests/common/scenes/*.cpp",
652 "tests/common/LeakChecker.cpp",
653 "tests/common/TestListViewSceneBase.cpp",
654 "tests/common/TestContext.cpp",
655 "tests/common/TestScene.cpp",
656 "tests/common/TestUtils.cpp",
657 ],
658}
659
660// ------------------------
661// unit tests
662// ------------------------
663
664cc_test {
665 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400666 defaults: [
667 "hwui_test_defaults",
668 "android_graphics_apex",
669 "android_graphics_jni",
670 ],
Colin Crossf6298102017-04-19 15:25:25 -0700671
672 static_libs: [
673 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700674 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700675 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800676 shared_libs: [
677 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800678 ],
Colin Crossf6298102017-04-19 15:25:25 -0700679 srcs: [
680 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400681 "tests/unit/ABitmapTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400682 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700683 "tests/unit/CanvasContextTests.cpp",
John Reck013127b2020-10-29 20:53:51 -0400684 "tests/unit/CanvasOpTests.cpp",
John Reckdc95f102020-11-16 12:35:02 -0500685 "tests/unit/CanvasFrontendTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700686 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700687 "tests/unit/DamageAccumulatorTests.cpp",
688 "tests/unit/DeferredLayerUpdaterTests.cpp",
John Reck064650b2021-01-19 21:29:24 -0500689 "tests/unit/EglManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700690 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700691 "tests/unit/GraphicsStatsServiceTests.cpp",
Jorim Jaggi10f328c2021-01-19 00:08:02 +0100692 "tests/unit/JankTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700693 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700694 "tests/unit/LinearAllocatorTests.cpp",
695 "tests/unit/MatrixTests.cpp",
John Reck95735052020-12-15 13:39:22 -0500696 "tests/unit/OpBufferTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700697 "tests/unit/PathInterpolatorTests.cpp",
698 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700699 "tests/unit/RenderNodeTests.cpp",
700 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800701 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400702 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700703 "tests/unit/SkiaBehaviorTests.cpp",
704 "tests/unit/SkiaDisplayListTests.cpp",
705 "tests/unit/SkiaPipelineTests.cpp",
706 "tests/unit/SkiaRenderPropertiesTests.cpp",
707 "tests/unit/SkiaCanvasTests.cpp",
Nader Jawadc401b232021-05-21 12:52:05 -0700708 "tests/unit/StretchEffectTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700709 "tests/unit/StringUtilsTests.cpp",
710 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700711 "tests/unit/ThreadBaseTests.cpp",
712 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700713 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800714 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700715 ],
716}
717
718// ------------------------
719// Macro-bench app
720// ------------------------
721
722cc_benchmark {
723 name: "hwuimacro",
724 defaults: ["hwui_test_defaults"],
725
John Reck23462d82019-05-29 16:55:06 -0700726 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800727 shared_libs: [
728 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800729 ],
Colin Crossf6298102017-04-19 15:25:25 -0700730
731 srcs: [
732 "tests/macrobench/TestSceneRunner.cpp",
733 "tests/macrobench/main.cpp",
734 ],
735}
736
737// ------------------------
738// Micro-bench app
739// ---------------------
740
741cc_benchmark {
742 name: "hwuimicro",
743 defaults: ["hwui_test_defaults"],
744
John Reck23462d82019-05-29 16:55:06 -0700745 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800746 shared_libs: [
747 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800748 ],
Colin Crossf6298102017-04-19 15:25:25 -0700749
750 srcs: [
751 "tests/microbench/main.cpp",
John Reckb5eeb182020-12-09 13:45:39 -0500752 "tests/microbench/CanvasOpBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700753 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700754 "tests/microbench/LinearAllocatorBench.cpp",
755 "tests/microbench/PathParserBench.cpp",
756 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700757 ],
758}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800759
760// ----------------------------------------
761// Phony target to build benchmarks for PGO
762// ----------------------------------------
763
764phony {
765 name: "pgo-targets-hwui",
766 required: [
767 "hwuimicro",
768 "hwuimacro",
Tej Singh78f65b62021-03-18 16:19:55 -0700769 ],
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800770}