Commit Graph

9 Commits

Author SHA1 Message Date
Florin Malita
52a4379f03 [sksg] Consolidate geometry effects
Dash, trim, round, transform and upcoming offset have a lot in common.

Introduce a GeometryEffect base class to consolidate.

TBR=
Change-Id: Ib5556e6ebe416685c624d53ba8591e118aa4f0d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300496
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-07-03 16:55:28 +00:00
Florin Malita
ed38d201de [skottie] Stroke dash support
AE supports dashing all strokes.  Dashes are specified as an arbitrary
number of intervals (alternating dash/gap) plus a start offset.

All values can be animated independently (but of course!).

  - implement a SkSG dash effect (based on SkDashPathEffect)
  - expand the shape builder logic to allow local geometry adjustments
    (kind of a bummer that dashing is a stroke/paint property as opposed
    to a geometry effect in AE)

Change-Id: Ic9ff35f2f9a552a3c26f9e1596ce58ad81f7ced5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274550
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-03-02 16:56:22 +00:00
Florin Malita
ccacfa02d2 [skottie] Caching motion tile
Update MotionTileEffect to avoid rebuilding shaders redundantly,
at render time:

  1) build all shaders at revalidation time
  2) cache the layer content picture separately, and only rebuild when
     the layer content changes

To support #2, add some SG helpers for querying subtree inval state.

With this change, we avoid all render time allocations.

Notry: true
Change-Id: I55a1f95752704af6a667b266e725492de6640387
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226512
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-10 19:13:41 +00:00
Florin Malita
fb4bce8322 [sksg] Refactor gradient implementation
Currently, gradients are PaintNode subclasses - which limits their
applicability to leaf DAG nodes.

In order to support generalized gradient/shader effects:

  * introduce a new Shader base class
  * refactor gradients as Shader subclasses
  * introduce ShaderPaint (to support current Gradient-as-paint use)
  * introduce ShaderEffect (to support future Gradient-as-effect use)

Tangentially:

  * rename SkSGPaintNode.h -> SkSGPaint.h
  * consolidate sksg::Color into SkSGPaint.h

Change-Id: I94ba949f4504c09cfde4a4f030d927411fdd66a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205263
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-01 18:43:43 +00:00
Florin Malita
dafd65217b Reland "[skottie] Add drop shadow support"
This reverts commit 0b36acdad9.

Reason for revert: Cannot repro build failure - maybe flake?  Trying again.

Original change's description:
> Revert "[skottie] Add drop shadow support"
> 
> This reverts commit 1f43a4359d.
> 
> Reason for revert: Android build failures.
> 
> Original change's description:
> > [skottie] Add drop shadow support
> > 
> > Introduce the machinery required for general image filters in SkSG +
> > a concrete drop shadow image filter effect.
> > 
> > Wire it all up with Skottie to support drop-shadow layer effects.
> > 
> > Change-Id: I98e9669852f58ba6481439a7fda4a56ec6c59b8a
> > Reviewed-on: https://skia-review.googlesource.com/c/190426
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> 
> TBR=fmalita@chromium.org,reed@google.com
> 
> Change-Id: I31d38ed4d4a15b77d1d1218b2677a891978332cb
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/190981
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: Ic3f949f40ed4651715b6de906882f5f4522f91b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/191040
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-10 01:49:55 +00:00
Florin Malita
0b36acdad9 Revert "[skottie] Add drop shadow support"
This reverts commit 1f43a4359d.

Reason for revert: Android build failures.

Original change's description:
> [skottie] Add drop shadow support
> 
> Introduce the machinery required for general image filters in SkSG +
> a concrete drop shadow image filter effect.
> 
> Wire it all up with Skottie to support drop-shadow layer effects.
> 
> Change-Id: I98e9669852f58ba6481439a7fda4a56ec6c59b8a
> Reviewed-on: https://skia-review.googlesource.com/c/190426
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I31d38ed4d4a15b77d1d1218b2677a891978332cb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/190981
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-09 14:41:40 +00:00
Florin Malita
1f43a4359d [skottie] Add drop shadow support
Introduce the machinery required for general image filters in SkSG +
a concrete drop shadow image filter effect.

Wire it all up with Skottie to support drop-shadow layer effects.

Change-Id: I98e9669852f58ba6481439a7fda4a56ec6c59b8a
Reviewed-on: https://skia-review.googlesource.com/c/190426
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-09 13:35:57 +00:00
Florin Malita
36216fb0ac [skottie] Initial Fill layer effect support
Overwrite the layer content color with a color filter.

TBR=
Change-Id: I39f920225affb2641cc11ab1f0c1456d89b47cb7
Reviewed-on: https://skia-review.googlesource.com/145730
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-08-07 15:34:34 +00:00
Florin Malita
8949c8a2f8 [skottie/sksg] Move source files list to .gni
To facilitate Chromium integration.

Change-Id: Ie6a08e90feda4c6deace9754f0baef7176882334
Reviewed-on: https://skia-review.googlesource.com/145146
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-08-02 16:29:13 +00:00