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>
Should make it easier to ask just for images.
Change-Id: If821743dc924c4bfbc6b2b2d29b14affde7b3afd
Reviewed-on: https://skia-review.googlesource.com/82684
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
All of this is dead when not using the old SkWindow framework.
TBR=reed@google.com
Bug: skia:
Change-Id: I0f6ab18987a98469bfd367d5bc10967300dfd3ca
Reviewed-on: https://skia-review.googlesource.com/75384
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
There is still a large amount of views code that could be trimmed down,
but which is used to implement samples (in viewer). Seemed simpler to
remove some of this code in pieces.
Bug: skia:
Change-Id: Ia3415060d03c8de604a154e3dc38379b754daab6
Reviewed-on: https://skia-review.googlesource.com/72801
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
I think this is generally obsoleted by sk_app?
Bug: skia:
Change-Id: Ie8e9dd1f11f2d2f97f0a21a7e79b37755e75cd44
Reviewed-on: https://skia-review.googlesource.com/74161
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
SkMatrix has the canonical version of setPolyToPoly, we don't need three
other copies sitting around.
SkBorder appears to be useless.
Bug: skia:
Change-Id: Ie747ff7af6cf1d03e6276e8d7fe57e9b3e4ad411
Reviewed-on: https://skia-review.googlesource.com/74141
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We want to change the signature of {CreateDefaultPlatform} in the V8
API to return a unique_ptr instead of a raw pointer to indicate that the
caller owns the platform. With this change we prepare pdfium for this
change.
R=egdaniel@google.com
Change-Id: Ib0bb743ca0acd98018cb28828890868f1e0fc612
Reviewed-on: https://skia-review.googlesource.com/69320
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The canvas only needs to be saved once, per local SkSVGRenderContext.
Add a helper (saveOnce) to implement this optimization.
Change-Id: I0c21fa78ad9fd5d3d11de0a29f8441620488d676
Reviewed-on: https://skia-review.googlesource.com/58340
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The method is used for clip path resolution, and is supposed to transform the path
into parent node coords -- so it should use the forward matrix, not the inverse.
Change-Id: Id6eb9fbaf024b083e19f56eddb1c293becea48fc
Reviewed-on: https://skia-review.googlesource.com/58280
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Currently we use 'fill-rule' when emitting clip paths. This is wrong:
per spec [1], clip paths observe 'clip-rule', not 'fill-rule'.
[1] https://www.w3.org/TR/SVG/masking.html#ClipRuleProperty
Change-Id: Idf81de05e9601663c8dbc9856900ffa679daf4a5
Reviewed-on: https://skia-review.googlesource.com/57661
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Stephan Altmueller <stephana@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
https://www.w3.org/TR/SVG/linking.html#AElement
The Skia SVG DOM is not a user agent, so link semantics are not
particularly interesting. But since <a> can wrap actual content, it is
important to not drop it on the floor.
The simplest thing to do is turn it into a <g> node and run with it.
Change-Id: I4e103553354746ceb49bc1038680a1c477a1320a
Reviewed-on: https://skia-review.googlesource.com/57620
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Also adds a presubmit to prevent adding trailing whitespace to source
code in the future.
Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6
Reviewed-on: https://skia-review.googlesource.com/57380
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
In preparation of radial gradient support, move common logic into an
abstract base class (SkSVGGradient).
Change-Id: Ie5361048ca8fddd9070c573c8daef0d0f57dc95e
Reviewed-on: https://skia-review.googlesource.com/57108
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>