[skottie] Disable on Android Framework builds Make Skottie truly optional (own flag), and disable in framework builds (to unblock landing the RapidJson refactoring). Change-Id: I4611f915e43fe11c1f6754ab4a9f63e45af2f8d3 Reviewed-on: https://skia-review.googlesource.com/125872 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/BUILD.gn b/BUILD.gn index b847032..ec45729 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -39,6 +39,7 @@ skia_enable_fontmgr_empty = false skia_enable_gpu = true skia_enable_pdf = true + skia_enable_skottie = true skia_enable_spirv_validation = is_skia_dev_build && is_debug skia_enable_tools = is_skia_dev_build skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug @@ -1444,20 +1445,24 @@ } test_lib("experimental_skottie") { - public_include_dirs = [ "experimental/skottie" ] + public_include_dirs = [] include_dirs = [ "tools" ] - sources = [ - "experimental/skottie/Skottie.cpp", - "experimental/skottie/SkottieAdapter.cpp", - "experimental/skottie/SkottieAnimator.cpp", - "experimental/skottie/SkottieParser.cpp", - "experimental/skottie/SkottieValue.cpp", - ] - deps = [ - ":experimental_sksg", - ":skia", - "//third_party/jsoncpp", - ] + if (skia_enable_skottie) { + public_include_dirs += [ "experimental/skottie" ] + public_defines = [ "SK_ENABLE_SKOTTIE" ] + sources = [ + "experimental/skottie/Skottie.cpp", + "experimental/skottie/SkottieAdapter.cpp", + "experimental/skottie/SkottieAnimator.cpp", + "experimental/skottie/SkottieParser.cpp", + "experimental/skottie/SkottieValue.cpp", + ] + deps = [ + ":experimental_sksg", + ":skia", + "//third_party/jsoncpp", + ] + } } test_lib("experimental_svg_model") { @@ -2076,7 +2081,6 @@ "tools/viewer/ImageSlide.cpp", "tools/viewer/SKPSlide.cpp", "tools/viewer/SampleSlide.cpp", - "tools/viewer/SkottieSlide.cpp", "tools/viewer/SlideDir.cpp", "tools/viewer/StatsLayer.cpp", "tools/viewer/SvgSlide.cpp", @@ -2086,7 +2090,6 @@ include_dirs = [] deps = [ - ":experimental_skottie", ":experimental_sksg", ":experimental_svg_model", ":flags", @@ -2100,6 +2103,11 @@ "//third_party/imgui", "//third_party/jsoncpp", ] + + if (skia_enable_skottie) { + sources += [ "tools/viewer/SkottieSlide.cpp" ] + deps += [ ":experimental_skottie" ] + } } }
diff --git a/dm/DM.cpp b/dm/DM.cpp index e134ac5..34362ef 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp
@@ -790,7 +790,7 @@ gather_file_srcs<SKPSrc>(FLAGS_skps, "skp"); gather_file_srcs<MSKPSrc>(FLAGS_mskps, "mskp"); -#if !defined(SK_BUILD_FOR_GOOGLE3) +#if defined(SK_ENABLE_SKOTTIE) gather_file_srcs<SkottieSrc>(FLAGS_jsons, "json"); #endif #if defined(SK_XML)
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index e1e411f..5c8ab96 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp
@@ -61,7 +61,7 @@ #include <XpsObjectModel.h> #endif -#if !defined(SK_BUILD_FOR_GOOGLE3) +#if defined(SK_ENABLE_SKOTTIE) #include "Skottie.h" #endif @@ -1202,7 +1202,7 @@ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -#if !defined(SK_BUILD_FOR_GOOGLE3) +#if defined(SK_ENABLE_SKOTTIE) SkottieSrc::SkottieSrc(Path path) : fName(SkOSPath::Basename(path.c_str())) {
diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h index d52fe89..cffca6e 100644 --- a/dm/DMSrcSink.h +++ b/dm/DMSrcSink.h
@@ -252,7 +252,7 @@ }; -#if !defined(SK_BUILD_FOR_GOOGLE3) +#if defined(SK_ENABLE_SKOTTIE) class SkottieSrc final : public Src { public: explicit SkottieSrc(Path path);
diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py index 1e73a97..662580a 100644 --- a/gn/gn_to_bp.py +++ b/gn/gn_to_bp.py
@@ -212,13 +212,14 @@ # We'll run GN to get the main source lists and include directories for Skia. gn_args = { - 'is_official_build': 'true', - 'skia_enable_tools': 'true', - 'skia_use_libheif': 'true', - 'skia_use_vulkan': 'true', - 'target_cpu': '"none"', - 'target_os': '"android"', - 'skia_vulkan_header': '"Skia_Vulkan_Android.h"', + 'is_official_build': 'true', + 'skia_enable_tools': 'true', + 'skia_enable_skottie': 'false', # requires rapidjson third-party + 'skia_use_libheif': 'true', + 'skia_use_vulkan': 'true', + 'target_cpu': '"none"', + 'target_os': '"android"', + 'skia_vulkan_header': '"Skia_Vulkan_Android.h"', } js = gn_to_bp_utils.GenerateJSONFromGN(gn_args)
diff --git a/tools/skqp/gn_to_bp.py b/tools/skqp/gn_to_bp.py index 06ad02c..e645398 100644 --- a/tools/skqp/gn_to_bp.py +++ b/tools/skqp/gn_to_bp.py
@@ -137,6 +137,7 @@ # enable/disable skia subsystems 'skia_enable_fontmgr_empty': 'true', 'skia_enable_pdf': 'false', + 'skia_enable_skottie': 'false', 'skia_use_expat': 'false', 'skia_use_dng_sdk': 'false', 'skia_use_icu': 'false',
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp index 90c4dfc..7500f3f 100644 --- a/tools/viewer/Viewer.cpp +++ b/tools/viewer/Viewer.cpp
@@ -12,7 +12,6 @@ #include "ImageSlide.h" #include "Resources.h" #include "SampleSlide.h" -#include "SkottieSlide.h" #include "SKPSlide.h" #include "SlideDir.h" #include "SvgSlide.h" @@ -47,6 +46,10 @@ #include <stdlib.h> #include <map> +#if defined(SK_ENABLE_SKOTTIE) + #include "SkottieSlide.h" +#endif + using namespace sk_app; static std::map<GpuPathRenderers, std::string> gPathRendererNames; @@ -585,10 +588,12 @@ [](const SkString& name, const SkString& path) -> sk_sp<Slide> { return sk_make_sp<ImageSlide>(name, path);} }, +#if defined(SK_ENABLE_SKOTTIE) { ".json", "skottie-dir", FLAGS_jsons, [](const SkString& name, const SkString& path) -> sk_sp<Slide> { return sk_make_sp<SkottieSlide>(name, path);} }, +#endif { ".svg", "svg-dir", FLAGS_svgs, [](const SkString& name, const SkString& path) -> sk_sp<Slide> { return sk_make_sp<SvgSlide>(name, path);}