blob: f4812285826761189c0247575bcd2a25dd1e6a86 [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
Paul Duffin4e006622020-05-31 16:55:13 +0100159java_sdk_library {
Alec Mourief37c242020-03-02 21:38:09 +0000160 name: "framework-graphics",
Paul Duffin4e006622020-05-31 16:55:13 +0100161 defaults: ["framework-module-defaults"],
162 visibility: [
163 "//frameworks/base", // Framework
164 ],
Alec Mourief37c242020-03-02 21:38:09 +0000165
166 srcs: [
167 ":framework-graphics-srcs",
168 ],
169
170 permitted_packages: [
171 "android.graphics",
172 ],
173
Alec Mourief37c242020-03-02 21:38:09 +0000174 // TODO: once framework-graphics is officially part of the
175 // UI-rendering module this line would no longer be
176 // needed.
177 installable: true,
178
Paul Duffin4e006622020-05-31 16:55:13 +0100179 // Disable api_lint that the defaults enable
180 // TODO: enable this
181 api_lint: {
182 enabled: false,
183 },
Anton Hansson96b08ae2020-12-21 16:59:06 +0000184 // TODO: remove this
185 unsafe_ignore_missing_latest_api: true,
Alec Mourief37c242020-03-02 21:38:09 +0000186}
187
188filegroup {
189 name: "framework-graphics-srcs",
190 srcs: [
191 "apex/java/**/*.java",
192 ],
193 path: "apex/java"
194}
195
Alec Mourief37c242020-03-02 21:38:09 +0000196// ------------------------
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400197// APEX
198// ------------------------
199
200cc_library_headers {
201 name: "android_graphics_apex_headers",
202
203 host_supported: true,
204 export_include_dirs: [
205 "apex/include",
206 ],
207 target: {
208 windows: {
209 enabled: true,
210 },
211 }
212}
213
214cc_defaults {
215 name: "android_graphics_apex",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400216 cflags: [
217 "-Wno-unused-parameter",
218 "-Wno-non-virtual-dtor",
219 "-Wno-maybe-uninitialized",
220 "-Wno-parentheses",
221 "-Wall",
222 "-Werror",
223 "-Wno-error=deprecated-declarations",
224 "-Wunused",
225 "-Wunreachable-code",
226 ],
227
228 cppflags: ["-Wno-conversion-null"],
229
230 srcs: [
231 "apex/android_matrix.cpp",
232 "apex/android_paint.cpp",
233 "apex/android_region.cpp",
234 ],
235
236 header_libs: [ "android_graphics_apex_headers" ],
237
238 target: {
239 android: {
240 srcs: [ // sources that depend on android only libraries
241 "apex/android_bitmap.cpp",
242 "apex/android_canvas.cpp",
243 "apex/jni_runtime.cpp",
244 "apex/renderthread.cpp",
245 ],
246 },
Derek Sollenbergerc5882c42019-10-25 11:11:32 -0400247 host: {
248 srcs: [
249 "apex/LayoutlibLoader.cpp",
250 ],
251 }
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400252 },
253}
254
255// ------------------------
256// Android Graphics JNI
257// ------------------------
258
259cc_library_headers {
260 name: "android_graphics_jni_headers",
261
262 host_supported: true,
263 export_include_dirs: [
264 "jni",
265 ],
266 target: {
267 windows: {
268 enabled: true,
269 },
270 }
271}
272
273cc_defaults {
274 name: "android_graphics_jni",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400275 cflags: [
276 "-Wno-unused-parameter",
277 "-Wno-non-virtual-dtor",
278 "-Wno-maybe-uninitialized",
279 "-Wno-parentheses",
280
281 "-DGL_GLEXT_PROTOTYPES",
282 "-DEGL_EGLEXT_PROTOTYPES",
283
284 "-DU_USING_ICU_NAMESPACE=0",
285
286 "-Wall",
287 "-Werror",
288 "-Wno-error=deprecated-declarations",
289 "-Wunused",
290 "-Wunreachable-code",
291 ],
292
293 cppflags: ["-Wno-conversion-null"],
294
295 srcs: [
296 "jni/android_graphics_animation_NativeInterpolatorFactory.cpp",
297 "jni/android_graphics_animation_RenderNodeAnimator.cpp",
298 "jni/android_graphics_Canvas.cpp",
299 "jni/android_graphics_ColorSpace.cpp",
300 "jni/android_graphics_drawable_AnimatedVectorDrawable.cpp",
301 "jni/android_graphics_drawable_VectorDrawable.cpp",
302 "jni/android_graphics_HardwareRendererObserver.cpp",
303 "jni/android_graphics_Matrix.cpp",
304 "jni/android_graphics_Picture.cpp",
305 "jni/android_graphics_DisplayListCanvas.cpp",
306 "jni/android_graphics_RenderNode.cpp",
307 "jni/android_nio_utils.cpp",
308 "jni/android_util_PathParser.cpp",
309
310 "jni/Bitmap.cpp",
311 "jni/BitmapFactory.cpp",
312 "jni/ByteBufferStreamAdaptor.cpp",
313 "jni/Camera.cpp",
314 "jni/CanvasProperty.cpp",
315 "jni/ColorFilter.cpp",
316 "jni/CreateJavaOutputStreamAdaptor.cpp",
317 "jni/FontFamily.cpp",
318 "jni/FontUtils.cpp",
319 "jni/Graphics.cpp",
320 "jni/ImageDecoder.cpp",
321 "jni/Interpolator.cpp",
322 "jni/MaskFilter.cpp",
323 "jni/NinePatch.cpp",
324 "jni/NinePatchPeeker.cpp",
325 "jni/Paint.cpp",
326 "jni/PaintFilter.cpp",
327 "jni/Path.cpp",
328 "jni/PathEffect.cpp",
329 "jni/PathMeasure.cpp",
330 "jni/Picture.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400331 "jni/Shader.cpp",
Nader Jawad390d6e82020-09-24 21:35:03 -0700332 "jni/RenderEffect.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400333 "jni/Typeface.cpp",
334 "jni/Utils.cpp",
335 "jni/YuvToJpegEncoder.cpp",
336 "jni/fonts/Font.cpp",
337 "jni/fonts/FontFamily.cpp",
338 "jni/text/LineBreaker.cpp",
339 "jni/text/MeasuredText.cpp",
Seigo Nonakaf3a19152020-09-14 15:29:42 -0700340 "jni/text/TextShaper.cpp",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400341 ],
342
343 header_libs: [ "android_graphics_jni_headers" ],
344
345 include_dirs: [
346 "external/skia/include/private",
347 "external/skia/src/codec",
348 "external/skia/src/core",
349 "external/skia/src/effects",
350 "external/skia/src/image",
351 "external/skia/src/images",
352 ],
353
354 shared_libs: [
355 "libbase",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400356 "libcutils",
357 "libharfbuzz_ng",
358 "liblog",
359 "libminikin",
360 "libnativehelper",
361 "libz",
362 "libziparchive",
363 "libjpeg",
364 ],
365
366 target: {
367 android: {
368 srcs: [ // sources that depend on android only libraries
369 "jni/AnimatedImageDrawable.cpp",
370 "jni/android_graphics_TextureLayer.cpp",
371 "jni/android_graphics_HardwareRenderer.cpp",
372 "jni/BitmapRegionDecoder.cpp",
373 "jni/GIFMovie.cpp",
374 "jni/GraphicsStatsService.cpp",
375 "jni/Movie.cpp",
376 "jni/MovieImpl.cpp",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500377 "jni/Region.cpp", // requires libbinder_ndk
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400378 "jni/pdf/PdfDocument.cpp",
379 "jni/pdf/PdfEditor.cpp",
380 "jni/pdf/PdfRenderer.cpp",
381 "jni/pdf/PdfUtils.cpp",
382 ],
383 shared_libs: [
384 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500385 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500386 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400387 "libmediandk",
388 "libnativedisplay",
389 "libnativewindow",
390 "libstatspull",
391 "libstatssocket",
392 "libpdfium",
John Recka18d7c82020-03-02 09:41:33 -0800393 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400394 ],
395 static_libs: [
396 "libgif",
397 "libstatslog",
398 ],
399 },
400 host: {
401 cflags: [
402 "-Wno-unused-const-variable",
403 "-Wno-unused-function",
404 ],
405 static_libs: [
406 "libandroidfw",
407 ],
408 }
409 },
410}
411
412// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700413// library
414// ------------------------
415
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400416cc_library_headers {
417 name: "libhwui_internal_headers",
418
419 host_supported: true,
420 export_include_dirs: [
421 ".",
422 ],
423 header_libs: [ "android_graphics_jni_headers" ],
424 export_header_lib_headers: [ "android_graphics_jni_headers" ],
425}
426
Colin Crossf6298102017-04-19 15:25:25 -0700427cc_defaults {
428 name: "libhwui_defaults",
429 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400430
431 whole_static_libs: ["libskia"],
432
Colin Crossf6298102017-04-19 15:25:25 -0700433 srcs: [
John Reckdc95f102020-11-16 12:35:02 -0500434 "canvas/CanvasFrontend.cpp",
John Reck013127b2020-10-29 20:53:51 -0400435 "canvas/CanvasOpBuffer.cpp",
436 "canvas/CanvasOpRasterizer.cpp",
John Reck5cb290b2021-02-01 13:47:31 -0500437 "effects/StretchEffect.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100438 "pipeline/skia/SkiaDisplayList.cpp",
439 "pipeline/skia/SkiaRecordingCanvas.cpp",
440 "pipeline/skia/RenderNodeDrawable.cpp",
441 "pipeline/skia/ReorderBarrierDrawables.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100442 "renderthread/Frame.cpp",
443 "renderthread/RenderTask.cpp",
444 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500445 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700446 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700447 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500448 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700449 "hwui/MinikinSkia.cpp",
450 "hwui/MinikinUtils.cpp",
451 "hwui/PaintImpl.cpp",
452 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700453 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100454 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700455 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700456 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100457 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700458 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100459 "AnimatorManager.cpp",
460 "CanvasTransform.cpp",
461 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700462 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100463 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700464 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700465 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700466 "Properties.cpp",
467 "PropertyValuesAnimatorSet.cpp",
468 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100469 "RecordingCanvas.cpp",
470 "RenderNode.cpp",
471 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100472 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700473 "SkiaCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700474 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700475 ],
476
Kweku Adams228b6d22018-04-12 13:09:04 -0700477 proto: {
478 export_proto_headers: true,
479 },
480
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100481 target: {
482 android: {
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100483 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000484 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500485 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100486 "pipeline/skia/GLFunctorDrawable.cpp",
487 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100488 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100489 "pipeline/skia/SkiaMemoryTracer.cpp",
490 "pipeline/skia/SkiaOpenGLPipeline.cpp",
491 "pipeline/skia/SkiaPipeline.cpp",
492 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100493 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100494 "pipeline/skia/VkFunctorDrawable.cpp",
495 "pipeline/skia/VkInteropFunctorDrawable.cpp",
496 "renderstate/RenderState.cpp",
497 "renderthread/CacheManager.cpp",
498 "renderthread/CanvasContext.cpp",
499 "renderthread/DrawFrameTask.cpp",
500 "renderthread/EglManager.cpp",
501 "renderthread/ReliableSurface.cpp",
502 "renderthread/VulkanManager.cpp",
503 "renderthread/VulkanSurface.cpp",
504 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100505 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100506 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100507 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100508 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800509 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100510 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400511 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100512 "DeferredLayerUpdater.cpp",
513 "DeviceInfo.cpp",
514 "FrameInfo.cpp",
515 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100516 "HardwareBitmapUploader.cpp",
517 "HWUIProperties.sysprop",
518 "JankTracker.cpp",
519 "Layer.cpp",
520 "LayerUpdateQueue.cpp",
521 "ProfileData.cpp",
522 "ProfileDataContainer.cpp",
523 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100524 "TreeInfo.cpp",
525 "WebViewFunctorManager.cpp",
526 "protos/graphicsstats.proto",
527 ],
528
529 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
530 cflags: ["-Wno-implicit-fallthrough"],
531 },
532 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100533 srcs: [
534 "utils/HostColorSpace.cpp",
535 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100536 export_static_lib_headers: [
537 "libarect",
538 ],
539 }
540 }
Colin Crossf6298102017-04-19 15:25:25 -0700541}
542
543cc_library {
544 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100545 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700546 defaults: [
547 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400548 "android_graphics_apex",
549 "android_graphics_jni",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700550 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400551 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400552 target: {
553 android: {
554 version_script: "libhwui.map.txt",
555 }
556 },
Colin Crossf6298102017-04-19 15:25:25 -0700557}
558
Colin Crossf6298102017-04-19 15:25:25 -0700559cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700560 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700561 defaults: [
562 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700563 ],
Colin Crossf6298102017-04-19 15:25:25 -0700564}
565
566cc_defaults {
567 name: "hwui_test_defaults",
568 defaults: ["hwui_defaults"],
569 test_suites: ["device-tests"],
Alec Mouri680414e2020-01-28 09:22:33 -0800570 target: {
571 android: {
572 shared_libs: [
573 "libgui",
Alec Mouri45238012020-01-29 11:04:40 -0800574 "libui",
Alec Mouri680414e2020-01-28 09:22:33 -0800575 ],
576 }
577 },
Colin Crossf6298102017-04-19 15:25:25 -0700578 srcs: [
579 "tests/common/scenes/*.cpp",
580 "tests/common/LeakChecker.cpp",
581 "tests/common/TestListViewSceneBase.cpp",
582 "tests/common/TestContext.cpp",
583 "tests/common/TestScene.cpp",
584 "tests/common/TestUtils.cpp",
585 ],
586}
587
588// ------------------------
589// unit tests
590// ------------------------
591
592cc_test {
593 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400594 defaults: [
595 "hwui_test_defaults",
596 "android_graphics_apex",
597 "android_graphics_jni",
598 ],
Colin Crossf6298102017-04-19 15:25:25 -0700599
600 static_libs: [
601 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700602 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700603 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800604 shared_libs: [
605 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800606 ],
Colin Crossf6298102017-04-19 15:25:25 -0700607
608 srcs: [
609 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400610 "tests/unit/ABitmapTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400611 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700612 "tests/unit/CanvasContextTests.cpp",
John Reck013127b2020-10-29 20:53:51 -0400613 "tests/unit/CanvasOpTests.cpp",
John Reckdc95f102020-11-16 12:35:02 -0500614 "tests/unit/CanvasFrontendTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700615 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700616 "tests/unit/DamageAccumulatorTests.cpp",
617 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700618 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700619 "tests/unit/GraphicsStatsServiceTests.cpp",
620 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700621 "tests/unit/LinearAllocatorTests.cpp",
622 "tests/unit/MatrixTests.cpp",
John Reck95735052020-12-15 13:39:22 -0500623 "tests/unit/OpBufferTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700624 "tests/unit/PathInterpolatorTests.cpp",
625 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700626 "tests/unit/RenderNodeTests.cpp",
627 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800628 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400629 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700630 "tests/unit/SkiaBehaviorTests.cpp",
631 "tests/unit/SkiaDisplayListTests.cpp",
632 "tests/unit/SkiaPipelineTests.cpp",
633 "tests/unit/SkiaRenderPropertiesTests.cpp",
634 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700635 "tests/unit/StringUtilsTests.cpp",
636 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700637 "tests/unit/ThreadBaseTests.cpp",
638 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700639 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800640 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700641 ],
642}
643
644// ------------------------
645// Macro-bench app
646// ------------------------
647
648cc_benchmark {
649 name: "hwuimacro",
650 defaults: ["hwui_test_defaults"],
651
John Reck23462d82019-05-29 16:55:06 -0700652 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800653 shared_libs: [
654 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800655 ],
Colin Crossf6298102017-04-19 15:25:25 -0700656
657 srcs: [
658 "tests/macrobench/TestSceneRunner.cpp",
659 "tests/macrobench/main.cpp",
660 ],
661}
662
663// ------------------------
664// Micro-bench app
665// ---------------------
666
667cc_benchmark {
668 name: "hwuimicro",
669 defaults: ["hwui_test_defaults"],
670
John Reck23462d82019-05-29 16:55:06 -0700671 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800672 shared_libs: [
673 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800674 ],
Colin Crossf6298102017-04-19 15:25:25 -0700675
676 srcs: [
677 "tests/microbench/main.cpp",
John Reckb5eeb182020-12-09 13:45:39 -0500678 "tests/microbench/CanvasOpBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700679 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700680 "tests/microbench/LinearAllocatorBench.cpp",
681 "tests/microbench/PathParserBench.cpp",
682 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700683 ],
684}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800685
686// ----------------------------------------
687// Phony target to build benchmarks for PGO
688// ----------------------------------------
689
690phony {
691 name: "pgo-targets-hwui",
692 required: [
693 "hwuimicro",
694 "hwuimacro",
695 ]
696}