blob: 4ad130b980b632037d4b38ee52bb32df58a28db5 [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 ],
200}
201
202droidstubs {
203 name: "framework-graphics-stubs-srcs-module_libs_api",
204 defaults: [
205 "framework-graphics-stubs-srcs-defaults",
206 "framework-module-stubs-defaults-module_libs_api",
207 ],
208}
209
210droidstubs {
211 name: "framework-graphics-stubs-srcs-publicapi",
212 defaults: [
213 "framework-graphics-stubs-srcs-defaults",
214 "framework-module-stubs-defaults-publicapi",
215 ],
216}
217
218droidstubs {
219 name: "framework-graphics-stubs-srcs-systemapi",
220 defaults: [
221 "framework-graphics-stubs-srcs-defaults",
222 "framework-module-stubs-defaults-systemapi",
223 ],
224}
225
226java_library {
227 name: "framework-graphics-stubs-module_libs_api",
228 srcs: [":framework-graphics-stubs-srcs-module_libs_api"],
229 sdk_version: "system_current",
230 visibility: [
231 "//frameworks/base", // Framework
232 "//frameworks/base/libs/hwui", // UI-rendering module
233 ],
234}
235
236java_library {
237 name: "framework-graphics-stubs-publicapi",
238 srcs: [":framework-graphics-stubs-srcs-publicapi"],
239 sdk_version: "current",
240 visibility: [
241 "//frameworks/base", // Framework
242 "//frameworks/base/libs/hwui", // UI-rendering module
243 ],
244}
245
246java_library {
247 name: "framework-graphics-stubs-systemapi",
248 srcs: [":framework-graphics-stubs-srcs-systemapi"],
249 sdk_version: "system_current",
250 visibility: [
251 "//frameworks/base", // Framework
252 "//frameworks/base/libs/hwui", // UI-rendering module
253 ],
254}
255
256// ------------------------
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400257// APEX
258// ------------------------
259
260cc_library_headers {
261 name: "android_graphics_apex_headers",
262
263 host_supported: true,
264 export_include_dirs: [
265 "apex/include",
266 ],
267 target: {
268 windows: {
269 enabled: true,
270 },
271 }
272}
273
274cc_defaults {
275 name: "android_graphics_apex",
276 host_supported: true,
277 cflags: [
278 "-Wno-unused-parameter",
279 "-Wno-non-virtual-dtor",
280 "-Wno-maybe-uninitialized",
281 "-Wno-parentheses",
282 "-Wall",
283 "-Werror",
284 "-Wno-error=deprecated-declarations",
285 "-Wunused",
286 "-Wunreachable-code",
287 ],
288
289 cppflags: ["-Wno-conversion-null"],
290
291 srcs: [
292 "apex/android_matrix.cpp",
293 "apex/android_paint.cpp",
294 "apex/android_region.cpp",
295 ],
296
297 header_libs: [ "android_graphics_apex_headers" ],
298
299 target: {
300 android: {
301 srcs: [ // sources that depend on android only libraries
302 "apex/android_bitmap.cpp",
303 "apex/android_canvas.cpp",
304 "apex/jni_runtime.cpp",
305 "apex/renderthread.cpp",
306 ],
307 },
Derek Sollenbergerc5882c42019-10-25 11:11:32 -0400308 host: {
309 srcs: [
310 "apex/LayoutlibLoader.cpp",
311 ],
312 }
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400313 },
314}
315
316// ------------------------
317// Android Graphics JNI
318// ------------------------
319
320cc_library_headers {
321 name: "android_graphics_jni_headers",
322
323 host_supported: true,
324 export_include_dirs: [
325 "jni",
326 ],
327 target: {
328 windows: {
329 enabled: true,
330 },
331 }
332}
333
334cc_defaults {
335 name: "android_graphics_jni",
336 host_supported: true,
337 cflags: [
338 "-Wno-unused-parameter",
339 "-Wno-non-virtual-dtor",
340 "-Wno-maybe-uninitialized",
341 "-Wno-parentheses",
342
343 "-DGL_GLEXT_PROTOTYPES",
344 "-DEGL_EGLEXT_PROTOTYPES",
345
346 "-DU_USING_ICU_NAMESPACE=0",
347
348 "-Wall",
349 "-Werror",
350 "-Wno-error=deprecated-declarations",
351 "-Wunused",
352 "-Wunreachable-code",
353 ],
354
355 cppflags: ["-Wno-conversion-null"],
356
357 srcs: [
358 "jni/android_graphics_animation_NativeInterpolatorFactory.cpp",
359 "jni/android_graphics_animation_RenderNodeAnimator.cpp",
360 "jni/android_graphics_Canvas.cpp",
361 "jni/android_graphics_ColorSpace.cpp",
362 "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp",
363 "jni/android_graphics_drawable_VectorDrawable.cpp",
364 "jni/android_graphics_HardwareRendererObserver.cpp",
365 "jni/android_graphics_Matrix.cpp",
366 "jni/android_graphics_Picture.cpp",
367 "jni/android_graphics_DisplayListCanvas.cpp",
368 "jni/android_graphics_RenderNode.cpp",
369 "jni/android_nio_utils.cpp",
370 "jni/android_util_PathParser.cpp",
371
372 "jni/Bitmap.cpp",
373 "jni/BitmapFactory.cpp",
374 "jni/ByteBufferStreamAdaptor.cpp",
375 "jni/Camera.cpp",
376 "jni/CanvasProperty.cpp",
377 "jni/ColorFilter.cpp",
378 "jni/CreateJavaOutputStreamAdaptor.cpp",
379 "jni/FontFamily.cpp",
380 "jni/FontUtils.cpp",
381 "jni/Graphics.cpp",
382 "jni/ImageDecoder.cpp",
383 "jni/Interpolator.cpp",
384 "jni/MaskFilter.cpp",
385 "jni/NinePatch.cpp",
386 "jni/NinePatchPeeker.cpp",
387 "jni/Paint.cpp",
388 "jni/PaintFilter.cpp",
389 "jni/Path.cpp",
390 "jni/PathEffect.cpp",
391 "jni/PathMeasure.cpp",
392 "jni/Picture.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400393 "jni/Shader.cpp",
394 "jni/Typeface.cpp",
395 "jni/Utils.cpp",
396 "jni/YuvToJpegEncoder.cpp",
397 "jni/fonts/Font.cpp",
398 "jni/fonts/FontFamily.cpp",
399 "jni/text/LineBreaker.cpp",
400 "jni/text/MeasuredText.cpp",
401 ],
402
403 header_libs: [ "android_graphics_jni_headers" ],
404
405 include_dirs: [
406 "external/skia/include/private",
407 "external/skia/src/codec",
408 "external/skia/src/core",
409 "external/skia/src/effects",
410 "external/skia/src/image",
411 "external/skia/src/images",
412 ],
413
414 shared_libs: [
415 "libbase",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400416 "libcutils",
417 "libharfbuzz_ng",
418 "liblog",
419 "libminikin",
420 "libnativehelper",
421 "libz",
422 "libziparchive",
423 "libjpeg",
424 ],
425
426 target: {
427 android: {
428 srcs: [ // sources that depend on android only libraries
429 "jni/AnimatedImageDrawable.cpp",
430 "jni/android_graphics_TextureLayer.cpp",
431 "jni/android_graphics_HardwareRenderer.cpp",
432 "jni/BitmapRegionDecoder.cpp",
433 "jni/GIFMovie.cpp",
434 "jni/GraphicsStatsService.cpp",
435 "jni/Movie.cpp",
436 "jni/MovieImpl.cpp",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500437 "jni/Region.cpp", // requires libbinder_ndk
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400438 "jni/pdf/PdfDocument.cpp",
439 "jni/pdf/PdfEditor.cpp",
440 "jni/pdf/PdfRenderer.cpp",
441 "jni/pdf/PdfUtils.cpp",
442 ],
443 shared_libs: [
444 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500445 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500446 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400447 "libmediandk",
448 "libnativedisplay",
449 "libnativewindow",
450 "libstatspull",
451 "libstatssocket",
452 "libpdfium",
John Recka18d7c82020-03-02 09:41:33 -0800453 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400454 ],
455 static_libs: [
456 "libgif",
457 "libstatslog",
458 ],
459 },
460 host: {
461 cflags: [
462 "-Wno-unused-const-variable",
463 "-Wno-unused-function",
464 ],
465 static_libs: [
466 "libandroidfw",
467 ],
468 }
469 },
470}
471
472// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700473// library
474// ------------------------
475
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400476cc_library_headers {
477 name: "libhwui_internal_headers",
478
479 host_supported: true,
480 export_include_dirs: [
481 ".",
482 ],
483 header_libs: [ "android_graphics_jni_headers" ],
484 export_header_lib_headers: [ "android_graphics_jni_headers" ],
485}
486
Colin Crossf6298102017-04-19 15:25:25 -0700487cc_defaults {
488 name: "libhwui_defaults",
489 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400490
491 whole_static_libs: ["libskia"],
492
Colin Crossf6298102017-04-19 15:25:25 -0700493 srcs: [
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100494 "pipeline/skia/SkiaDisplayList.cpp",
495 "pipeline/skia/SkiaRecordingCanvas.cpp",
496 "pipeline/skia/RenderNodeDrawable.cpp",
497 "pipeline/skia/ReorderBarrierDrawables.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100498 "renderthread/Frame.cpp",
499 "renderthread/RenderTask.cpp",
500 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500501 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700502 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700503 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500504 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700505 "hwui/MinikinSkia.cpp",
506 "hwui/MinikinUtils.cpp",
507 "hwui/PaintImpl.cpp",
508 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700509 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100510 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700511 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700512 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100513 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700514 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100515 "AnimatorManager.cpp",
516 "CanvasTransform.cpp",
517 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700518 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100519 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700520 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700521 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700522 "Properties.cpp",
523 "PropertyValuesAnimatorSet.cpp",
524 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100525 "RecordingCanvas.cpp",
526 "RenderNode.cpp",
527 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100528 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700529 "SkiaCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700530 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700531 ],
532
Kweku Adams228b6d22018-04-12 13:09:04 -0700533 proto: {
534 export_proto_headers: true,
535 },
536
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100537 target: {
538 android: {
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100539 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000540 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500541 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100542 "pipeline/skia/GLFunctorDrawable.cpp",
543 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100544 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100545 "pipeline/skia/SkiaMemoryTracer.cpp",
546 "pipeline/skia/SkiaOpenGLPipeline.cpp",
547 "pipeline/skia/SkiaPipeline.cpp",
548 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100549 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100550 "pipeline/skia/VkFunctorDrawable.cpp",
551 "pipeline/skia/VkInteropFunctorDrawable.cpp",
552 "renderstate/RenderState.cpp",
553 "renderthread/CacheManager.cpp",
554 "renderthread/CanvasContext.cpp",
555 "renderthread/DrawFrameTask.cpp",
556 "renderthread/EglManager.cpp",
557 "renderthread/ReliableSurface.cpp",
558 "renderthread/VulkanManager.cpp",
559 "renderthread/VulkanSurface.cpp",
560 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100561 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100562 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100563 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100564 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800565 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100566 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400567 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100568 "DeferredLayerUpdater.cpp",
569 "DeviceInfo.cpp",
570 "FrameInfo.cpp",
571 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100572 "HardwareBitmapUploader.cpp",
573 "HWUIProperties.sysprop",
574 "JankTracker.cpp",
575 "Layer.cpp",
576 "LayerUpdateQueue.cpp",
577 "ProfileData.cpp",
578 "ProfileDataContainer.cpp",
579 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100580 "TreeInfo.cpp",
581 "WebViewFunctorManager.cpp",
582 "protos/graphicsstats.proto",
583 ],
584
585 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
586 cflags: ["-Wno-implicit-fallthrough"],
587 },
588 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100589 srcs: [
590 "utils/HostColorSpace.cpp",
591 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100592 export_static_lib_headers: [
593 "libarect",
594 ],
595 }
596 }
Colin Crossf6298102017-04-19 15:25:25 -0700597}
598
599cc_library {
600 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100601 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700602 defaults: [
603 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400604 "android_graphics_apex",
605 "android_graphics_jni",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700606 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400607 export_header_lib_headers: ["android_graphics_apex_headers"],
Colin Crossf6298102017-04-19 15:25:25 -0700608}
609
Colin Crossf6298102017-04-19 15:25:25 -0700610cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700611 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700612 defaults: [
613 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700614 ],
Colin Crossf6298102017-04-19 15:25:25 -0700615}
616
617cc_defaults {
618 name: "hwui_test_defaults",
619 defaults: ["hwui_defaults"],
620 test_suites: ["device-tests"],
Alec Mouri680414e2020-01-28 09:22:33 -0800621 target: {
622 android: {
623 shared_libs: [
624 "libgui",
Alec Mouri45238012020-01-29 11:04:40 -0800625 "libui",
Alec Mouri680414e2020-01-28 09:22:33 -0800626 ],
627 }
628 },
Colin Crossf6298102017-04-19 15:25:25 -0700629 srcs: [
630 "tests/common/scenes/*.cpp",
631 "tests/common/LeakChecker.cpp",
632 "tests/common/TestListViewSceneBase.cpp",
633 "tests/common/TestContext.cpp",
634 "tests/common/TestScene.cpp",
635 "tests/common/TestUtils.cpp",
636 ],
637}
638
639// ------------------------
640// unit tests
641// ------------------------
642
643cc_test {
644 name: "hwui_unit_tests",
645 defaults: ["hwui_test_defaults"],
646
647 static_libs: [
648 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700649 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700650 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800651 shared_libs: [
652 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800653 ],
Colin Crossf6298102017-04-19 15:25:25 -0700654
655 srcs: [
656 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400657 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700658 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700659 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700660 "tests/unit/DamageAccumulatorTests.cpp",
661 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700662 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700663 "tests/unit/GraphicsStatsServiceTests.cpp",
664 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700665 "tests/unit/LinearAllocatorTests.cpp",
666 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700667 "tests/unit/PathInterpolatorTests.cpp",
668 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700669 "tests/unit/RenderNodeTests.cpp",
670 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800671 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400672 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700673 "tests/unit/SkiaBehaviorTests.cpp",
674 "tests/unit/SkiaDisplayListTests.cpp",
675 "tests/unit/SkiaPipelineTests.cpp",
676 "tests/unit/SkiaRenderPropertiesTests.cpp",
677 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700678 "tests/unit/StringUtilsTests.cpp",
679 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700680 "tests/unit/ThreadBaseTests.cpp",
681 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700682 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800683 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700684 ],
685}
686
687// ------------------------
688// Macro-bench app
689// ------------------------
690
691cc_benchmark {
692 name: "hwuimacro",
693 defaults: ["hwui_test_defaults"],
694
John Reck23462d82019-05-29 16:55:06 -0700695 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800696 shared_libs: [
697 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800698 ],
Colin Crossf6298102017-04-19 15:25:25 -0700699
700 srcs: [
701 "tests/macrobench/TestSceneRunner.cpp",
702 "tests/macrobench/main.cpp",
703 ],
704}
705
706// ------------------------
707// Micro-bench app
708// ---------------------
709
710cc_benchmark {
711 name: "hwuimicro",
712 defaults: ["hwui_test_defaults"],
713
John Reck23462d82019-05-29 16:55:06 -0700714 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800715 shared_libs: [
716 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800717 ],
Colin Crossf6298102017-04-19 15:25:25 -0700718
719 srcs: [
720 "tests/microbench/main.cpp",
721 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700722 "tests/microbench/LinearAllocatorBench.cpp",
723 "tests/microbench/PathParserBench.cpp",
724 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700725 ],
726}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800727
728// ----------------------------------------
729// Phony target to build benchmarks for PGO
730// ----------------------------------------
731
732phony {
733 name: "pgo-targets-hwui",
734 required: [
735 "hwuimicro",
736 "hwuimacro",
737 ]
738}