diff options
-rw-r--r-- | BUILD.gn | 38 | ||||
-rw-r--r-- | dm/DM.cpp | 2 | ||||
-rw-r--r-- | dm/DMSrcSink.cpp | 4 | ||||
-rw-r--r-- | dm/DMSrcSink.h | 2 | ||||
-rw-r--r-- | gn/gn_to_bp.py | 15 | ||||
-rw-r--r-- | tools/skqp/gn_to_bp.py | 1 | ||||
-rw-r--r-- | tools/viewer/Viewer.cpp | 7 |
7 files changed, 42 insertions, 27 deletions
@@ -39,6 +39,7 @@ declare_args() { 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 @@ if (skia_enable_tools) { } 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 @@ if (skia_enable_tools) { "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 @@ if (skia_enable_tools) { include_dirs = [] deps = [ - ":experimental_skottie", ":experimental_sksg", ":experimental_svg_model", ":flags", @@ -2100,6 +2103,11 @@ if (skia_enable_tools) { "//third_party/imgui", "//third_party/jsoncpp", ] + + if (skia_enable_skottie) { + sources += [ "tools/viewer/SkottieSlide.cpp" ] + deps += [ ":experimental_skottie" ] + } } } @@ -790,7 +790,7 @@ static bool gather_srcs() { 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 e1e411f5ea..5c8ab96806 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 @@ Name SKPSrc::name() const { return SkOSPath::Basename(fPath.c_str()); } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -#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 d52fe8968c..cffca6e760 100644 --- a/dm/DMSrcSink.h +++ b/dm/DMSrcSink.h @@ -252,7 +252,7 @@ private: }; -#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 1e73a97433..662580a298 100644 --- a/gn/gn_to_bp.py +++ b/gn/gn_to_bp.py @@ -212,13 +212,14 @@ cc_test { # 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 06ad02cad7..e645398d82 100644 --- a/tools/skqp/gn_to_bp.py +++ b/tools/skqp/gn_to_bp.py @@ -137,6 +137,7 @@ gn_args = { # 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 90c4dfc150..7500f3ff5b 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 @@ void Viewer::initSlides() { [](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);} |