blob: 2c299fa323152567978e77c791f1fe85de71ab66 [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: [
110 "liblog",
111 "libcutils",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100112 "libutils",
113 "libEGL",
114 "libGLESv1_CM",
115 "libGLESv2",
116 "libGLESv3",
117 "libvulkan",
Alec Mouri22d753f2019-09-05 17:11:45 -0700118 "libnativedisplay",
Derek Sollenbergere78f7c92019-07-31 15:18:47 -0400119 "libnativewindow",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100120 "libprotobuf-cpp-lite",
121 "libft2",
122 "libandroidfw",
123 "libcrypto",
124 "libsync",
125 ],
126 static_libs: [
127 "libEGL_blobCache",
Stan Ilievc9043812020-02-03 16:57:09 -0500128 "libprotoutil",
Tej Singh78f65b62021-03-18 16:19:55 -0700129 "libstatslog_hwui",
130 "libstatspull_lazy",
131 "libstatssocket_lazy",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100132 ],
133 },
134 host: {
135 static_libs: [
136 "libandroidfw",
137 "libutils",
138 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700139 },
140 },
Colin Crossf6298102017-04-19 15:25:25 -0700141}
142
143cc_defaults {
144 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -0700145 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
146}
147
148cc_defaults {
149 name: "hwui_compile_for_perf",
150 // TODO: Non-arm?
151 cflags: [
152 "-fno-omit-frame-pointer",
153 "-marm",
154 "-mapcs",
155 ],
156}
157
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800158// Build libhwui with PGO by default.
159// Location of PGO profile data is defined in build/soong/cc/pgo.go
160// and is separate from hwui.
161// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
162// or set enable_profile_use property to false.
163cc_defaults {
164 name: "hwui_pgo",
165
166 pgo: {
167 instrumentation: true,
168 profile_file: "hwui/hwui.profdata",
169 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800170 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800171 },
172}
173
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800174// Build hwui library with ThinLTO by default.
175cc_defaults {
176 name: "hwui_lto",
177 target: {
178 android: {
179 lto: {
180 thin: true,
181 },
182 },
183 },
184}
185
Colin Crossf6298102017-04-19 15:25:25 -0700186// ------------------------
Alec Mourief37c242020-03-02 21:38:09 +0000187// framework-graphics jar
188// ------------------------
189
Paul Duffin4e006622020-05-31 16:55:13 +0100190java_sdk_library {
Alec Mourief37c242020-03-02 21:38:09 +0000191 name: "framework-graphics",
Paul Duffin4e006622020-05-31 16:55:13 +0100192 defaults: ["framework-module-defaults"],
193 visibility: [
194 "//frameworks/base", // Framework
195 ],
Alec Mourief37c242020-03-02 21:38:09 +0000196
197 srcs: [
198 ":framework-graphics-srcs",
199 ],
200
201 permitted_packages: [
202 "android.graphics",
203 ],
204
Alec Mourief37c242020-03-02 21:38:09 +0000205 // TODO: once framework-graphics is officially part of the
206 // UI-rendering module this line would no longer be
207 // needed.
208 installable: true,
209
Paul Duffin4e006622020-05-31 16:55:13 +0100210 // Disable api_lint that the defaults enable
211 // TODO: enable this
212 api_lint: {
213 enabled: false,
214 },
Anton Hansson96b08ae2020-12-21 16:59:06 +0000215 // TODO: remove this
216 unsafe_ignore_missing_latest_api: true,
Alec Mourief37c242020-03-02 21:38:09 +0000217}
218
219filegroup {
220 name: "framework-graphics-srcs",
221 srcs: [
222 "apex/java/**/*.java",
223 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700224 path: "apex/java",
Alec Mourief37c242020-03-02 21:38:09 +0000225}
226
Alec Mourief37c242020-03-02 21:38:09 +0000227// ------------------------
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400228// APEX
229// ------------------------
230
231cc_library_headers {
232 name: "android_graphics_apex_headers",
233
234 host_supported: true,
235 export_include_dirs: [
236 "apex/include",
237 ],
238 target: {
239 windows: {
240 enabled: true,
241 },
Tej Singh78f65b62021-03-18 16:19:55 -0700242 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400243}
244
245cc_defaults {
246 name: "android_graphics_apex",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400247 cflags: [
248 "-Wno-unused-parameter",
249 "-Wno-non-virtual-dtor",
250 "-Wno-maybe-uninitialized",
251 "-Wno-parentheses",
252 "-Wall",
253 "-Werror",
254 "-Wno-error=deprecated-declarations",
255 "-Wunused",
256 "-Wunreachable-code",
257 ],
258
259 cppflags: ["-Wno-conversion-null"],
260
261 srcs: [
262 "apex/android_matrix.cpp",
263 "apex/android_paint.cpp",
264 "apex/android_region.cpp",
265 ],
266
Tej Singh78f65b62021-03-18 16:19:55 -0700267 header_libs: ["android_graphics_apex_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400268
269 target: {
270 android: {
271 srcs: [ // sources that depend on android only libraries
272 "apex/android_bitmap.cpp",
273 "apex/android_canvas.cpp",
274 "apex/jni_runtime.cpp",
275 "apex/renderthread.cpp",
276 ],
277 },
Derek Sollenbergerc5882c42019-10-25 11:11:32 -0400278 host: {
279 srcs: [
280 "apex/LayoutlibLoader.cpp",
281 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700282 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400283 },
284}
285
286// ------------------------
287// Android Graphics JNI
288// ------------------------
289
290cc_library_headers {
291 name: "android_graphics_jni_headers",
292
293 host_supported: true,
294 export_include_dirs: [
295 "jni",
296 ],
297 target: {
298 windows: {
299 enabled: true,
300 },
Tej Singh78f65b62021-03-18 16:19:55 -0700301 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400302}
303
304cc_defaults {
305 name: "android_graphics_jni",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400306 cflags: [
307 "-Wno-unused-parameter",
308 "-Wno-non-virtual-dtor",
309 "-Wno-maybe-uninitialized",
310 "-Wno-parentheses",
311
312 "-DGL_GLEXT_PROTOTYPES",
313 "-DEGL_EGLEXT_PROTOTYPES",
314
315 "-DU_USING_ICU_NAMESPACE=0",
316
317 "-Wall",
318 "-Werror",
319 "-Wno-error=deprecated-declarations",
320 "-Wunused",
321 "-Wunreachable-code",
322 ],
323
324 cppflags: ["-Wno-conversion-null"],
325
326 srcs: [
327 "jni/android_graphics_animation_NativeInterpolatorFactory.cpp",
328 "jni/android_graphics_animation_RenderNodeAnimator.cpp",
329 "jni/android_graphics_Canvas.cpp",
330 "jni/android_graphics_ColorSpace.cpp",
331 "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp",
332 "jni/android_graphics_drawable_VectorDrawable.cpp",
333 "jni/android_graphics_HardwareRendererObserver.cpp",
334 "jni/android_graphics_Matrix.cpp",
335 "jni/android_graphics_Picture.cpp",
336 "jni/android_graphics_DisplayListCanvas.cpp",
337 "jni/android_graphics_RenderNode.cpp",
338 "jni/android_nio_utils.cpp",
339 "jni/android_util_PathParser.cpp",
340
341 "jni/Bitmap.cpp",
342 "jni/BitmapFactory.cpp",
343 "jni/ByteBufferStreamAdaptor.cpp",
344 "jni/Camera.cpp",
345 "jni/CanvasProperty.cpp",
346 "jni/ColorFilter.cpp",
347 "jni/CreateJavaOutputStreamAdaptor.cpp",
348 "jni/FontFamily.cpp",
349 "jni/FontUtils.cpp",
350 "jni/Graphics.cpp",
351 "jni/ImageDecoder.cpp",
352 "jni/Interpolator.cpp",
353 "jni/MaskFilter.cpp",
354 "jni/NinePatch.cpp",
355 "jni/NinePatchPeeker.cpp",
356 "jni/Paint.cpp",
357 "jni/PaintFilter.cpp",
358 "jni/Path.cpp",
359 "jni/PathEffect.cpp",
360 "jni/PathMeasure.cpp",
361 "jni/Picture.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400362 "jni/Shader.cpp",
Nader Jawad390d6e82020-09-24 21:35:03 -0700363 "jni/RenderEffect.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400364 "jni/Typeface.cpp",
365 "jni/Utils.cpp",
366 "jni/YuvToJpegEncoder.cpp",
367 "jni/fonts/Font.cpp",
368 "jni/fonts/FontFamily.cpp",
369 "jni/text/LineBreaker.cpp",
370 "jni/text/MeasuredText.cpp",
Seigo Nonakaf3a19152020-09-14 15:29:42 -0700371 "jni/text/TextShaper.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400372 ],
373
Tej Singh78f65b62021-03-18 16:19:55 -0700374 header_libs: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400375
376 include_dirs: [
377 "external/skia/include/private",
378 "external/skia/src/codec",
379 "external/skia/src/core",
380 "external/skia/src/effects",
381 "external/skia/src/image",
382 "external/skia/src/images",
383 ],
384
385 shared_libs: [
386 "libbase",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400387 "libcutils",
388 "libharfbuzz_ng",
389 "liblog",
390 "libminikin",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400391 "libz",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400392 "libjpeg",
393 ],
394
Tej Singh78f65b62021-03-18 16:19:55 -0700395 static_libs: [
396 "libnativehelper_lazy",
397 "libziparchive_for_incfs",
398 ],
Orion Hodson33cbf8b2021-02-08 16:17:07 +0000399
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400400 target: {
401 android: {
402 srcs: [ // sources that depend on android only libraries
403 "jni/AnimatedImageDrawable.cpp",
404 "jni/android_graphics_TextureLayer.cpp",
405 "jni/android_graphics_HardwareRenderer.cpp",
406 "jni/BitmapRegionDecoder.cpp",
407 "jni/GIFMovie.cpp",
408 "jni/GraphicsStatsService.cpp",
409 "jni/Movie.cpp",
410 "jni/MovieImpl.cpp",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500411 "jni/Region.cpp", // requires libbinder_ndk
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400412 "jni/pdf/PdfDocument.cpp",
413 "jni/pdf/PdfEditor.cpp",
414 "jni/pdf/PdfRenderer.cpp",
415 "jni/pdf/PdfUtils.cpp",
416 ],
417 shared_libs: [
418 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500419 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500420 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400421 "libmediandk",
422 "libnativedisplay",
423 "libnativewindow",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400424 "libpdfium",
425 ],
426 static_libs: [
427 "libgif",
Tej Singh78f65b62021-03-18 16:19:55 -0700428 "libstatslog_hwui",
429 "libstatspull_lazy",
430 "libstatssocket_lazy",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400431 ],
432 },
433 host: {
434 cflags: [
435 "-Wno-unused-const-variable",
436 "-Wno-unused-function",
437 ],
438 static_libs: [
439 "libandroidfw",
440 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700441 },
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400442 },
443}
444
Tej Singh78f65b62021-03-18 16:19:55 -0700445cc_library_static {
446 name: "libstatslog_hwui",
447 generated_sources: ["statslog_hwui.cpp"],
448 generated_headers: ["statslog_hwui.h"],
449 export_generated_headers: ["statslog_hwui.h"],
450 static_libs: [
451 "libstatssocket_lazy",
452 "libstatspull_lazy",
453 ],
454}
455
456genrule {
457 name: "statslog_hwui.h",
458 tools: ["stats-log-api-gen"],
459 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_hwui.h --module hwui" +
460 " --namespace android,uirenderer,stats",
461 out: [
462 "statslog_hwui.h",
463 ],
464}
465
466genrule {
467 name: "statslog_hwui.cpp",
468 tools: ["stats-log-api-gen"],
469 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_hwui.cpp --module hwui" +
470 " --namespace android,uirenderer,stats --importHeader statslog_hwui.h",
471 out: [
472 "statslog_hwui.cpp",
473 ],
474}
475
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400476// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700477// library
478// ------------------------
479
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400480cc_library_headers {
481 name: "libhwui_internal_headers",
482
483 host_supported: true,
484 export_include_dirs: [
485 ".",
486 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700487 header_libs: ["android_graphics_jni_headers"],
488 export_header_lib_headers: ["android_graphics_jni_headers"],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400489}
490
Colin Crossf6298102017-04-19 15:25:25 -0700491cc_defaults {
492 name: "libhwui_defaults",
493 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400494
495 whole_static_libs: ["libskia"],
496
Colin Crossf6298102017-04-19 15:25:25 -0700497 srcs: [
John Reckdc95f102020-11-16 12:35:02 -0500498 "canvas/CanvasFrontend.cpp",
John Reck013127b2020-10-29 20:53:51 -0400499 "canvas/CanvasOpBuffer.cpp",
500 "canvas/CanvasOpRasterizer.cpp",
John Reck5cb290b2021-02-01 13:47:31 -0500501 "effects/StretchEffect.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700502 "pipeline/skia/HolePunch.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100503 "pipeline/skia/SkiaDisplayList.cpp",
504 "pipeline/skia/SkiaRecordingCanvas.cpp",
Nader Jawad197743f2021-04-19 19:45:13 -0700505 "pipeline/skia/StretchMask.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100506 "pipeline/skia/RenderNodeDrawable.cpp",
507 "pipeline/skia/ReorderBarrierDrawables.cpp",
Nader Jawad2dc632a2021-03-29 18:51:29 -0700508 "pipeline/skia/TransformCanvas.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100509 "renderthread/Frame.cpp",
510 "renderthread/RenderTask.cpp",
511 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500512 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700513 "hwui/Bitmap.cpp",
Mike Reed0f9dce72021-02-12 21:20:33 -0500514 "hwui/BlurDrawLooper.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700515 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500516 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700517 "hwui/MinikinSkia.cpp",
518 "hwui/MinikinUtils.cpp",
519 "hwui/PaintImpl.cpp",
520 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700521 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100522 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700523 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700524 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100525 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700526 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100527 "AnimatorManager.cpp",
528 "CanvasTransform.cpp",
529 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700530 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100531 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700532 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700533 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700534 "Properties.cpp",
535 "PropertyValuesAnimatorSet.cpp",
536 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100537 "RecordingCanvas.cpp",
538 "RenderNode.cpp",
539 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100540 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700541 "SkiaCanvas.cpp",
Mike Reed74065272021-04-12 09:52:07 -0400542 "SkiaInterpolator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700543 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700544 ],
545
Kweku Adams228b6d22018-04-12 13:09:04 -0700546 proto: {
547 export_proto_headers: true,
548 },
549
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100550 target: {
551 android: {
Tej Singh78f65b62021-03-18 16:19:55 -0700552 header_libs: ["libandroid_headers_private"],
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",
573 "renderthread/VulkanManager.cpp",
574 "renderthread/VulkanSurface.cpp",
575 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100576 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100577 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100578 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100579 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800580 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100581 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400582 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100583 "DeferredLayerUpdater.cpp",
584 "DeviceInfo.cpp",
585 "FrameInfo.cpp",
586 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100587 "HardwareBitmapUploader.cpp",
588 "HWUIProperties.sysprop",
589 "JankTracker.cpp",
590 "Layer.cpp",
591 "LayerUpdateQueue.cpp",
592 "ProfileData.cpp",
593 "ProfileDataContainer.cpp",
594 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100595 "TreeInfo.cpp",
596 "WebViewFunctorManager.cpp",
597 "protos/graphicsstats.proto",
598 ],
599
600 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
601 cflags: ["-Wno-implicit-fallthrough"],
602 },
603 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100604 srcs: [
605 "utils/HostColorSpace.cpp",
606 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100607 export_static_lib_headers: [
608 "libarect",
609 ],
Tej Singh78f65b62021-03-18 16:19:55 -0700610 },
611 },
Colin Crossf6298102017-04-19 15:25:25 -0700612}
613
614cc_library {
615 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100616 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700617 defaults: [
618 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400619 "android_graphics_apex",
620 "android_graphics_jni",
Collin Fijalkovichc10428f2021-04-23 14:09:16 -0700621 "linker_hugepage_aligned",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700622 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400623 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400624 target: {
625 android: {
626 version_script: "libhwui.map.txt",
Tej Singh78f65b62021-03-18 16:19:55 -0700627 },
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400628 },
Colin Crossf6298102017-04-19 15:25:25 -0700629}
630
Colin Crossf6298102017-04-19 15:25:25 -0700631cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700632 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700633 defaults: [
634 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700635 ],
Colin Crossf6298102017-04-19 15:25:25 -0700636}
637
638cc_defaults {
639 name: "hwui_test_defaults",
640 defaults: ["hwui_defaults"],
641 test_suites: ["device-tests"],
Jorim Jaggi71db8892021-02-03 23:19:29 +0100642 header_libs: ["libandroid_headers_private"],
Alec Mouri680414e2020-01-28 09:22:33 -0800643 target: {
644 android: {
645 shared_libs: [
Tej Singh78f65b62021-03-18 16:19:55 -0700646 "libgui",
647 "libui",
648 ],
649 },
Alec Mouri680414e2020-01-28 09:22:33 -0800650 },
Colin Crossf6298102017-04-19 15:25:25 -0700651 srcs: [
652 "tests/common/scenes/*.cpp",
653 "tests/common/LeakChecker.cpp",
654 "tests/common/TestListViewSceneBase.cpp",
655 "tests/common/TestContext.cpp",
656 "tests/common/TestScene.cpp",
657 "tests/common/TestUtils.cpp",
658 ],
659}
660
661// ------------------------
662// unit tests
663// ------------------------
664
665cc_test {
666 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400667 defaults: [
668 "hwui_test_defaults",
669 "android_graphics_apex",
670 "android_graphics_jni",
671 ],
Colin Crossf6298102017-04-19 15:25:25 -0700672
673 static_libs: [
674 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700675 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700676 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800677 shared_libs: [
678 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800679 ],
Colin Crossf6298102017-04-19 15:25:25 -0700680 srcs: [
681 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400682 "tests/unit/ABitmapTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400683 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700684 "tests/unit/CanvasContextTests.cpp",
John Reck013127b2020-10-29 20:53:51 -0400685 "tests/unit/CanvasOpTests.cpp",
John Reckdc95f102020-11-16 12:35:02 -0500686 "tests/unit/CanvasFrontendTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700687 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700688 "tests/unit/DamageAccumulatorTests.cpp",
689 "tests/unit/DeferredLayerUpdaterTests.cpp",
John Reck064650b2021-01-19 21:29:24 -0500690 "tests/unit/EglManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700691 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700692 "tests/unit/GraphicsStatsServiceTests.cpp",
Jorim Jaggi10f328c2021-01-19 00:08:02 +0100693 "tests/unit/JankTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700694 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700695 "tests/unit/LinearAllocatorTests.cpp",
696 "tests/unit/MatrixTests.cpp",
John Reck95735052020-12-15 13:39:22 -0500697 "tests/unit/OpBufferTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700698 "tests/unit/PathInterpolatorTests.cpp",
699 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700700 "tests/unit/RenderNodeTests.cpp",
701 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800702 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400703 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700704 "tests/unit/SkiaBehaviorTests.cpp",
705 "tests/unit/SkiaDisplayListTests.cpp",
706 "tests/unit/SkiaPipelineTests.cpp",
707 "tests/unit/SkiaRenderPropertiesTests.cpp",
708 "tests/unit/SkiaCanvasTests.cpp",
Nader Jawadc401b232021-05-21 12:52:05 -0700709 "tests/unit/StretchEffectTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700710 "tests/unit/StringUtilsTests.cpp",
711 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700712 "tests/unit/ThreadBaseTests.cpp",
713 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700714 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800715 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700716 ],
717}
718
719// ------------------------
720// Macro-bench app
721// ------------------------
722
723cc_benchmark {
724 name: "hwuimacro",
725 defaults: ["hwui_test_defaults"],
726
John Reck23462d82019-05-29 16:55:06 -0700727 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800728 shared_libs: [
729 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800730 ],
Colin Crossf6298102017-04-19 15:25:25 -0700731
732 srcs: [
733 "tests/macrobench/TestSceneRunner.cpp",
734 "tests/macrobench/main.cpp",
735 ],
736}
737
738// ------------------------
739// Micro-bench app
740// ---------------------
741
742cc_benchmark {
743 name: "hwuimicro",
744 defaults: ["hwui_test_defaults"],
745
John Reck23462d82019-05-29 16:55:06 -0700746 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800747 shared_libs: [
748 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800749 ],
Colin Crossf6298102017-04-19 15:25:25 -0700750
751 srcs: [
752 "tests/microbench/main.cpp",
John Reckb5eeb182020-12-09 13:45:39 -0500753 "tests/microbench/CanvasOpBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700754 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700755 "tests/microbench/LinearAllocatorBench.cpp",
756 "tests/microbench/PathParserBench.cpp",
757 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700758 ],
759}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800760
761// ----------------------------------------
762// Phony target to build benchmarks for PGO
763// ----------------------------------------
764
765phony {
766 name: "pgo-targets-hwui",
767 required: [
768 "hwuimicro",
769 "hwuimacro",
Tej Singh78f65b62021-03-18 16:19:55 -0700770 ],
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800771}