Commit Graph

258 Commits

Author SHA1 Message Date
Mike Reed
ca9b2082d1 rename mixer to lerp (in prep for SkMixer)
Bug: skia:
Change-Id: I55d879dd76e10c8ef9a01f2dd7cff725e8a82433
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199932
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-03-11 19:32:31 +00:00
Florin Malita
c5664425bb [skottie] Fix Gaussian blur repeat edge pixels semantics
Repeat edge pixels: on  -> kClamp_TileMode.

Repeat edge pixels: off -> kClampToBlack_TileMode.

Bug: skia:
Change-Id: Id2096ad90d31b47e7041a502ded959b67c719a5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199923
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-11 19:16:02 +00:00
Brian Osman
ca4ed90da7 Particles: Store stable randoms after spawn affectors
This fixes a subtle bug with correlated behavior, where the spawn and
update affectors would get the same sequence of random values, leading
to confusing patterns.

Bug: skia:
Change-Id: Ieaace68bfe92281ec81497a8c6ce0108df996a4c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199251
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-08 19:05:37 +00:00
Florin Malita
a720d76470 [skottie] Gaussian blur layer effect
Introduce a BlurImageFilter SG node + required Skottie glue.

NOTRY=true
Bug: skia:
Change-Id: If56a8a6fe565c318216251d80a3e37f4ff6603c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198255
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-08 17:59:17 +00:00
Florin Malita
4025710b75 [skottie] Use std::chrono for load time stats
Bug: skia:8803
Change-Id: I56a6596a62557ed994c2ff1161367532f405a08e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198601
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-07 15:32:39 +00:00
Florin Malita
34336e3633 Make SkCubicMap immutable
Drop setter, only keep the parameterized constructor.

Change-Id: I31517df23688b8bd7485bf70c9c055cd1c87edcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198245
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-06 22:55:08 +00:00
Brian Osman
d0c1bd43d9 Particle cleanup: IWYU
Bug: skia:
Change-Id: If9d8a22a770e4125391d0fbd263521f6bdb7725d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198246
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-06 22:26:40 +00:00
Brian Osman
93c47cc8e3 SkReflected - avoid double registration, auto register base types, etc.
Bug: skia:
Change-Id: I99913987ec5de044ecc9302335771f59d85126dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198243
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-06 20:29:38 +00:00
Brian Osman
b77d502946 Particles: Cleanup and better UI
Remove SkAnimTimer from the module interface entirely.
Clean up some other SkParticleEffect methods. Simplify
VisitTypes to just visit all of them, it's easier for
the client to do any filtering.

In the slide, make the UI far nicer. Load all files in
a given directory, and allow editing (and saving) them
all at once, or adding a new entry. Support multiple
playing effects, with a draggable handle to set the
position.

Bug: skia:
Change-Id: I0bec4077f9135bc122569f1410bebc96d5439480
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197243
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-06 18:42:11 +00:00
Kevin Lubick
269fe89950 [canvaskit] Add particles integration
Bug: skia:
Change-Id: I5bf08e8007b59b5e21005f5004d698e53b99ffe6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197849
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-06 14:52:56 +00:00
Kevin Lubick
966348413f [particles] Clean up build - remove test deps
Bug: skia:
Change-Id: I499262277ac1c8d92a39a66f6e846e248b102aef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197767
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-03-05 20:44:10 +00:00
Brian Osman
bdcdf1a7c3 Add SkParticleValue to allow further customization of curve behavior
All curves (and path affectors) are driven by an SkParticleValue. The
value can derive its value from the current defaults (age of particle
or effect), or explicitly choose the other one, a random value, or any
other particle value. Values can be range adjusted and support repeat,
clamp, and mirror tiling.

Also fixed some more issues related to resource path in the slide GUI.

