Commit Graph

9 Commits

Author SHA1 Message Date
Florin Malita
836ff5e405 [skottie] Mask feather support
Wrap mask nodes with a sksg::BlurImageFilter to implement the feather
(blur) effect.

Requires assets exported with https://github.com/bodymovin/bodymovin-extension/pull/13.

Change-Id: Ia7809a73582f6ed4e55c88a26b5fe36a52cbb749
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211340
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-30 15:20:18 +00:00
Florin Malita
2253c22afb [skottie] Parented camera support
Parent camera layer transforms apply to the camera itself, thus

  T_camera' = T_camera x Inv(T_parent)

To support this composition:

  - introduce sksg::Transform::MakeInverse()

  - allow selectable pre/post parent composition in
    AnimationBuilder::attachMatrix3D()

Change-Id: Ie70b36e4e9bb1b32e60893df5695bdc6c0dc0d00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210422
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-25 17:02:49 +00:00
Florin Malita
7cd5ea0a63 [skottie] Fix camera z-rotation
Flip z consistently.

TBR=reed
Change-Id: I910d6e2ae4cc21992b5b5c3acb5c4074b1e4204e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210382
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-25 15:28:00 +00:00
Florin Malita
b783a43f0d [skottie] Fix 3d rotation order
TBR=reed
Change-Id: I07263ad7ef0b86ce1ace19d68f3f3b08cfd76dfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210300
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-25 00:29:35 +00:00
Florin Malita
b72dee21c1 [skottie] Initial "Levels" effect support
Introduce sksg::LevelsColorFilter and hook into Skottie's effects builder.

Limitations:

  - BM/Lottie does not export animated paramaters (static values only)
  - BM/Lottie only exports the first modified channel

Change-Id: I9ef389478c2eaa0d13794abe6a8089a8b3c0c62e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206269
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-04-10 20:40:10 +00:00
Florin Malita
866e262a21 [skottie] Fix gradient ramp for non-solid layers
Two issues:

  1) Empirically (per AE's model), only solid layers transform the effect space.
     All other layer types implement their effects ignoring the layer xform.

  2) Due to the effect deferral mechanism in sksg, shader effects are
     sometimes applied with a different transform than intended.

To address #1, tweak the layer builder logic to attach the effects
before/after the transform node, depending on the layer type.

For #2, track the CTM active when the shader effect is attached and undo
any intervening transformations via a local matrix when the shader is
actually applied to SkPaint.

Change-Id: I29b5a4df3b223e7da9dfc36b0d7d40055d192ac0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205922
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-03 20:46:35 +00:00
Florin Malita
9a9e723f02 [skottie] Add support for (non-standard) v-centered text
Introduce a Skottie JSON extension for controlling vertical text
alignment ("sk_vj"), with a single public value for now: 1 (centered).

Refactor SkottieShaper to handle vertical adjustments based on a VAlign
enum:

  kTop         - the topmost line is ascent-aligned with the box top
                 (AE text-box behavior)
  kTopBaseline - the topmost line is baseline-aligned with the top box
                 (AE text-point behavior)
  kCenter      - the text center is aligned with the box center
                 ("sk_vj": 1, Skottie extension)

Also externalize the vertical adjustment as a text blob offset (instead
of baking into blob glyph offsets).

Change-Id: I29a414d4c6ccfafc534ca7b61f48ef96d8cff86e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205590
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-03 13:06:14 +00:00
Florin Malita
8dd5ea1a75 [skottie] Allow extra-normal Bezier interpolation
AE/Lottie allow Bezier control Ys to be outside the [0..1] range.

Update SkCubicMap to do the same.

Bug: skia:8931
Change-Id: I54ee8dbb4e6e0a33a917500523c82fe56c854d4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205002
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-29 18:23:03 +00:00
Florin Malita
0ed4c37634 [skottie] Fix handling of hidden shapes and layers
TBR=reed@google.com

Bug: skia:8923
Change-Id: I5bd1d4f2ef62ebd95cfae0fe3665960b07ed4ae1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204082
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-27 13:17:48 +00:00