blob: ed02f03891bf152571554cf70b396e9b2523a4dc [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",
Siarhei Vishniakou07d35cb2021-07-03 02:22:12 +000050 "-Wthread-safety",
Colin Crossf6298102017-04-19 15:25:25 -070051 "-Wno-unused-parameter",
52 "-Wunreachable-code",
53 "-Werror",
54 "-fvisibility=hidden",
55
56 // GCC false-positives on this warning, and since we -Werror that's
57 // a problem
58 "-Wno-free-nonheap-object",
Colin Crossf6298102017-04-19 15:25:25 -070059 ],
60
61 include_dirs: [
62 "external/skia/include/private",
63 "external/skia/src/core",
Colin Crossf6298102017-04-19 15:25:25 -070064 ],
65
66 product_variables: {
John Reck27294182018-07-11 11:21:09 -070067 eng: {
68 lto: {
69 never: true,
70 },
71 },
Colin Crossf6298102017-04-19 15:25:25 -070072 },
Fedor Kudasov182cbf92019-06-05 10:30:20 +010073
74 target: {
75 android: {
76 include_dirs: [
77 "external/skia/src/effects",
78 "external/skia/src/image",
79 "external/skia/src/utils",
80 "external/skia/src/gpu",
81 "external/skia/src/shaders",
82 ],
83 },
84 host: {
85 include_dirs: [
86 "external/vulkan-headers/include",
87 ],
88 cflags: [
89 "-Wno-unused-variable",
90 ],
Tej Singh78f65b62021-03-18 16:19:55 -070091 },
92 },
Colin Crossf6298102017-04-19 15:25:25 -070093}
94
95cc_defaults {
96 name: "hwui_static_deps",
97 shared_libs: [
Jerome Gaillarda02a12d2019-05-28 18:07:56 +010098 "libbase",
Colin Crossf6298102017-04-19 15:25:25 -070099 "libharfbuzz_ng",
Colin Crossf6298102017-04-19 15:25:25 -0700100 "libminikin",
Colin Crossf6298102017-04-19 15:25:25 -0700101 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100102
Alec Mouri45238012020-01-29 11:04:40 -0800103 static_libs: [
104 "libui-types",
105 ],
106
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100107 target: {
108 android: {
109 shared_libs: [
Alec Mourid0001fe2021-11-22 10:09:22 -0800110 "android.hardware.graphics.common-V3-ndk",
111 "android.hardware.graphics.common@1.2",
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
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800162// Build libhwui with PGO by default.
163// Location of PGO profile data is defined in build/soong/cc/pgo.go
164// and is separate from hwui.
165// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
166// or set enable_profile_use property to false.
167cc_defaults {
168 name: "hwui_pgo",
169
170 pgo: {
171 instrumentation: true,
172 profile_file: "hwui/hwui.profdata",
173 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800174 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800175 },
176}
177
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800178// Build hwui library with ThinLTO by default.
179cc_defaults {
180 name: "hwui_lto",
181 target: {
182 android: {
183 lto: {
184 thin: true,
185 },
186 },
187 },
188}
189
Colin Crossf6298102017-04-19 15:25:25 -0700190// ------------------------
Alec Mourief37c242020-03-02 21:38:09 +0000191// framework-graphics jar
192// ------------------------
193
Paul Duffin4e006622020-05-31 16:55:13 +0100194java_sdk_library {
Alec Mourief37c242020-03-02 21:38:09 +0000195 name: "framework-graphics",
Paul Duffin4e006622020-05-31 16:55:13 +0100196 defaults: ["framework-module-defaults"],
197 visibility: [
198 "//frameworks/base", // Framework
199 ],
Alec Mourief37c242020-03-02 21:38:09 +0000200
201 srcs: [
202 ":framework-graphics-srcs",
203 ],
204
205 permitted_packages: [
206 "android.graphics",
207 ],
208
Alec Mourief37c242020-03-02 21:38:09 +0000209 // TODO: once framework-graphics is officially part of the
210 // UI-rendering module this line would no longer be
211 // needed.
212 installable: true,
213
Paul Duffin4e006622020-05-31 16:55:13 +0100214 // Disable api_lint that the defaults enable
215 // TODO: enable this
216 api_lint: {
217 enabled: false,
218 },
Anton Hansson96b08ae2020-12-21 16:59:06 +0000219 // TODO: remove this
220 unsafe_ignore_missing_latest_api: true,
Alec Mourief37c242020-03-02 21:38:09 +0000221}
222
223filegroup {
224 name: "framework-graphics-srcs",
225 srcs: [
226 "apex/java/**/*.java",
227 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700228 path: "apex/java",
Alec Mourief37c242020-03-02 21:38:09 +0000229}
230
Alec Mourief37c242020-03-02 21:38:09 +0000231// ------------------------
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400232// APEX
233// ------------------------
234
235cc_library_headers {
236 name: "android_graphics_apex_headers",
237
238 host_supported: true,
239 export_include_dirs: [
240 "apex/include",
241 ],
242 target: {
243 windows: {
244 enabled: true,
245 },
Tej Singh78f65b62021-03-18 16:19:55 -0700246 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400247}
248
249cc_defaults {
250 name: "android_graphics_apex",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400251 cflags: [
252 "-Wno-unused-parameter",
253 "-Wno-non-virtual-dtor",
254 "-Wno-maybe-uninitialized",
255 "-Wno-parentheses",
256 "-Wall",
257 "-Werror",
258 "-Wno-error=deprecated-declarations",
259 "-Wunused",
260 "-Wunreachable-code",
261 ],
262
263 cppflags: ["-Wno-conversion-null"],
264
265 srcs: [
266 "apex/android_matrix.cpp",
267 "apex/android_paint.cpp",
268 "apex/android_region.cpp",
269 ],
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: {
Tej Singh78f65b62021-03-18 16:19:55 -0700555 header_libs: ["libandroid_headers_private"],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100556
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100557 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000558 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500559 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100560 "pipeline/skia/GLFunctorDrawable.cpp",
561 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100562 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100563 "pipeline/skia/SkiaMemoryTracer.cpp",
564 "pipeline/skia/SkiaOpenGLPipeline.cpp",
565 "pipeline/skia/SkiaPipeline.cpp",
566 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100567 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100568 "pipeline/skia/VkFunctorDrawable.cpp",
569 "pipeline/skia/VkInteropFunctorDrawable.cpp",
570 "renderstate/RenderState.cpp",
571 "renderthread/CacheManager.cpp",
572 "renderthread/CanvasContext.cpp",
573 "renderthread/DrawFrameTask.cpp",
574 "renderthread/EglManager.cpp",
575 "renderthread/ReliableSurface.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700576 "renderthread/RenderEffectCapabilityQuery.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100577 "renderthread/VulkanManager.cpp",
578 "renderthread/VulkanSurface.cpp",
579 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100580 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100581 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100582 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100583 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800584 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100585 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400586 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100587 "DeferredLayerUpdater.cpp",
588 "DeviceInfo.cpp",
589 "FrameInfo.cpp",
590 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100591 "HardwareBitmapUploader.cpp",
592 "HWUIProperties.sysprop",
593 "JankTracker.cpp",
Pablo Gamito88660d72021-08-09 14:37:56 +0000594 "FrameMetricsReporter.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100595 "Layer.cpp",
596 "LayerUpdateQueue.cpp",
597 "ProfileData.cpp",
598 "ProfileDataContainer.cpp",
599 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100600 "TreeInfo.cpp",
601 "WebViewFunctorManager.cpp",
602 "protos/graphicsstats.proto",
603 ],
604
605 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
606 cflags: ["-Wno-implicit-fallthrough"],
607 },
608 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100609 srcs: [
610 "utils/HostColorSpace.cpp",
611 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100612 export_static_lib_headers: [
613 "libarect",
614 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700615 },
616 },
Colin Crossf6298102017-04-19 15:25:25 -0700617}
618
619cc_library {
620 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100621 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700622 defaults: [
623 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400624 "android_graphics_apex",
625 "android_graphics_jni",
Collin Fijalkovichc10428f2021-04-23 14:09:16 -0700626 "linker_hugepage_aligned",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700627 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400628 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400629 target: {
630 android: {
631 version_script: "libhwui.map.txt",
Tej Singh78f65b62021-03-18 16:19:55 -0700632 },
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400633 },
Colin Crossf6298102017-04-19 15:25:25 -0700634}
635
Colin Crossf6298102017-04-19 15:25:25 -0700636cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700637 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700638 defaults: [
639 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700640 ],
Colin Crossf6298102017-04-19 15:25:25 -0700641}
642
643cc_defaults {
644 name: "hwui_test_defaults",
645 defaults: ["hwui_defaults"],
646 test_suites: ["device-tests"],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100647 header_libs: ["libandroid_headers_private"],
Alec Mouri680414e2020-01-28 09:22:33 -0800648 target: {
649 android: {
650 shared_libs: [
Tej Singh78f65b62021-03-18 16:19:55 -0700651 "libgui",
652 "libui",
653 ],
654 },
Alec Mouri680414e2020-01-28 09:22:33 -0800655 },
Colin Crossf6298102017-04-19 15:25:25 -0700656 srcs: [
657 "tests/common/scenes/*.cpp",
658 "tests/common/LeakChecker.cpp",
659 "tests/common/TestListViewSceneBase.cpp",
660 "tests/common/TestContext.cpp",
661 "tests/common/TestScene.cpp",
662 "tests/common/TestUtils.cpp",
663 ],
664}
665
666// ------------------------
667// unit tests
668// ------------------------
669
670cc_test {
671 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400672 defaults: [
673 "hwui_test_defaults",
674 "android_graphics_apex",
675 "android_graphics_jni",
676 ],
Colin Crossf6298102017-04-19 15:25:25 -0700677
678 static_libs: [
679 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700680 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700681 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800682 shared_libs: [
683 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800684 ],
Colin Crossf6298102017-04-19 15:25:25 -0700685 srcs: [
686 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400687 "tests/unit/ABitmapTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400688 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700689 "tests/unit/CanvasContextTests.cpp",
John Reck013127b2020-10-29 20:53:51 -0400690 "tests/unit/CanvasOpTests.cpp",
John Reckdc95f102020-11-16 12:35:02 -0500691 "tests/unit/CanvasFrontendTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700692 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700693 "tests/unit/DamageAccumulatorTests.cpp",
694 "tests/unit/DeferredLayerUpdaterTests.cpp",
John Reck064650b2021-01-19 21:29:24 -0500695 "tests/unit/EglManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700696 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700697 "tests/unit/GraphicsStatsServiceTests.cpp",
Jorim Jaggi10f328c2021-01-19 00:08:02 +0100698 "tests/unit/JankTrackerTests.cpp",
Pablo Gamitodfb85a22021-08-26 01:19:05 +0200699 "tests/unit/FrameMetricsReporterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700700 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700701 "tests/unit/LinearAllocatorTests.cpp",
702 "tests/unit/MatrixTests.cpp",
John Reck95735052020-12-15 13:39:22 -0500703 "tests/unit/OpBufferTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700704 "tests/unit/PathInterpolatorTests.cpp",
Nader Jawad086645d2021-09-24 13:42:47 -0700705 "tests/unit/RenderEffectCapabilityQueryTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700706 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700707 "tests/unit/RenderNodeTests.cpp",
708 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800709 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400710 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700711 "tests/unit/SkiaBehaviorTests.cpp",
712 "tests/unit/SkiaDisplayListTests.cpp",
713 "tests/unit/SkiaPipelineTests.cpp",
714 "tests/unit/SkiaRenderPropertiesTests.cpp",
715 "tests/unit/SkiaCanvasTests.cpp",
Nader Jawadc401b232021-05-21 12:52:05 -0700716 "tests/unit/StretchEffectTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700717 "tests/unit/StringUtilsTests.cpp",
718 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700719 "tests/unit/ThreadBaseTests.cpp",
720 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700721 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800722 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700723 ],
724}
725
726// ------------------------
727// Macro-bench app
728// ------------------------
729
730cc_benchmark {
731 name: "hwuimacro",
732 defaults: ["hwui_test_defaults"],
733
John Reck23462d82019-05-29 16:55:06 -0700734 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800735 shared_libs: [
736 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800737 ],
Colin Crossf6298102017-04-19 15:25:25 -0700738
739 srcs: [
740 "tests/macrobench/TestSceneRunner.cpp",
741 "tests/macrobench/main.cpp",
742 ],
743}
744
745// ------------------------
746// Micro-bench app
747// ---------------------
748
749cc_benchmark {
750 name: "hwuimicro",
751 defaults: ["hwui_test_defaults"],
752
John Reck23462d82019-05-29 16:55:06 -0700753 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800754 shared_libs: [
755 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800756 ],
Colin Crossf6298102017-04-19 15:25:25 -0700757
758 srcs: [
759 "tests/microbench/main.cpp",
John Reckb5eeb182020-12-09 13:45:39 -0500760 "tests/microbench/CanvasOpBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700761 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700762 "tests/microbench/LinearAllocatorBench.cpp",
763 "tests/microbench/PathParserBench.cpp",
764 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700765 ],
766}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800767
768// ----------------------------------------
769// Phony target to build benchmarks for PGO
770// ----------------------------------------
771
772phony {
773 name: "pgo-targets-hwui",
774 required: [
775 "hwuimicro",
776 "hwuimacro",
Tej Singh78f65b62021-03-18 16:19:55 -0700777 ],
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800778}