Bug: skia:
Change-Id: I4755018d5b57ae2d5ec400d541055ca4fb542978
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196760
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-04 22:04:17 +00:00
Brian Osman
3d76d1bf46 Particles: Removed emitters, added more full-featured position affectors
Bug: skia:
Change-Id: Ie6485a11bb57fecef470d727dcf3b4fe5dff0b90
Reviewed-on: https://skia-review.googlesource.com/c/195582
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-28 21:16:02 +00:00
Brian Osman
34d1331323 Particles: Improvements to SkCurve
Added explicit Linear segment type, merge math evaluation helpers for
scalar and color curves. Add logic to visitFields that cuts down on the
serialized size of simple curves, and makes the GUI easier to work with.

Remove the curve plot from the GUI. It was incorrect (wrong points at
cubic handle locations), not terribly helpful, and difficult to
maintain.

Bug: skia:
Change-Id: I190cb5d118b1f4b910984e4df50ee3351c8be895
Reviewed-on: https://skia-review.googlesource.com/c/195884
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-27 16:46:29 +00:00
Ben Wagner
ff84d8a900 SkTypeface::openStream to return smart pointer.
Change-Id: I2c936510e13561fcc9fd8343d5ab9f18c28c8340
Reviewed-on: https://skia-review.googlesource.com/c/195371
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-27 14:08:09 +00:00
Brian Osman
e5d532edae Particles: remove non-stable random, add better enum reflection
The other generator was never used (or useful). String-based serialization
of enums is quite helpful, though.

Bug: skia:
Change-Id: Ic9d58f8d20cfe7aba47722bd74f1e6f8f0f219e5
Reviewed-on: https://skia-review.googlesource.com/c/195368
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-26 20:29:56 +00:00
Florin Malita
f12d675179 [skottie] Shape blending mode support
Starting in v. 5.4.4, BodyMovin also supports/exports per-shape
blending modes.

Change-Id: I9827f1db11df207da62bfb0de724e62489ed9255
Reviewed-on: https://skia-review.googlesource.com/c/195365
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-26 18:48:25 +00:00
Brian Osman
0c48681e58 Few more particle features and some generalization work
Add particle "frame" enum, to allow effects relative to local, world,
or velocity. Remove the "orient along velocity" and replace with a much
more general orientation affector (angle curve + frame). Add an angular
velocity affector to mirror the behavior of the linear velocity affector.

Bug: skia:
Change-Id: Ibbaaeb352c9547d00d81c7916d00148dd65ed2b9
Reviewed-on: https://skia-review.googlesource.com/c/195361
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-26 15:56:24 +00:00
Kevin Lubick
8abc842945 [pathkit] fix perf
Docs-Preview: https://skia.org/?cl=195360
Bug: skia:
Change-Id: I4109810832b69a71960f6e619e32288ae8fa5023
Reviewed-on: https://skia-review.googlesource.com/c/195360
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-02-26 13:17:22 +00:00
Kevin Lubick
2722083cbe [pathkit][canvaskit] roll versions
This removes the buggy .then() constructor, primarily.

Docs-Preview: https://skia.org/?cl=195126
Bug: skia:
Change-Id: Ie20512267ce3f822eb0d68e71fc07f3d3245c1e9
Reviewed-on: https://skia-review.googlesource.com/c/195126
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2019-02-25 21:53:53 +00:00
Brian Osman
14a67a3a71 Change particle affector to work on N particles
This should severely cut down on the virtual call overhead when running
affectors. It also switches to model of "for each affector, do each
particle", rather than "for each particle, do each affector". This is
going to be an I$ improvement, and (if we ever care), make it possible
to do wide-mode threading of the affectors on disjoint blocks of
particles.

Bug: skia:
Change-Id: Ia4e8e8d461dba4e303c45766ea2b4ece1bca9196
Reviewed-on: https://skia-review.googlesource.com/c/195123
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-25 19:59:04 +00:00
Brian Osman
1b20cd8d30 Add "enabled" flag to affectors, fix curve interaction with stable random
Flag is helpful while editing things (and could be a useful property to
animate, as well). The curve change fixes a bug where the stable generator
gets out of phase if all segments of a curve don't use the same options.

