[go: nahoru, domu]

Clean up skottie support build flag.

There are 2 issues with the current paradigm:
1) #if !defined(OS_ANDROID) is sprinkled throughout the compositor code.
Beyond the stylistic aspect of this, the inconsistency (some Skottie
code is guarded and some is not) makes it hard to maintain. It is
difficult to tell what should be guarded and what should not.
2) Instead of duplicating !OS_ANDROID throughout the code, there
should be a dedicated build flag for skottie support.

The way this is being solved is to hide all dependencies on the Skottie
library within SkottieWrapper. On platforms that don't support
Skottie (Android currently), a dummy SkottieWrapper file is linked. This
prevents the Chromium code from being polluted with #ifdefs and still
omitting Skottie on certain builds. The whole thing is controlled by
a GN flag.

Note this CL does not introduce any functional changes whatsoever.

Bug: b:203584064
Test: cc_unittests
Change-Id: I4db2ff5997f49b8a974c57da3f494435c90b98d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244467
Commit-Queue: Eric Sum <esum@google.com>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/main@{#936026}
diff --git a/skia/features.gni b/skia/features.gni
index 5675938..bf567a5 100644
--- a/skia/features.gni
+++ b/skia/features.gni
@@ -12,3 +12,8 @@
   # path for D3D12 is available.
   enable_skia_dawn_gtests = false
 }
+
+# Skottie is not used on Android. To keep apk size small the skottie library is
+# excluded from the binary. At the time this comment was written, it adds ~200KB
+# to the APK.
+skia_support_skottie = !is_android