blob: 004d279923cc483d03dcf0432fd4197f98e4f28f [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",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400360 "libz",
361 "libziparchive",
362 "libjpeg",
363 ],
364
Orion Hodson33cbf8b2021-02-08 16:17:07 +0000365 static_libs: ["libnativehelper_lazy"],
366
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400367 target: {
368 android: {
369 srcs: [ // sources that depend on android only libraries
370 "jni/AnimatedImageDrawable.cpp",
371 "jni/android_graphics_TextureLayer.cpp",
372 "jni/android_graphics_HardwareRenderer.cpp",
373 "jni/BitmapRegionDecoder.cpp",
374 "jni/GIFMovie.cpp",
375 "jni/GraphicsStatsService.cpp",
376 "jni/Movie.cpp",
377 "jni/MovieImpl.cpp",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500378 "jni/Region.cpp", // requires libbinder_ndk
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400379 "jni/pdf/PdfDocument.cpp",
380 "jni/pdf/PdfEditor.cpp",
381 "jni/pdf/PdfRenderer.cpp",
382 "jni/pdf/PdfUtils.cpp",
383 ],
384 shared_libs: [
385 "libandroidfw",
Derek Sollenberger42c50042020-02-18 14:51:17 -0500386 "libbinder",
Derek Sollenberger15da7e22020-02-14 14:16:34 -0500387 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400388 "libmediandk",
389 "libnativedisplay",
390 "libnativewindow",
391 "libstatspull",
392 "libstatssocket",
393 "libpdfium",
John Recka18d7c82020-03-02 09:41:33 -0800394 "libbinder_ndk",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400395 ],
396 static_libs: [
397 "libgif",
398 "libstatslog",
399 ],
400 },
401 host: {
402 cflags: [
403 "-Wno-unused-const-variable",
404 "-Wno-unused-function",
405 ],
406 static_libs: [
407 "libandroidfw",
408 ],
409 }
410 },
411}
412
413// ------------------------
Colin Crossf6298102017-04-19 15:25:25 -0700414// library
415// ------------------------
416
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400417cc_library_headers {
418 name: "libhwui_internal_headers",
419
420 host_supported: true,
421 export_include_dirs: [
422 ".",
423 ],
424 header_libs: [ "android_graphics_jni_headers" ],
425 export_header_lib_headers: [ "android_graphics_jni_headers" ],
426}
427
Colin Crossf6298102017-04-19 15:25:25 -0700428cc_defaults {
429 name: "libhwui_defaults",
430 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400431
432 whole_static_libs: ["libskia"],
433
Colin Crossf6298102017-04-19 15:25:25 -0700434 srcs: [
John Reckdc95f102020-11-16 12:35:02 -0500435 "canvas/CanvasFrontend.cpp",
John Reck013127b2020-10-29 20:53:51 -0400436 "canvas/CanvasOpBuffer.cpp",
437 "canvas/CanvasOpRasterizer.cpp",
John Reck5cb290b2021-02-01 13:47:31 -0500438 "effects/StretchEffect.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100439 "pipeline/skia/SkiaDisplayList.cpp",
440 "pipeline/skia/SkiaRecordingCanvas.cpp",
441 "pipeline/skia/RenderNodeDrawable.cpp",
442 "pipeline/skia/ReorderBarrierDrawables.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100443 "renderthread/Frame.cpp",
444 "renderthread/RenderTask.cpp",
445 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500446 "hwui/AnimatedImageDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700447 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700448 "hwui/Canvas.cpp",
Leon Scroggins III753a56f2019-12-11 11:02:15 -0500449 "hwui/ImageDecoder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700450 "hwui/MinikinSkia.cpp",
451 "hwui/MinikinUtils.cpp",
452 "hwui/PaintImpl.cpp",
453 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700454 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100455 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700456 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700457 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100458 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700459 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100460 "AnimatorManager.cpp",
461 "CanvasTransform.cpp",
462 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700463 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100464 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700465 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700466 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700467 "Properties.cpp",
468 "PropertyValuesAnimatorSet.cpp",
469 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100470 "RecordingCanvas.cpp",
471 "RenderNode.cpp",
472 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100473 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700474 "SkiaCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700475 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700476 ],
477
Kweku Adams228b6d22018-04-12 13:09:04 -0700478 proto: {
479 export_proto_headers: true,
480 },
481
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100482 target: {
483 android: {
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100484 srcs: [
Jerome Gaillardf9a4dc42020-01-29 15:23:26 +0000485 "hwui/AnimatedImageThread.cpp",
Stan Ilieve0fae232020-01-07 17:21:49 -0500486 "pipeline/skia/ATraceMemoryDump.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100487 "pipeline/skia/GLFunctorDrawable.cpp",
488 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100489 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100490 "pipeline/skia/SkiaMemoryTracer.cpp",
491 "pipeline/skia/SkiaOpenGLPipeline.cpp",
492 "pipeline/skia/SkiaPipeline.cpp",
493 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100494 "pipeline/skia/SkiaVulkanPipeline.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100495 "pipeline/skia/VkFunctorDrawable.cpp",
496 "pipeline/skia/VkInteropFunctorDrawable.cpp",
497 "renderstate/RenderState.cpp",
498 "renderthread/CacheManager.cpp",
499 "renderthread/CanvasContext.cpp",
500 "renderthread/DrawFrameTask.cpp",
501 "renderthread/EglManager.cpp",
502 "renderthread/ReliableSurface.cpp",
503 "renderthread/VulkanManager.cpp",
504 "renderthread/VulkanSurface.cpp",
505 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100506 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100507 "service/GraphicsStatsService.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100508 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100509 "utils/GLUtils.cpp",
Alec Mouri45238012020-01-29 11:04:40 -0800510 "utils/NdkUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100511 "utils/StringUtils.cpp",
Stan Ilievaaa9e832019-09-17 14:07:23 -0400512 "AutoBackendTextureRelease.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100513 "DeferredLayerUpdater.cpp",
514 "DeviceInfo.cpp",
515 "FrameInfo.cpp",
516 "FrameInfoVisualizer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100517 "HardwareBitmapUploader.cpp",
518 "HWUIProperties.sysprop",
519 "JankTracker.cpp",
520 "Layer.cpp",
521 "LayerUpdateQueue.cpp",
522 "ProfileData.cpp",
523 "ProfileDataContainer.cpp",
524 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100525 "TreeInfo.cpp",
526 "WebViewFunctorManager.cpp",
527 "protos/graphicsstats.proto",
528 ],
529
530 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
531 cflags: ["-Wno-implicit-fallthrough"],
532 },
533 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100534 srcs: [
535 "utils/HostColorSpace.cpp",
536 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100537 export_static_lib_headers: [
538 "libarect",
539 ],
540 }
541 }
Colin Crossf6298102017-04-19 15:25:25 -0700542}
543
544cc_library {
545 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100546 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700547 defaults: [
548 "libhwui_defaults",
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400549 "android_graphics_apex",
550 "android_graphics_jni",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700551 ],
Derek Sollenberger83ccff72019-10-24 11:49:54 -0400552 export_header_lib_headers: ["android_graphics_apex_headers"],
Derek Sollenberger2c5d6342020-04-09 09:44:54 -0400553 target: {
554 android: {
555 version_script: "libhwui.map.txt",
556 }
557 },
Colin Crossf6298102017-04-19 15:25:25 -0700558}
559
Colin Crossf6298102017-04-19 15:25:25 -0700560cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700561 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700562 defaults: [
563 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700564 ],
Colin Crossf6298102017-04-19 15:25:25 -0700565}
566
567cc_defaults {
568 name: "hwui_test_defaults",
569 defaults: ["hwui_defaults"],
570 test_suites: ["device-tests"],
Alec Mouri680414e2020-01-28 09:22:33 -0800571 target: {
572 android: {
573 shared_libs: [
574 "libgui",
Alec Mouri45238012020-01-29 11:04:40 -0800575 "libui",
Alec Mouri680414e2020-01-28 09:22:33 -0800576 ],
577 }
578 },
Colin Crossf6298102017-04-19 15:25:25 -0700579 srcs: [
580 "tests/common/scenes/*.cpp",
581 "tests/common/LeakChecker.cpp",
582 "tests/common/TestListViewSceneBase.cpp",
583 "tests/common/TestContext.cpp",
584 "tests/common/TestScene.cpp",
585 "tests/common/TestUtils.cpp",
586 ],
587}
588
589// ------------------------
590// unit tests
591// ------------------------
592
593cc_test {
594 name: "hwui_unit_tests",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400595 defaults: [
596 "hwui_test_defaults",
597 "android_graphics_apex",
598 "android_graphics_jni",
599 ],
Colin Crossf6298102017-04-19 15:25:25 -0700600
601 static_libs: [
602 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700603 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700604 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800605 shared_libs: [
606 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800607 ],
Colin Crossf6298102017-04-19 15:25:25 -0700608
609 srcs: [
610 "tests/unit/main.cpp",
Derek Sollenbergerd3e9eec2020-04-06 11:43:59 -0400611 "tests/unit/ABitmapTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400612 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700613 "tests/unit/CanvasContextTests.cpp",
John Reck013127b2020-10-29 20:53:51 -0400614 "tests/unit/CanvasOpTests.cpp",
John Reckdc95f102020-11-16 12:35:02 -0500615 "tests/unit/CanvasFrontendTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700616 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700617 "tests/unit/DamageAccumulatorTests.cpp",
618 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700619 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700620 "tests/unit/GraphicsStatsServiceTests.cpp",
621 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700622 "tests/unit/LinearAllocatorTests.cpp",
623 "tests/unit/MatrixTests.cpp",
John Reck95735052020-12-15 13:39:22 -0500624 "tests/unit/OpBufferTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700625 "tests/unit/PathInterpolatorTests.cpp",
626 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700627 "tests/unit/RenderNodeTests.cpp",
628 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800629 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400630 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700631 "tests/unit/SkiaBehaviorTests.cpp",
632 "tests/unit/SkiaDisplayListTests.cpp",
633 "tests/unit/SkiaPipelineTests.cpp",
634 "tests/unit/SkiaRenderPropertiesTests.cpp",
635 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700636 "tests/unit/StringUtilsTests.cpp",
637 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700638 "tests/unit/ThreadBaseTests.cpp",
639 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700640 "tests/unit/VectorDrawableTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800641 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700642 ],
643}
644
645// ------------------------
646// Macro-bench app
647// ------------------------
648
649cc_benchmark {
650 name: "hwuimacro",
651 defaults: ["hwui_test_defaults"],
652
John Reck23462d82019-05-29 16:55:06 -0700653 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800654 shared_libs: [
655 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800656 ],
Colin Crossf6298102017-04-19 15:25:25 -0700657
658 srcs: [
659 "tests/macrobench/TestSceneRunner.cpp",
660 "tests/macrobench/main.cpp",
661 ],
662}
663
664// ------------------------
665// Micro-bench app
666// ---------------------
667
668cc_benchmark {
669 name: "hwuimicro",
670 defaults: ["hwui_test_defaults"],
671
John Reck23462d82019-05-29 16:55:06 -0700672 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800673 shared_libs: [
674 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800675 ],
Colin Crossf6298102017-04-19 15:25:25 -0700676
677 srcs: [
678 "tests/microbench/main.cpp",
John Reckb5eeb182020-12-09 13:45:39 -0500679 "tests/microbench/CanvasOpBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700680 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700681 "tests/microbench/LinearAllocatorBench.cpp",
682 "tests/microbench/PathParserBench.cpp",
683 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700684 ],
685}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800686
687// ----------------------------------------
688// Phony target to build benchmarks for PGO
689// ----------------------------------------
690
691phony {
692 name: "pgo-targets-hwui",
693 required: [
694 "hwuimicro",
695 "hwuimacro",
696 ]
697}