Bug: skia:
Change-Id: Ie151e775aee22957e79fa88feaafad72b6c781ff
Reviewed-on: https://skia-review.googlesource.com/c/195120
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-25 19:39:23 +00:00
Florin Malita
bd64f18947 [skottie] Layer blend mode support
Introduce sksg::BlendModeEffect and use to wrap Skottie layers based on
their "bm" property.

Depending on the presence of non-trivial layer blend modes and the nature
of the destination buffer (fully transparent vs. unknown/pre-filled), we
may now need to render animation frames into a separate layer for correct
compositing.

Track the presence of non-trivial layer blend modes such that we only incur
this extra layer overhead when needed.  Also allow clients to pass a "drawing
to fully transparent buffer" hint such that we can avoid the extra layer even
when blend modes are present.

Change-Id: Iaf645878666da4349d0bef8890bbecad23a0aa9b
Reviewed-on: https://skia-review.googlesource.com/c/194840
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-25 15:48:07 +00:00
Kevin Lubick
867da4b96e Allow system harfbuzz.
This should allow shaper to run on the no-deps bot.

Change-Id: I2515875d4e9b428681c20877630b904c3229ecc5
Reviewed-on: https://skia-review.googlesource.com/c/194420
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-23 12:14:30 +00:00
Florin Malita
ef22907020 [sksg] Use luminance coefficients from SkColorData.h
TBR=
Change-Id: I2dc48f3d4e1ee1b873bd41ede5168191f69bde30
Reviewed-on: https://skia-review.googlesource.com/c/194427
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-22 23:31:50 +00:00
Florin Malita
a753d1a347 Reland "[skottie] Add tritone layer effect support"
This reverts commit 42ee4028a9.

Original change's description:
> Revert "[skottie] Add tritone layer effect support"
> 
> This reverts commit 71c70ea13e.
> 
> Reason for revert: broke WASM builds
> 
> Original change's description:
> > [skottie] Add tritone layer effect support
> > 
> > Generalize sksg::TintColorFilter into GradientColorfilter, to support
> > multiple color interpolation ranges.
> > 
> > Keep the two-color/single-matrix (tint) specialization, and use a table
> > color filter for the general case.
> > 
> > Change-Id: Idf42833462127c29fb69fe94337a1d1478b77dd9
> > Reviewed-on: https://skia-review.googlesource.com/c/194024
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> 
> TBR=fmalita@chromium.org,reed@google.com
> 
> Change-Id: Id5bd99701f74fbd4f54d0aca74e753b7ab88bdb3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/194429
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@chromium.org>

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

Change-Id: Ie7fc28ff784b91f01108415e50677e8982ccf858
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/194430
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-22 23:11:02 +00:00
Florin Malita
42ee4028a9 Revert "[skottie] Add tritone layer effect support"
This reverts commit 71c70ea13e.

Reason for revert: broke WASM builds

Original change's description:
> [skottie] Add tritone layer effect support
> 
> Generalize sksg::TintColorFilter into GradientColorfilter, to support
> multiple color interpolation ranges.
> 
> Keep the two-color/single-matrix (tint) specialization, and use a table
> color filter for the general case.
> 
> Change-Id: Idf42833462127c29fb69fe94337a1d1478b77dd9
> Reviewed-on: https://skia-review.googlesource.com/c/194024
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>

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

Change-Id: Id5bd99701f74fbd4f54d0aca74e753b7ab88bdb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/194429
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-22 21:51:13 +00:00
Florin Malita
71c70ea13e [skottie] Add tritone layer effect support
Generalize sksg::TintColorFilter into GradientColorfilter, to support
multiple color interpolation ranges.

