aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-07-10 11:13:06 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-10 19:58:40 +0000
commita7e78ee1d461b91132f01d6b8b0b16bc31063a04 (patch)
tree3d6346e6f8bcaa4d34f0c2c27e284ac94e55642a /modules
parentd7425b14658a7db37db6401b29c095809bd9bcf2 (diff)
[skottie] Misc cleanup
* pass inline defaults * log expressions TBR= Change-Id: I5e3ab038d612c738abb1bcf35b4cc492b9aaa6c1 Reviewed-on: https://skia-review.googlesource.com/140240 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'modules')
-rw-r--r--modules/skottie/src/Skottie.cpp8
-rw-r--r--modules/skottie/src/SkottieAnimator.cpp4
2 files changed, 7 insertions, 5 deletions
diff --git a/modules/skottie/src/Skottie.cpp b/modules/skottie/src/Skottie.cpp
index 5cd1f4e6fa..571cbd1d9d 100644
--- a/modules/skottie/src/Skottie.cpp
+++ b/modules/skottie/src/Skottie.cpp
@@ -123,14 +123,13 @@ sk_sp<sksg::RenderNode> AttachOpacity(const skjson::ObjectValue& jtransform, Att
if (!childNode)
return nullptr;
- static constexpr ScalarValue kNoopOpacity = 100;
auto opacityNode = sksg::OpacityEffect::Make(childNode);
if (!BindProperty<ScalarValue>(jtransform["o"], &ctx->fAnimators,
[opacityNode](const ScalarValue& o) {
// BM opacity is [0..100]
opacityNode->setOpacity(o * 0.01f);
- }, &kNoopOpacity)) {
+ }, 100.0f)) {
// We can ignore static full opacity.
return childNode;
}
@@ -164,7 +163,7 @@ sk_sp<sksg::GeometryNode> AttachRRectGeometry(const skjson::ObjectValue& jrect,
auto p_attached = BindProperty<VectorValue>(jrect["p"], &ctx->fAnimators,
[adapter](const VectorValue& p) {
- adapter->setPosition(ValueTraits<VectorValue>::As<SkPoint>(p));
+ adapter->setPosition(ValueTraits<VectorValue>::As<SkPoint>(p));
});
auto s_attached = BindProperty<VectorValue>(jrect["s"], &ctx->fAnimators,
[adapter](const VectorValue& s) {
@@ -1021,7 +1020,6 @@ sk_sp<sksg::RenderNode> AttachMask(const skjson::ArrayValue* jmask,
SkSTArray<4, MaskRecord, true> mask_stack;
- const SkScalar full_opacity = 100;
bool has_opacity = false;
for (const skjson::ObjectValue* m : *jmask) {
@@ -1065,7 +1063,7 @@ sk_sp<sksg::RenderNode> AttachMask(const skjson::ArrayValue* jmask,
has_opacity |= BindProperty<ScalarValue>((*m)["o"], &ctx->fAnimators,
[mask_paint](const ScalarValue& o) {
mask_paint->setOpacity(o * 0.01f);
- }, &full_opacity);
+ }, 100.0f);
mask_stack.push_back({mask_path, mask_paint, mask_info->fMergeMode});
}
diff --git a/modules/skottie/src/SkottieAnimator.cpp b/modules/skottie/src/SkottieAnimator.cpp
index b2ec87254b..7ce1b7f6ba 100644
--- a/modules/skottie/src/SkottieAnimator.cpp
+++ b/modules/skottie/src/SkottieAnimator.cpp
@@ -245,6 +245,10 @@ static inline bool BindPropertyImpl(const skjson::ObjectValue* jprop,
const auto& jpropA = (*jprop)["a"];
const auto& jpropK = (*jprop)["k"];
+ if (!(*jprop)["x"].is<skjson::NullValue>()) {
+ LOG("?? Unsupported expression.\n");
+ }
+
// Older Json versions don't have an "a" animation marker.
// For those, we attempt to parse both ways.
if (!ParseDefault<bool>(jpropA, false)) {