Depends on https://skia-review.googlesource.com/c/skia/+/186870
It's optional at build time, which is good given that
it adds about 2MB of uncompressed size (from 4.3 MB to 6.4 MB)
Bug: skia:
Change-Id: I5f54ad628b735c3bc880e917394fb27d16849ebe
Reviewed-on: https://skia-review.googlesource.com/c/187924
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This should have some slightly better, more minified JS and other
bugfixes
Bug: skia:
Change-Id: I7c5367b6650267ec8bafcc5de9e351bd8788392b
Reviewed-on: https://skia-review.googlesource.com/c/193582
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Introduce a TintColorFilter scene graph node, and hook into Skottie.
Change-Id: I350dec9ebcdc0bfc68d2874703112f1b20b51d75
Reviewed-on: https://skia-review.googlesource.com/c/193662
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Move to a model that only needs floats, and puts the age in the
SkParticleState struct. Add a better test case for spawn affector
animation, to verify that things are still working.
Bug: skia:
Change-Id: I97d99de5f5d4cb302b76116e67ecc93368fb1677
Reviewed-on: https://skia-review.googlesource.com/c/193580
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
- Collapsed the per-particle data into a single struct, and
use that to communicate with drawables, too. Let the drawables
manage allocation of xforms, colors, etc. Helpful for non-atlas
drawables, and just to keep the effect code simpler.
- Having all of the params in a single struct allows us to move
the remaining animated behaviors into affectors (color/frame).
- Added SkColorCurve, which works like SkCurve for SkColor4f.
Use that to create a color affector (rather than simple
start/end colors in the effect params).
- Also put the stable random in SkParticleState. This is going
to be necessary if/when we change affectors to operate on all
particles (rather than one at a time). Still need to move t
value into the particle struct (or eval it from the lifetime
params on demand).
Change-Id: Icf39116acbfd5d6e8eb91e9affbd8898d106211d
Reviewed-on: https://skia-review.googlesource.com/c/193473
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The interface here is not ideal, but there will need to be some build
clean-up before it can be changed.
Change-Id: Ic4d55634405f4c8d9c194e4e6f368287c9669dcd
Reviewed-on: https://skia-review.googlesource.com/c/193036
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Bug: skia:
Change-Id: Idded82304a1f1d7f26f13d6c2faa1ff6f2832bbf
Reviewed-on: https://skia-review.googlesource.com/c/193372
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I6fe50ef0f783a9093090037c4b22af1400c0136e
Reviewed-on: https://skia-review.googlesource.com/c/193363
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I8efcbb09dce2cb0e4f33a10e4ff2148058c6fbc5
Reviewed-on: https://skia-review.googlesource.com/c/193362
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This makes a user check some postconditions of shaping.
Change-Id: Ifa34bbb9bd8baf18c830d58d99eee9c82811125a
Reviewed-on: https://skia-review.googlesource.com/c/193038
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Added a simpler circle drawable, moved drawing code out so that frame
calculation is handled by the drawable. Fixed all the sample effects,
including some size adjustments to better create the intended effect.
Bug: skia:
Change-Id: I60af9cd6262ff98352ca8ceaf6768aef9c7e164c
Reviewed-on: https://skia-review.googlesource.com/c/193029
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Editing curves is still cumbersome, but that's fine.
Visualization is just for feedback (and imgui's path
renderer is a little wonky), but this helps a bit.
Bug: skia:
Change-Id: I3dace6d822d472314513bb1ad72bcea1e8991b77
Reviewed-on: https://skia-review.googlesource.com/c/192828
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
- Converted all linear force stuff into a single affector,
used at either spawn or update time appropriately.
The new affector can either set or adjust velocity.
- Converted lifetime to a curve.
- Removed SkRangedFloat, initial velocity params, etc.
Looks like a large addition, but that's mostly down to the
JSON getting bigger. There's a net reduction in LoC.
Bug: skia:
Change-Id: Iac7417f15f96d0313efd08c4b26dc3250b80fa77
Reviewed-on: https://skia-review.googlesource.com/c/192102
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Need and 'in range' operator.
Change-Id: I57cd6631376a6e857054b4712a70b2aa75a53223
Reviewed-on: https://skia-review.googlesource.com/c/192823
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
It isn't used anymore.
Change-Id: I4079ff9944aa2483a0cd42130d0e69fb98935731
Reviewed-on: https://skia-review.googlesource.com/c/192820
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
This allows for SkTypefaces not backed by OpenType data to get minimal
shaping through HarfBuzz.
Change-Id: I0e4d69627500e0aff40c8989d3734597bfa1f8d6
Reviewed-on: https://skia-review.googlesource.com/c/192681
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Still some code hanging on from optimizing for SkTextBlob.
Bug: skia:8420
Change-Id: I947a9ff691fb1fbcb82934c5597e5db11c12f013
Reviewed-on: https://skia-review.googlesource.com/c/192683
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Effects now have a duration, and can be played looped
or one-shot. Added a second list of affectors that are
applied at spawn vs. update.
Effects grab and store the SkRandom at construction,
so it no longer needs to be passed to update().
Bug: skia:
Change-Id: Ib54d60466e162e4d4b70fa64c1215fc01680d47a
Reviewed-on: https://skia-review.googlesource.com/c/191722
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This supports arrays of any type, and removes all of the special case
code for arrays of SkReflected objects. (This is extracted from my
rewrite of SkCurve, which needed something like this to work).
Bug: skia:
Change-Id: I55ab942f7922335dca0685d28b3b122bc4d53daa
Reviewed-on: https://skia-review.googlesource.com/c/192620
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
New tests that use skshaper should hide behind SK_USING_SKSHAPER define.
Change-Id: Ifcd726d931e3eb1ff209085a63e8129c9cd5596d
Reviewed-on: https://skia-review.googlesource.com/c/192026
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
In the event that no fallback font can be found to handle a character,
just keep using the current font.
Change-Id: I93c852dc8ee5eaa868e48a5ce3e8298a642b15c7
Reviewed-on: https://skia-review.googlesource.com/c/191661
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
This adds a new "Particles" slide to viewer, that allows
editing, loading, and saving particle effects. All of the
particle system code is in modules/particles.
There are many rough edges and some not-yet-finished changes
to generalize the model[1]. A rough overview:
- SkReflected.h implements a lightweight reflection system
for classes derived from SkReflected. Adding a new class
involves deriving from SkReflected, adding a macro to the
class declaration, and implementing visitFields(), which
simply calls a virtual on an SkFieldVisitor for each field.
Currently, emitters and affectors use this mechanism.
- SkParticleSerialization.h demonstrates two useful field
visitors - for serializing to and from JSON. The driver
code that uses those is directly in ParticlesSlide.
- SkParticleData.h and SkCurve.h define a variety of helper
types for talking about particles, both for parameterizing
individual values, and communicating about the state of a
particle among the effect, affectors, and emitters.
- SkParticleEffect.h defines the static data definition of
an effect (SkParticleEffectParams), as well as a running
instance of an effect (SkParticleEffect). The effect has
simple update() and draw() methods.
- ParticlesSlide.cpp adds a third field visitor to generate
GUIs for interactively editing the running effect.
---
1: The critical change I'd like to make is to remove all
special case behavior over time and at spawn (setting sprite
frames, size over time, color over time, etc...). Integration
is the only fixed function behavior. Everything else is driven
by two lists of affectors. One is applied at spawn time, using
the effect's lifetime to evaluate curves. This allows spawning
particles with different colors as the effect ages out, for
example. The second list is applied every frame to update
existing particles, and is driven by the particle's lifetime.
This allows particles to change color after being spawned, for
example.
With a small set of affectors using a single expressive curve
primitive (keyframed list of cubic curve segments), we can
have affectors that update color, size, velocity, position,
sprite frame, etc., and implement many complex behaviors.
Bug: skia:
Change-Id: Id9402bef22825d55d021c5a2f9e5e41791aabaf4
Reviewed-on: https://skia-review.googlesource.com/c/181404
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This essentially resurects the old SkTextBox code into a primitive
shaper.
Change-Id: Ia4d1a5ab3d1c7d410962b49ac3891298655c7dc4
Reviewed-on: https://skia-review.googlesource.com/c/191562
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
will flesh out more over time.
Bug: skia:
Change-Id: If5eaf0a7c404b9209b93871eb3ac3d74da8c65dd
Reviewed-on: https://skia-review.googlesource.com/c/191003
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Introduce RenderNode::nodeAt(const SkPoint&) as the entry point for the hit-testing API.
This is backed by a onNodeAt() virtual, which gets dispatched throughout the render DAG,
and normally stops at the first leaf Draw node in encounters.
To support the implementation, introduce a GeometryNode::contains(const SkPoint&) API.
This is backed by a onContains() virtual, overridden in each concrete geometry class.
Expose nodeAt() on sksg::Scene, and add some basic unit tests.
Change-Id: I0c8abd9d1e51ecf2d8b4dd699f325cd636e21084
Reviewed-on: https://skia-review.googlesource.com/c/191296
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Image filters cannot let descendent damage pass through, as they may
transform their inputs arbitrarily.
Introduce the notion of "damage override" SG nodes (nodes which block
descendent damage and replace it with their own), and update
ImageFilterEffect to opt in for this behavior.
Also make InvalidationController damage dispatch optional (such that we
don't accumulate inval rects unnecessarily).
TBR=
Change-Id: Ie9f7d32ecdcc77dbe6ea009aed9ce269b3649a04
Reviewed-on: https://skia-review.googlesource.com/c/191005
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
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>
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>
This is useful, for example, when trying to test a hardware feature
that isn't supported in the current context.
Bug: skia:8731
Change-Id: I9a363159300c92e4039bfd05400238c27002efb1
Reviewed-on: https://skia-review.googlesource.com/c/189133
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Update the text adapter to shape using SkShaper.
Bug: skia:
Change-Id: Ie6ea579a1f58b2f6ba6101dcdfad8ae9809de808
Reviewed-on: https://skia-review.googlesource.com/c/183387
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
This informs HarfBuzz when we are at the beginning or end of a
paragraph so that it can handle a few rules in a special way.
Change-Id: I66a306f1ff7ddb2c1546b0fd9c0cee94cb9f7006
Reviewed-on: https://skia-review.googlesource.com/c/189850
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
There are currently two consistent ways to do line breaking. The 'ok'
way where the entire line is shaped and the resulting glyphs broken
into lines based on hopeful cluster breaks. This has the one nice
property of preserving all shaping done by the font. The 'correct' way
is to shape to each break opportunity and pick the best one, then
continue to do so for each line. This has the nice property of not
shaping incorrectly.
Fortunately, the actual implementation can be hidden behind a common
interface. Keep both of them to ensure this continues to be the case.
Change-Id: I68086731c9c2eea00b26f1447e3ec17aba799ab3
Reviewed-on: https://skia-review.googlesource.com/c/156641
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
For targets that depend on ICU, only define if `skia_use_icu` is set.
Move declare_args/skia_use_icu into skia.gni. Other variables that need
to work like that can move there later.
icu/BUILD.gn defines SK_USING_THIRD_PARTY_ICU if needed.
SkShaper_harfbuzz.cpp SkPDFSubsetFont.cpp respects
SK_USING_THIRD_PARTY_ICU when calling SkLoadICU().
sfntly/BUILD.gn, harfbuzz/BUILD.gn, icu/icu.gni uses $_src variable to
reduce verbosity. icu/icu.gni adds more headersto sources.
Change-Id: I9e000b9b19902d9f5c0c64e989bf42466aa8a299
Reviewed-on: https://skia-review.googlesource.com/c/189304
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Bug: skia:8731
Change-Id: If73216bd427a1ce773fa41044a45c1bbd7ea08e9
Reviewed-on: https://skia-review.googlesource.com/c/189124
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Geometry effects (trim-path, etc) are sensitive to the SkPath conversion
direction and starting point.
Introduce SkSG{Rect,RRect) direction and initial point attributes, and
update Skottie to initialize these according to the AE model.
TBR=
Bug: skia:8303, skia:8328, skia:8299
Change-Id: I5ec82d747e015067c7fc416c9eded6eea73d759a
Reviewed-on: https://skia-review.googlesource.com/c/185689
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>