|offset| is an angular value in [0..360].
TBR=
Change-Id: I10a91bec7e8f43db1f54c8b5358dd0604c974998
Reviewed-on: https://skia-review.googlesource.com/98560
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Zero-width strokes imply hairline in Skia, but in other models (e.g.
Lottie) they are simply ignored. The latter approach avoids
discontinuities when width -> 0, so let's make it the default for sksg.
TBR=
Change-Id: I957a873c0e6468e21372115ed18cc7316fd2e7d1
Reviewed-on: https://skia-review.googlesource.com/97661
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
To fix gm/bigrect, needed to do adjust "largest" rect so it doesn't become empty when round-tripping with SkRect/SkIRect.
I renamed it after this.
Bug: skia:
Change-Id: I747782c8456da603cf298275d2300ea1996e7629
Reviewed-on: https://skia-review.googlesource.com/95563
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Force an initial tick on animation initialization.
This prevents inconsistent state flashing if the client starts rendering
before the first tick.
TBR=
Change-Id: Iaec3146b4085c980e6501d6a65dd8f2421a2895f
Reviewed-on: https://skia-review.googlesource.com/92740
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
No reason to punt through SkMSec, we just lose precision.
TBR=
Change-Id: I2f61e49658701a3b5a675f3dd44543fd9aa98708
Reviewed-on: https://skia-review.googlesource.com/92600
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Older Json versions don't tag properties wih an "a" animation marker,
but appear to instead rely on a try-and-see-what-sticks approach.
TBR=
Change-Id: I8a3a7e43576c590aa5ac168891574ceb4811ad49
Reviewed-on: https://skia-review.googlesource.com/91861
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Shows a directory of skotties in a grid
Bug: skia:
Change-Id: I96b0700d8809c94a394cf517222123967afb20dc
Reviewed-on: https://skia-review.googlesource.com/91407
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
We can use a raw function pointer.
TBR=
Change-Id: I66d19ed563171dc314c862b35c3c98d462337f18
Reviewed-on: https://skia-review.googlesource.com/91461
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Backpedal on node/reval-time-determined damage: nodes cannot control
the invalidation order, and shared descendants may be revalidated before
a particular ancestor gets to query their state - thus making any
decisions based on that invalid.
Instead, apply damage suppression at invalidation time, based on node
type/traits. Node types which don't generate direct damage are marked
as such, and the invalidation logic bubbles damage past them, until it
finds a valid damage receiver.
Nodes which currently suppress damage:
- PaintNode (and subclasses)
- GeometryNode (and subclasses)
- Matrix
TBR=
Change-Id: I843e683e64cb6253d8c26d8397c44d02a7d6026f
Reviewed-on: https://skia-review.googlesource.com/91421
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Split the matrix component of sksg::Transform into its own, free-floating,
chainable node.
Update the composite transform animator to target matrix nodes instead of
transform nodes.
Update the layer transform attachment logic to follow "parent" references,
and build matrix inheritance chains on the fly.
TBR=
Change-Id: I017e5e462274c2cc210730e057b3ea2e7de5c0cb
Reviewed-on: https://skia-review.googlesource.com/90803
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Node subclasses can now control whether their bounds (changes)
contribute to damage.
Tristate:
* Default: The node bounds contribute to damage if the node itself was
invalidated, observing hasSelfInval(). This is the default
behavior.
* ForceSelf: The node bounds contribute to damage, regardless of
hasSelfInval(). Used for domain-boundary nodes (e.g. Draw),
which gate blocked fragments (e.g. geometry, paint nodes).
* BlockSelf: The node bounds do not contribute to damage, regardless of
hasSelfInval(). Used for nodes which do not contribute
damage directly (e.g. paints, geometry).
TBR=
Change-Id: I7c941c7ea12e14b008d846ec13108e66e34dbc73
Reviewed-on: https://skia-review.googlesource.com/91104
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
We need to discriminate between nodes whose bounds updates contribute to the dirty
region, and nodes whose bounds changes do not.
E.g. animated shape in a group: the animated shape node bounds should yield damage,
but the ancestor group bounds should not.
To accomplish this, we refine the invalidation state:
1) self invalidation == the node itself was invalidated, and its bounds updates
yield damage.
2) descendant invalidation == the node has some (self-)invalidated descendant,
but its own bounds are not contributing damage.
Also:
* hoist the bounding box invalidation logic into the base class (Node::revalidate)
and update to respect the states described above.
* remove (now-redundant) GeometryNode bbox logic.
* update revalidation methods to return the node bbox instead of void
TBR=
Change-Id: I8023d1793fb501c945a53f2dc2d2983e5b620ade
Reviewed-on: https://skia-review.googlesource.com/90581
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
SkPath supports interpolation, no reason to handle that explicitly in
Skotty.
Change skotty::ShapeValue to convert to SkPaths upfront, when parsing,
and then rely in native interpolation.
TBR=
Change-Id: I32d424ea359e0736909d4e51602ffeb14403feed
Reviewed-on: https://skia-review.googlesource.com/90362
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Closer to what I think the docs are trying to articulate.
Change-Id: I784c4daaf3f6f2c70b2e9636c30a763ab0c711e7
Reviewed-on: https://skia-review.googlesource.com/90242
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Coarse workflow:
* Construction
1) build a Json tree
2) collect asset IDs (for preComp/image layer resolution)
3) "attach" pass
- traverse the Json tree
- build an SkSG dom, one fragment at a time
- attach "animator" objects to the dom, for each animated prop
4) done, we can throw away the Json tree
* For each animation tick
1) iterate over active animators and poke their respective dom nodes/attributes
2) revalidate the SkSG dom
3) draw the SkSG dom
Note: post construction, things are super-simple - we just poke SkSG DOM attributes
with interpolated values, and everything else is handled by SkSG (invalidation,
revalidation, render).
Change-Id: I96a02be7eb4fb4cb3831f59bf2b3908ea190c0dd
Reviewed-on: https://skia-review.googlesource.com/89420
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>