Keep the two-color/single-matrix (tint) specialization, and use a table
color filter for the general case.

Change-Id: Idf42833462127c29fb69fe94337a1d1478b77dd9
Reviewed-on: https://skia-review.googlesource.com/c/194024
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-22 21:00:25 +00:00
Brian Osman
d5c57fe289 Add local vs world flag for particle velocity
Adjust reference frame for affector to be consistent (so angles are
counted clockwise from "up" in both local and world modes).

Bug: skia:
Change-Id: I643e1484bc0a58d1f1c0cfe35ac2ab37dc2ea409
Reviewed-on: https://skia-review.googlesource.com/c/194189
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-22 17:45:25 +00:00
Kevin Lubick
1ba9c4df77 [canvaskit] JS API in place for shaped text
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>
2019-02-22 15:39:55 +00:00
Florin Malita
b0604e5c46 [sksg] Hoist empty-bounds check to base RenderNode
Empty-bounds nodes should never render anything.

TBR=

Change-Id: Iaa216a1d49a4a81054bcae19c1fff5a85e543c50
Reviewed-on: https://skia-review.googlesource.com/c/193690
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-21 14:28:11 +00:00
Kevin Lubick
2031f34a77 [canvaskit] Upgrade emscripten to .27
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>
2019-02-21 14:13:00 +00:00
Florin Malita
48cc589886 [skottie] Tint effect support
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>
2019-02-20 22:42:00 +00:00
Brian Osman
d8e1ee9a66 Refactor particle age logic
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>
2019-02-20 19:55:20 +00:00
Brian Osman
125daa4d1a Refactor and further generalization of particle model
- 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>
2019-02-20 18:01:00 +00:00
Ben Wagner
b059194c08 Make SkShaper an interface.
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>
2019-02-19 22:06:47 +00:00
Brian Osman
e12e49920c Add comments to document SkCurve
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>
2019-02-19 21:01:57 +00:00
Brian Osman
23b96c0e23 First pass comments to document SkReflected.h
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>
2019-02-19 20:45:27 +00:00
Brian Osman
2991cbee62 Remove SkField, it's no longer used
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>
2019-02-19 16:08:42 +00:00
Ben Wagner
18ea3c70fb Add asserts to SkTextBlobBuilderRunHandler.
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>
2019-02-19 15:55:42 +00:00
Brian Osman
543d2e2f2e Moved image params out to SkParticleDrawable
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>
2019-02-15 20:07:43 +00:00
Hal Canary
1b85323f10 ICU: enable on wasm
Change-Id: I0647f641d4716af39f4afb832cfcc9fa7d571880
Reviewed-on: https://skia-review.googlesource.com/c/192832
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-15 18:14:43 +00:00
Brian Osman
112aa2d22e Add curve visualization back, guard eval
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>
2019-02-15 16:24:43 +00:00
Brian Osman
8b6283fc98 New SkCurve type with multiple curve segments
- 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>
2019-02-15 14:10:39 +00:00
Ben Wagner
2fe1e23c58 Fix signed/unsigned mismatch in shaper assert.
Change-Id: I05e0e3f5940281b8c9fdcbabf6d8c1013bfa48d4
Reviewed-on: https://skia-review.googlesource.com/c/192824
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-14 22:38:37 +00:00
Ben Wagner
84cc4616df Fix assert in shaper.
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>
2019-02-14 22:16:43 +00:00
Ben Wagner
83597ce581 Remove typeface from SkShaper constructor.
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>
2019-02-14 21:41:28 +00:00
Ben Wagner
f61c936670 Add HarfBuzz callbacks.
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>
2019-02-14 21:28:38 +00:00
Ben Wagner
b9cc1c6bc2 Fix calculating clusters from start of input.
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>
2019-02-14 21:23:38 +00:00
Brian Osman
5c1f8eb094 Various particle system improvements
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>
2019-02-14 20:19:08 +00:00