[skottie] Relocate to modules/skottie

TBR=
Change-Id: I218d251ca56578a3a7fd4fb86cba9abdc10fb3bd
Reviewed-on: https://skia-review.googlesource.com/130322
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
Florin Malita 2018-05-26 09:49:28 -04:00 committed by Skia Commit-Bot
parent d8eb7b6b12
commit 3d856bdeee
16 changed files with 62 additions and 35 deletions

View File

@ -39,7 +39,6 @@ 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
@ -1013,8 +1012,7 @@ if (skia_enable_tools) {
public_configs = [ ":skia.h_config" ]
skia_h = "$target_gen_dir/skia.h"
script = "gn/find_headers.py"
args = [ rebase_path("//bin/gn") ] +
[ rebase_path("//") ] +
args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
[ rebase_path(skia_h, root_build_dir) ] +
rebase_path(skia_public_includes)
depfile = "$skia_h.deps"
@ -1420,26 +1418,6 @@ if (skia_enable_tools) {
]
}
test_lib("experimental_skottie") {
public_include_dirs = []
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/SkottieJson.cpp",
"experimental/skottie/SkottieValue.cpp",
]
deps = [
":skia",
"modules/sksg",
"//third_party/rapidjson",
]
}
}
test_lib("experimental_svg_model") {
public_include_dirs = []
if (skia_use_expat) {
@ -1582,7 +1560,6 @@ if (skia_enable_tools) {
include_dirs = [ "tests" ]
deps = [
":common_flags",
":experimental_skottie",
":experimental_svg_model",
":flags",
":gm",
@ -1591,6 +1568,7 @@ if (skia_enable_tools) {
":tests",
":third_party_skcms",
":tool_utils",
"modules/skottie",
"modules/sksg",
"//third_party/jsoncpp",
"//third_party/libpng",
@ -1790,17 +1768,13 @@ if (skia_enable_tools) {
"tools/picture_utils.cpp",
]
deps = [
":experimental_skottie",
":flags",
":gpu_tool_utils",
":skia",
"modules/skottie:fuzz",
"//third_party/jsoncpp",
"//third_party/libpng",
]
if (skia_enable_skottie) {
sources += [ "fuzz/oss_fuzz/FuzzSkottieJSON.cpp" ]
}
}
test_app("pathops_unittest") {
@ -2023,6 +1997,7 @@ 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",
@ -2041,15 +2016,11 @@ if (skia_enable_tools) {
":skia",
":tool_utils",
":views",
"modules/skottie",
"modules/sksg",
"//third_party/imgui",
"//third_party/jsoncpp",
]
if (skia_enable_skottie) {
sources += [ "tools/viewer/SkottieSlide.cpp" ]
deps += [ ":experimental_skottie" ]
}
}
}

49
modules/skottie/BUILD.gn Normal file
View File

@ -0,0 +1,49 @@
# Copyright 2018 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
declare_args() {
skia_enable_skottie = true
}
config("public_config") {
if (skia_enable_skottie) {
defines = [ "SK_ENABLE_SKOTTIE" ]
include_dirs = [ "include" ]
}
}
source_set("skottie") {
if (skia_enable_skottie) {
public_configs = [ ":public_config" ]
sources = [
"src/Skottie.cpp",
"src/SkottieAdapter.cpp",
"src/SkottieAnimator.cpp",
"src/SkottieJson.cpp",
"src/SkottieValue.cpp",
]
configs += [ "../../:skia_private" ]
deps = [
"../..:skia",
"../../third_party/rapidjson",
"../sksg:sksg",
]
}
}
source_set("fuzz") {
if (skia_enable_skottie) {
testonly = true
configs += [ "../..:skia_private" ]
sources = [
"fuzz/FuzzSkottieJSON.cpp",
]
deps = [
":skottie",
"../..:skia", # TODO: refactor to make this nicer
]
}
}

View File

@ -9,5 +9,4 @@ third_party("rapidjson") {
public_include_dirs = [ "../externals/rapidjson/include" ]
defines = [ "RAPIDJSON_HAS_CXX11_RVALUE_REFS=1" ]
sources = []
testonly = true
}

View File

@ -7,6 +7,8 @@
#include "SkottieSlide.h"
#if defined(SK_ENABLE_SKOTTIE)
#include "SkAnimTimer.h"
#include "SkCanvas.h"
#include "Skottie.h"
@ -130,3 +132,5 @@ bool SkottieSlide::onMouse(SkScalar x, SkScalar y, sk_app::Window::InputState st
return false;
}
#endif // SK_ENABLE_SKOTTIE

View File

@ -9,6 +9,8 @@
#define SkottieSlide_DEFINED
#include "Slide.h"
#if defined(SK_ENABLE_SKOTTIE)
#include "Skottie.h"
namespace sksg { class Scene; }
@ -41,4 +43,6 @@ private:
typedef Slide INHERITED;
};
#endif // SK_ENABLE_SKOTTIE
#endif // SkottieSlide_DEFINED