blob: de96f81cd5a63a11749c51002c315c555379898c [file] [log] [blame]
Colin Crossf6298102017-04-19 15:25:25 -07001cc_defaults {
2 name: "hwui_defaults",
3 defaults: [
4 "hwui_static_deps",
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -08005 "skia_deps",
Colin Crossf6298102017-04-19 15:25:25 -07006 //"hwui_bugreport_font_cache_usage",
7 //"hwui_compile_for_perf",
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -08008 "hwui_pgo",
Pirama Arumuga Nainarb7913e12018-03-09 00:03:57 +00009 "hwui_lto",
Colin Crossf6298102017-04-19 15:25:25 -070010 ],
11
John Reck283bb462018-12-13 16:40:14 -080012 cpp_std: "experimental",
13
Colin Crossf6298102017-04-19 15:25:25 -070014 cflags: [
15 "-DEGL_EGLEXT_PROTOTYPES",
16 "-DGL_GLEXT_PROTOTYPES",
17 "-DATRACE_TAG=ATRACE_TAG_VIEW",
18 "-DLOG_TAG=\"OpenGLRenderer\"",
19 "-Wall",
20 "-Wno-unused-parameter",
21 "-Wunreachable-code",
22 "-Werror",
23 "-fvisibility=hidden",
24
25 // GCC false-positives on this warning, and since we -Werror that's
26 // a problem
27 "-Wno-free-nonheap-object",
Colin Crossf6298102017-04-19 15:25:25 -070028 ],
29
30 include_dirs: [
31 "external/skia/include/private",
32 "external/skia/src/core",
Colin Crossf6298102017-04-19 15:25:25 -070033 ],
34
35 product_variables: {
John Reck27294182018-07-11 11:21:09 -070036 eng: {
37 lto: {
38 never: true,
39 },
40 },
Colin Crossf6298102017-04-19 15:25:25 -070041 },
Fedor Kudasov182cbf92019-06-05 10:30:20 +010042
43 target: {
44 android: {
45 include_dirs: [
46 "external/skia/src/effects",
47 "external/skia/src/image",
48 "external/skia/src/utils",
49 "external/skia/src/gpu",
50 "external/skia/src/shaders",
51 ],
52 },
53 host: {
54 include_dirs: [
55 "external/vulkan-headers/include",
56 ],
57 cflags: [
58 "-Wno-unused-variable",
59 ],
60 }
61 }
Colin Crossf6298102017-04-19 15:25:25 -070062}
63
64cc_defaults {
65 name: "hwui_static_deps",
66 shared_libs: [
Jerome Gaillarda02a12d2019-05-28 18:07:56 +010067 "libbase",
Colin Crossf6298102017-04-19 15:25:25 -070068 "libharfbuzz_ng",
Colin Crossf6298102017-04-19 15:25:25 -070069 "libminikin",
Colin Crossf6298102017-04-19 15:25:25 -070070 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +010071
Alec Mouri45238012020-01-29 11:04:40 -080072 static_libs: [
73 "libui-types",
74 ],
75
Fedor Kudasov182cbf92019-06-05 10:30:20 +010076 target: {
77 android: {
78 shared_libs: [
79 "liblog",
80 "libcutils",
81 "libstatslog",
82 "libutils",
83 "libEGL",
84 "libGLESv1_CM",
85 "libGLESv2",
86 "libGLESv3",
87 "libvulkan",
Alec Mouri22d753f2019-09-05 17:11:45 -070088 "libnativedisplay",
Derek Sollenbergere78f7c92019-07-31 15:18:47 -040089 "libnativewindow",
Fedor Kudasov182cbf92019-06-05 10:30:20 +010090 "libprotobuf-cpp-lite",
91 "libft2",
92 "libandroidfw",
93 "libcrypto",
94 "libsync",
Stan Ilievc9043812020-02-03 16:57:09 -050095 "libstatspull",
96 "libstatssocket",
Fedor Kudasov182cbf92019-06-05 10:30:20 +010097 ],
98 static_libs: [
99 "libEGL_blobCache",
Stan Ilievc9043812020-02-03 16:57:09 -0500100 "libprotoutil",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100101 ],
102 },
103 host: {
104 static_libs: [
105 "libandroidfw",
106 "libutils",
107 ],
108 }
109 }
Colin Crossf6298102017-04-19 15:25:25 -0700110}
111
112cc_defaults {
113 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -0700114 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
115}
116
117cc_defaults {
118 name: "hwui_compile_for_perf",
119 // TODO: Non-arm?
120 cflags: [
121 "-fno-omit-frame-pointer",
122 "-marm",
123 "-mapcs",
124 ],
125}
126
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800127// Build libhwui with PGO by default.
128// Location of PGO profile data is defined in build/soong/cc/pgo.go
129// and is separate from hwui.
130// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
131// or set enable_profile_use property to false.
132cc_defaults {
133 name: "hwui_pgo",
134
135 pgo: {
136 instrumentation: true,
137 profile_file: "hwui/hwui.profdata",
138 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800139 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800140 },
141}
142
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800143// Build hwui library with ThinLTO by default.
144cc_defaults {
145 name: "hwui_lto",
146 target: {
147 android: {
148 lto: {
149 thin: true,
150 },
151 },
152 },
153}
154
Colin Crossf6298102017-04-19 15:25:25 -0700155// ------------------------
Alec Mourief37c242020-03-02 21:38:09 +0000156// framework-graphics jar
157// ------------------------
158
159java_library {
160 name: "framework-graphics",
161
162 srcs: [
163 ":framework-graphics-srcs",
164 ],
165
166 permitted_packages: [
167 "android.graphics",
168 ],
169
170 sdk_version: "module_current",
171
172 // TODO: once framework-graphics is officially part of the
173 // UI-rendering module this line would no longer be
174 // needed.
175 installable: true,
176
177 // Enable detection of apis used by this module
178 plugins: ["java_api_finder",],
179}
180
181filegroup {
182 name: "framework-graphics-srcs",
183 srcs: [
184 "apex/java/**/*.java",
185 ],
186 path: "apex/java"
187}
188
189stubs_defaults {
190 name: "framework-graphics-stubs-srcs-defaults",
191 srcs: [ ":framework-graphics-srcs"],
192}
193
194droidstubs {
195 name: "framework-graphics-api-module_libs_api",
196 defaults: [
197 "framework-graphics-stubs-srcs-defaults",
198 "framework-module-api-defaults-module_libs_api",
199 ],
Anton Hanssonb22c6732020-05-04 20:20:43 +0100200 check_api: {
201 // Disable api_lint that the defaults enable
202 // TODO: enable this
203 api_lint: {
204 enabled: false,
205 },
206 },
Alec Mourief37c242020-03-02 21:38:09 +0000207}
208
209droidstubs {
210 name: "framework-graphics-stubs-srcs-module_libs_api",
211 defaults: [
212 "framework-graphics-stubs-srcs-defaults",
213 "framework-module-stubs-defaults-module_libs_api",
214 ],
215}
216
217droidstubs {
218 name: "framework-graphics-stubs-srcs-publicapi",
219 defaults: [
220 "framework-graphics-stubs-srcs-defaults",
221 "framework-module-stubs-defaults-publicapi",
222 ],
Anton Hanssonb22c6732020-05-04 20:20:43 +0100223 check_api: {
224 // Disable api_lint that the defaults enable
225 // TODO: enable this
226 api_lint: {
227 enabled: false,
228 },
229 },
Alec Mourief37c242020-03-02 21:38:09 +0000230}
231
232droidstubs {
233 name: "framework-graphics-stubs-srcs-systemapi",
234 defaults: [
235 "framework-graphics-stubs-srcs-defaults",
236 "framework-module-stubs-defaults-systemapi",
237 ],
Anton Hanssonb22c6732020-05-04 20:20:43 +0100238 check_api: {
239 // Disable api_lint that the defaults enable
240 // TODO: enable this
241 api_lint: {
242 enabled: false,
243 },
244 },
Alec Mourief37c242020-03-02 21:38:09 +0000245}
246
247java_library {
248 name: "framework-graphics-stubs-module_libs_api",
249 srcs: [":framework-graphics-stubs-srcs-module_libs_api"],
Anton Hanssonf4289752020-05-11 17:15:46 +0100250 defaults: ["framework-module-stubs-lib-defaults-module_libs_api"],
Alec Mourief37c242020-03-02 21:38:09 +0000251 visibility: [
252 "//frameworks/base", // Framework
253 "//frameworks/base/libs/hwui", // UI-rendering module
254 ],
255}
256
257java_library {
258 name: "framework-graphics-stubs-publicapi",
259 srcs: [":framework-graphics-stubs-srcs-publicapi"],
Anton Hanssonf4289752020-05-11 17:15:46 +0100260 defaults: ["framework-module-stubs-lib-defaults-publicapi"],
Alec Mourief37c242020-03-02 21:38:09 +0000261 visibility: [
262 "//frameworks/base", // Framework
263 "//frameworks/base/libs/hwui", // UI-rendering module
264 ],
265}
266
267java_library {
268 name: "framework-graphics-stubs-systemapi",
269 srcs: [":framework-graphics-stubs-srcs-systemapi"],
Anton Hanssonf4289752020-05-11 17:15:46 +0100270 defaults: ["framework-module-stubs-lib-defaults-systemapi"],
Alec Mourief37c242020-03-02 21:38:09 +0000271 visibility: [
272 "//frameworks/base", // Framework
273 "//frameworks/base/libs/hwui", // UI-rendering module
274 ],
275}
276
277// ------------------------
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400278// APEX
279// ------------------------
280
281cc_library_headers {
282 name: "android_graphics_apex_headers",
283
284 host_supported: true,
285 export_include_dirs: [
286 "apex/include",
287 ],
288 target: {
289 windows: {
290 enabled: true,
291 },
292 }
293}
294
295cc_defaults {
296 name: "android_graphics_apex",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400297 cflags: [
298 "-Wno-unused-parameter",
299 "-Wno-non-virtual-dtor",
300 "-Wno-maybe-uninitialized",
301 "-Wno-parentheses",
302 "-Wall",
303 "-Werror",
304 "-Wno-error=deprecated-declarations",
305 "-Wunused",
306 "-Wunreachable-code",
307 ],
308
309 cppflags: ["-Wno-conversion-null"],
310
311 srcs: [
312 "apex/android_matrix.cpp",
313 "apex/android_paint.cpp",
314 "apex/android_region.cpp",
315 ],
316
317 header_libs: [ "android_graphics_apex_headers" ],
318
319 target: {
320 android: {
321 srcs: [ // sources that depend on android only libraries
322 "apex/android_bitmap.cpp",
323 "apex/android_canvas.cpp",
324 "apex/jni_runtime.cpp",
325 "apex/renderthread.cpp",
326 ],
327 },
Derek Sollenbergerc5882c42019-10-25 11:11:32 -0400328 host: {
329 srcs: [
330 "apex/LayoutlibLoader.cpp",
331 ],
332 }
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400333 },
334}
335
336// ------------------------
337// Android Graphics JNI
338// ------------------------
339
340cc_library_headers {
341 name: "android_graphics_jni_headers",
342
343 host_supported: true,
344 export_include_dirs: [
345 "jni",
346 ],
347 target: {
348 windows: {
349 enabled: true,
350 },
351 }
352}
353
354cc_defaults {
355 name: "android_graphics_jni",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400356 cflags: [
357 "-Wno-unused-parameter",
358 "-Wno-non-virtual-dtor",
359 "-Wno-maybe-uninitialized",
360 "-Wno-parentheses",
361
362 "-DGL_GLEXT_PROTOTYPES",
363 "-DEGL_EGLEXT_PROTOTYPES",
364
365 "-DU_USING_ICU_NAMESPACE=0",
366
367 "-Wall",
368 "-Werror",
369 "-Wno-error=deprecated-declarations",
370 "-Wunused",
371 "-Wunreachable-code",
372 ],
373
374 cppflags: ["-Wno-conversion-null"],
375
376 srcs: [
377 "jni/android_graphics_animation_NativeInterpolatorFactory.cpp",
378 "jni/android_graphics_animation_RenderNodeAnimator.cpp",
379 "jni/android_graphics_Canvas.cpp",
380 "jni/android_graphics_ColorSpace.cpp",
381 "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp",
382 "jni/android_graphics_drawable_VectorDrawable.cpp",
383 "jni/android_graphics_HardwareRendererObserver.cpp",
384 "jni/android_graphics_Matrix.cpp",
385 "jni/android_graphics_Picture.cpp",
386 "jni/android_graphics_DisplayListCanvas.cpp",
387 "jni/android_graphics_RenderNode.cpp",
388 "jni/android_nio_utils.cpp",
389 "jni/android_util_PathParser.cpp",
390
391 "jni/Bitmap.cpp",
392 "jni/BitmapFactory.cpp",
393 "jni/ByteBufferStreamAdaptor.cpp",
394 "jni/Camera.cpp",
395 "jni/CanvasProperty.cpp",
396 "jni/ColorFilter.cpp",
397 "jni/CreateJavaOutputStreamAdaptor.cpp",
398 "jni/FontFamily.cpp",
399 "jni/FontUtils.cpp",
400 "jni/Graphics.cpp",
401 "jni/ImageDecoder.cpp",
402 "jni/Interpolator.cpp",
403 "jni/MaskFilter.cpp",
404 "jni/NinePatch.cpp",
405 "jni/NinePatchPeeker.cpp",
406 "jni/Paint.cpp",
407 "jni/PaintFilter.cpp",
408 "jni/Path.cpp",
409 "jni/PathEffect.cpp",
410 "jni/PathMeasure.cpp",
411 "jni/Picture.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400412 "jni/Shader.cpp",
413 "jni/Typeface.cpp",
414 "jni/Utils.cpp",
415 "jni/YuvToJpegEncoder.cpp",
416 "jni/fonts/Font.cpp",
417 "jni/fonts/FontFamily.cpp",
418 "jni/text/LineBreaker.cpp",
419 "jni/text/MeasuredText.cpp",
420 ],
421
422 header_libs: [ "android_graphics_jni_headers" ],
423
424 include_dirs: [
425 "external/skia/include/private",
426 "external/skia/src/codec",
427 "external/skia/src/core",
428 "external/skia/src/effects",
429 "external/skia/src/image",
430 "external/skia/src/images",
431 ],
432
433 shared_libs: [
434 "libbase",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400435 "libcutils",
436 "libharfbuzz_ng",
437 "liblog",
438 "libminikin",
439 "libnativehelper",
440 "libz",
441 "libziparchive",
442 "libjpeg",
443 ],
444
445 target: {
446 android: {
447 srcs: [ // sources that depend on android only libraries
448 "jni/AnimatedImageDrawable.cpp",
449 "jni/android_graphics_TextureLayer.cpp",
450 "jni/android_graphics_HardwareRenderer.cpp",
451 "jni/BitmapRegionDecoder.cpp",
452 "jni/GIFMovie.cpp",
453 "jni/GraphicsStatsService.cpp",
454 "jni/Movie.cpp",
455 "jni/MovieImpl.cpp",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500456 "jni/Region.cpp", // requires libbinder_ndk
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400457 "jni/pdf/PdfDocument.cpp",
458 "jni/pdf/PdfEditor.cpp",
459 "jni/pdf/PdfRenderer.cpp",
460 "jni/pdf/PdfUtils.cpp",
461 ],
462 shared_libs: [
463 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500464 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500465 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400466 "libmediandk",
467 "libnativedisplay",
468 "libnativewindow",
469 "libstatspull",
470 "libstatssocket",
471 "libpdfium",
John Recka18d7c82020-03-02 09:41:33 -0800472 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400473 ],
474 static_libs: [
475 "libgif",
476 "libstatslog",
477 ],
478 },
479 host: {
480 cflags: [
481 "-Wno-unused-const-variable",
482 "-Wno-unused-function",
483 ],
484 static_libs: [
485 "libandroidfw",
486 ],
487 }
488 },
489}
490
491// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700492// library
493// ------------------------
494
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400495cc_library_headers {
496 name: "libhwui_internal_headers",
497
498 host_supported: true,
499 export_include_dirs: [
500 ".",
501 ],
502 header_libs: [ "android_graphics_jni_headers" ],
503 export_header_lib_headers: [ "android_graphics_jni_headers" ],
504}
505
Colin Crossf6298102017-04-19 15:25:25 -0700506cc_defaults {
507 name: "libhwui_defaults",
508 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400509
510 whole_static_libs: ["libskia"],
511
Colin Crossf6298102017-04-19 15:25:25 -0700512 srcs: [
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100513 "pipeline/skia/SkiaDisplayList.cpp",
514 "pipeline/skia/SkiaRecordingCanvas.cpp",
515 "pipeline/skia/RenderNodeDrawable.cpp",
516 "pipeline/skia/ReorderBarrierDrawables.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100517 "renderthread/Frame.cpp",
518 "renderthread/RenderTask.cpp",
519 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500520 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700521 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700522 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500523 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700524 "hwui/MinikinSkia.cpp",
525 "hwui/MinikinUtils.cpp",
526 "hwui/PaintImpl.cpp",
527 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700528 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100529 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700530 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700531 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100532 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700533 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100534 "AnimatorManager.cpp",
535 "CanvasTransform.cpp",
536 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700537 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100538 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700539 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700540 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700541 "Properties.cpp",
542 "PropertyValuesAnimatorSet.cpp",
543 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100544 "RecordingCanvas.cpp",
545 "RenderNode.cpp",
546 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100547 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700548 "SkiaCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700549 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700550 ],
551
Kweku Adams228b6d22018-04-12 13:09:04 -0700552 proto: {
553 export_proto_headers: true,
554 },
555
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100556 target: {
557 android: {
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100558 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000559 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500560 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100561 "pipeline/skia/GLFunctorDrawable.cpp",
562 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100563 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100564 "pipeline/skia/SkiaMemoryTracer.cpp",
565 "pipeline/skia/SkiaOpenGLPipeline.cpp",
566 "pipeline/skia/SkiaPipeline.cpp",
567 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100568 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100569 "pipeline/skia/VkFunctorDrawable.cpp",
570 "pipeline/skia/VkInteropFunctorDrawable.cpp",
571 "renderstate/RenderState.cpp",
572 "renderthread/CacheManager.cpp",
573 "renderthread/CanvasContext.cpp",
574 "renderthread/DrawFrameTask.cpp",
575 "renderthread/EglManager.cpp",
576 "renderthread/ReliableSurface.cpp",
577 "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",
594 "Layer.cpp",
595 "LayerUpdateQueue.cpp",
596 "ProfileData.cpp",
597 "ProfileDataContainer.cpp",
598 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100599 "TreeInfo.cpp",
600 "WebViewFunctorManager.cpp",
601 "protos/graphicsstats.proto",
602 ],
603
604 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
605 cflags: ["-Wno-implicit-fallthrough"],
606 },
607 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100608 srcs: [
609 "utils/HostColorSpace.cpp",
610 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100611 export_static_lib_headers: [
612 "libarect",
613 ],
614 }
615 }
Colin Crossf6298102017-04-19 15:25:25 -0700616}
617
618cc_library {
619 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100620 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700621 defaults: [
622 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400623 "android_graphics_apex",
624 "android_graphics_jni",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700625 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400626 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400627 target: {
628 android: {
629 version_script: "libhwui.map.txt",
630 }
631 },
Colin Crossf6298102017-04-19 15:25:25 -0700632}
633
Colin Crossf6298102017-04-19 15:25:25 -0700634cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700635 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700636 defaults: [
637 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700638 ],
Colin Crossf6298102017-04-19 15:25:25 -0700639}
640
641cc_defaults {
642 name: "hwui_test_defaults",
643 defaults: ["hwui_defaults"],
644 test_suites: ["device-tests"],
Alec Mouri680414e2020-01-28 09:22:33 -0800645 target: {
646 android: {
647 shared_libs: [
648 "libgui",
Alec Mouri45238012020-01-29 11:04:40 -0800649 "libui",
Alec Mouri680414e2020-01-28 09:22:33 -0800650 ],
651 }
652 },
Colin Crossf6298102017-04-19 15:25:25 -0700653 srcs: [
654 "tests/common/scenes/*.cpp",
655 "tests/common/LeakChecker.cpp",
656 "tests/common/TestListViewSceneBase.cpp",
657 "tests/common/TestContext.cpp",
658 "tests/common/TestScene.cpp",
659 "tests/common/TestUtils.cpp",
660 ],
661}
662
663// ------------------------
664// unit tests
665// ------------------------
666
667cc_test {
668 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400669 defaults: [
670 "hwui_test_defaults",
671 "android_graphics_apex",
672 "android_graphics_jni",
673 ],
Colin Crossf6298102017-04-19 15:25:25 -0700674
675 static_libs: [
676 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700677 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700678 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800679 shared_libs: [
680 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800681 ],
Colin Crossf6298102017-04-19 15:25:25 -0700682
683 srcs: [
684 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400685 "tests/unit/ABitmapTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400686 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700687 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700688 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700689 "tests/unit/DamageAccumulatorTests.cpp",
690 "tests/unit/DeferredLayerUpdaterTests.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",
693 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700694 "tests/unit/LinearAllocatorTests.cpp",
695 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700696 "tests/unit/PathInterpolatorTests.cpp",
697 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700698 "tests/unit/RenderNodeTests.cpp",
699 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800700 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400701 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700702 "tests/unit/SkiaBehaviorTests.cpp",
703 "tests/unit/SkiaDisplayListTests.cpp",
704 "tests/unit/SkiaPipelineTests.cpp",
705 "tests/unit/SkiaRenderPropertiesTests.cpp",
706 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700707 "tests/unit/StringUtilsTests.cpp",
708 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700709 "tests/unit/ThreadBaseTests.cpp",
710 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700711 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800712 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700713 ],
714}
715
716// ------------------------
717// Macro-bench app
718// ------------------------
719
720cc_benchmark {
721 name: "hwuimacro",
722 defaults: ["hwui_test_defaults"],
723
John Reck23462d82019-05-29 16:55:06 -0700724 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800725 shared_libs: [
726 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800727 ],
Colin Crossf6298102017-04-19 15:25:25 -0700728
729 srcs: [
730 "tests/macrobench/TestSceneRunner.cpp",
731 "tests/macrobench/main.cpp",
732 ],
733}
734
735// ------------------------
736// Micro-bench app
737// ---------------------
738
739cc_benchmark {
740 name: "hwuimicro",
741 defaults: ["hwui_test_defaults"],
742
John Reck23462d82019-05-29 16:55:06 -0700743 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800744 shared_libs: [
745 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800746 ],
Colin Crossf6298102017-04-19 15:25:25 -0700747
748 srcs: [
749 "tests/microbench/main.cpp",
750 "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}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800756
757// ----------------------------------------
758// Phony target to build benchmarks for PGO
759// ----------------------------------------
760
761phony {
762 name: "pgo-targets-hwui",
763 required: [
764 "hwuimicro",
765 "hwuimacro",
766 ]
767}