Commit Graph

525 Commits

Author SHA1 Message Date
Florin Malita
0f11e115d7 [skottie] Fix motion blur asserts
MotionBlurEffect makes use of many abilities some consider to be
unnatural.  Notably, it mutates the state of its subtree at render time
(gasp) to sample various time points.

Mutation triggers scene graph invalidation, which bubbles up the
ancestor chain.  While we immediately revalidate the subtree, we
cannot do the same for ancestors (no full scene knowledge).  This means
post-rendering, we leave some SG nodes dirty - which triggers various
debug asserts).

The easiest fix is to temporarily suppress invalidation bubbling at the
MotionBlurEffect node level (this is safe, because we always revalidate
the subtree).

Also add a post-render assert for tighter state validation.

Change-Id: I376b7a8880f71d85e595c419334b42bc4720ac65
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243420
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-09-23 17:34:42 +00:00
Kevin Lubick
6b921b7e4a [canvaskit] add support for SkAnimatedImage
Also adds tests for static png,jpg,gif

Was unable to simply expose drawDrawable because the JS
side of things does not understand inheritance (specifically,
it doesn't know what is a descendant from SkDrawable).

Change-Id: I6a833c93f22ef90ae12e901168ff428e20504209
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242562
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-09-20 18:34:01 +00:00
Brian Osman
1ec1e3c55e Use 64 bit shift to make MSVC happy
CQ_INCLUDE_TRYBOTS=skia.primary:Build-Win-MSVC-arm64-Debug,Build-Win-MSVC-x86_64-Debug
Change-Id: I381da9c2b2e9b98bc50e8d80ead10ad048e50fce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243036
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-09-20 13:44:00 +00:00
Mike Klein
f51e1fd37d raster 8888 pow2 samples hack
The gist here is to use saveLayer() to create a buffer to draw each
subframe into, but not actually use it to draw anything at restore()
time, hence, canvas->clear(0).  (SkCanvas sniffs out cleverer approaches
like 0 alpha or SkBlendMode::kDst.)

Instead, we accessTopLayerPixels() and slurp the subframe out into a
16-bit accumulator, then when all subframes have drawn and accumulated
there, one more saveLayer() and accessTopLayerPixels() lets us put them
back, shifting back down to 8-bit.

The hot parts of the profile are drawing the frames themselves, then the
accumulate / repack code in renderToRaster8888Pow2Samples().

  $ time out/skottie_tool -i ~/Downloads/mb/data.json -w bar
  Before: 28.39user 1.14system 0:29.54elapsed
  After:  22.08user 1.12system 0:23.21elapsed

    I'm not proud of it.
    ...
    ...
    ...
    I am a bit!

Now using one layer.

Change-Id: I241529fad4c5b55c6abc55793f2d9c9693a03c18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242853
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-09-20 03:53:08 +00:00
Robert Phillips
ea1b30b57b New proposed syntax for SkColorTypes
Everything except for SkImageInfo.h is mechanical

Change-Id: I2d775c79467fb15f6022e80d21b4a9151272fe2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242896
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-19 20:42:55 +00:00
Brian Osman
9a8b846baf Particles: Sub-effect spawning and some slight refactoring
* Added a new binding type, SkEffectBinding. This stores another
  entire effect params structure (so the JSON is just nested).
  The name is a callable value that spawns a new instance of
  that effect, inheriting the parameters of the spawning effect
  or particle (depending on which kind of script made the call).
* Broke up the monolithic update function into some helpers,
  got some code reuse with the script calling logic.
* Unlike particle capacity, there is no upper limit on child
  effects (yet), so it's easy to trigger runaway memory and
  CPU consumption. Be careful.
* Added death scripts to effects and particles, which are a
  common place to want to spawn sub-effects. Like spawn,
  these run on each loop, but for one-shots they play at the
  end. Even with loops, this is helpful for timing sub-effects
  (see fireworks2.json).
* Finally, added a much more comprehensive example effect,
  raincloud.json. This includes a total of three effects, to
  generate a cloud, raindrops, and splashes when those drops
  hit "the ground".

Change-Id: I3d7b72bcbb684642cd9723518b67ab1c7d7a538a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242479
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-19 15:18:13 +00:00
Robert Phillips
17a3a0bda9 Last tranche of new SkColorTypes
This CL adds:
    kAlpha_F16_SkColorType
    kRG_F16_SkColorType
    kRGBA_16161616_SkColorType,

which should be it for a while.

Bug: skia:9121
Change-Id: I81b9d46a202a76e9b7d7ca86495d72dbdae32576
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241357
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-18 18:23:29 +00:00
Mike Klein
8dc7d6cb30 faster PNG encoding in skottie_tool
This trades a bit of file size for CPU time spent encoding,
making Skia dominate the profile.  Most of our other tools
use these same settings for the same reason.

Before:
    $ time out/skottie_tool -i resources/skottie/skottie-text-animator-4.json -w bar; du -sh bar
    1.53user 0.82system 0:02.35elapsed
    1.3M	bar

After:
    $ time out/skottie_tool -i resources/skottie/skottie-text-animator-4.json -w bar; du -sh bar
    0.49user 0.81system 0:01.31elapsed
    1.7M	bar
Change-Id: If00ca43d49e3f12d2e34e1a2b8e15158e6a76034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242498
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-09-18 16:10:23 +00:00
Kevin Lubick
dd0dff1c35 [canvaskit] roll to 0.7.0
Change-Id: I1854059b48b791c5408a1919fdc500772749c283
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242416
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-09-18 12:21:46 +00:00
Ben Wagner
0033008d95 Properly subset the run in ShapeThenWrap.
The previous code always reported the runs on the lines as being full
runs even when they were actually partial runs.

Change-Id: Icc746a7bdeebdde6c4979d8cb438426d21246d57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241881
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-09-17 19:24:07 +00:00
Brian Osman
d1846d85ad Update SkParticleEffect comments based on review feedback
Change-Id: I3436ee95c4cc13067b53b170515fd10c19b329b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242136
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-09-17 18:10:00 +00:00
Kevin Lubick
556d00eaad [canvaskit] Add test for skottie to catch framebuffer issues
Would have helped notice
https://skia-review.googlesource.com/c/skia/+/241757
when Gold results changed.

Change-Id: I0c7b75a7c6cd5d9952eb98056c98b1118471c330
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241763
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2019-09-16 18:49:50 +00:00
Brian Osman
d46cb9729b Particle effect scripting update
This change adds another layer of complexity and control to
the particle system. There are now two code chunks: the old
code that's run per-particle, and new code that's run for
the effect itself. This allows for effect lifetime to be set
by the script (eg, randomly), as well as the emission rate.
Rate can vary over time (see pulse.json), and particles can
be emitted in bursts by setting the effect's burst field
(see fireworks.json).

Additionally, the effect has its own frame of reference and
color, which becomes the default state for newly emitted
particles. This allows synchronizing state across particles
in various interesting ways (see color in fireworks.json).

Change-Id: Iec2f7a3427ce1d6411ed7ef5b3023cbef2e8a134
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240498
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-16 17:48:04 +00:00
Mike Reed
4241f5e0a8 Revert "add guard to switch to SkPathTypes"
This reverts commit e1af44498b.

Reason for revert: breaking google3?

Original change's description:
> add guard to switch to SkPathTypes
> 
> Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: If1fffb6310921ee6f213af000da793afcf62ab0b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241560
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-14 19:13:44 +00:00
Mike Reed
e1af44498b add guard to switch to SkPathTypes
Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-14 01:26:38 +00:00
Kevin Lubick
d372934c42 [canvaskit] expose SkColorFilter and add SkColorMatrix helpers
of note, this is kjlubick's 2^9 = 512'th commit into the Skia repo.

Change-Id: I635cb1db6812217358ab138cd833c0c61f676232
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241037
Reviewed-by: Mike Reed <reed@google.com>
2019-09-13 14:09:03 +00:00
Florin Malita
eec0199e15 [skottie] Avoid reshaping text unnecessarily
Only call into SkShaper when the text value changes.

Change-Id: I4c44a20fd48be932f9ffe23af5ebcc12b67956ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241077
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-09-12 21:18:37 +00:00
Robert Phillips
429f0d380c Add kRG_1616 and kAlpha_16 SkColorTypes
This also switches GrColorType::kR_16 to kAlpha_16 to more closely match raster.

Bug: skia:9121
Change-Id: I03c6e6c52c90aa4223478c5ea6c8b2ed8558f677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239930
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-12 12:20:09 +00:00
Kevin Lubick
50f377e275 [canvaskit] expose ComputeTonalColors
Change-Id: Ia4f0eec8e162ad273e856c04ca98c7e2cb48935e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240693
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-09-11 19:44:51 +00:00
Kevin Lubick
7d644e182e [canvaskit] expose all 8 radii for RRect
Change-Id: I537bda18a588c9db5b0f3ea17203bb1daab0feb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240689
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-09-11 19:02:33 +00:00
Robert Phillips
d470e1b905 Add kRG_88_SkColorType
Bug: skia:9121

Change-Id: Id2a12a5d607b84ce393d2b58233bf8e23f646059
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235797
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-06 17:55:26 +00:00
Julia Lavrova
166751ef57 Fix for the build
Change-Id: I3da068d09d31f2c05d499f32dedbe14108b5652c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239107
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-09-04 21:59:09 +00:00
Julia Lavrova
526df26b03 Reshuffling bidi regions + empty text sizes + some font resolution bugs
Change-Id: Icc0d688985de7253f3113e5c9657544f68b4e01d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236217
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-04 20:42:15 +00:00
Florin Malita
e359aa35d1 [sksg] Fix mask/context overrides interaction
We're currently letting render context overrides (opacity, color
filters, blend mode, etc) spill down the descendent/mask content
tree.

This is not ideal, as mask content isolation breaks atomicity
assumptions for deferred overrides.  Case in point: motion blur uses
SkBlendMode::kPlus to accumulate content "layers" - but since mask
content gets rendered into a separate layer, it fails to produce the
expected result.

The fix is to realize all context overrides on the top-level mask layer
(we already allocate this layer, so there's no reason to defer
downstream anyway).

Change-Id: Icbb7e403f90feecfae5846697f559a03d8aa4097
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239036
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-09-04 14:09:44 +00:00
Kevin Lubick
2e5fe35044 [canvaskit] Add rrect support
Change-Id: Ic9f2c0224b95e277df93a1d46e59a1096d8005b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238896
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-09-03 18:00:16 +00:00
Florin Malita
2e4c283f78 [skottie] Clean up TextAdapter
Convert to DiscardableAdaptorBase, drop unneeded TextAnimatorList
wrapper, switch to raw pointer lambda captures.

TBR=
Change-Id: Idd43ad89a299ff344ff539b87cfb7790fef10b2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238441
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-09-03 15:29:36 +00:00
Florin Malita
f49cd70119 [skottie] Plumb square selector "smoothness" prop
Requires https://github.com/bodymovin/bodymovin-extension/pull/22

Change-Id: I2614aeefce18f4b3e6c6373cd5503a7696253a76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238436
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-09-03 15:08:14 +00:00
Brian Osman
61e17c51ad Particles: Change effect lifetime logic to work like particles
Change-Id: I9f71bfbd506b56eae4fe6a430b70f8f9a31d7009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238445
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-03 13:56:39 +00:00
Florin Malita
93edd9eb44 [skottie] Discard unneeded static text animators
Change-Id: I8751b1b1193726849e6ed3f127e32c17b8a7ed6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238443
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-08-30 21:09:08 +00:00
Brian Osman
33f9d69353 Pass SkPaint by const-ref to SkParticleDrawable
Makes it clearer that this isn't optional, for drawables that route to
similar canvas calls.

Change-Id: I12142c11676ba6baeea3e2779ec05af601d8beb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238440
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-30 19:03:36 +00:00
Brian Osman
2aa85df8e7 Particle cleanup: split SkParticleBinding out of SkParticleEffect
Also simplify type registration.

Change-Id: Ia47febb2ae2cd5821476c3dd33a688b688aa6d6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238359
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-08-30 15:32:38 +00:00
Brian Osman
575699569e Update sample particle data in canvaskit demo
Change-Id: Ia55ed099c9b7d3896b29d51dafce11a518a0bdf9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238122
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-08-30 12:19:58 +00:00
Florin Malita
165ca3f85b [skottie] Text selector ease-high/ease-low support
Change-Id: Ia879868df677cabca6d5fcd09845efdb6147ee8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238177
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-29 21:34:10 +00:00
Florin Malita
a58bbee8f7 [skottie] Refactor/generalize text selector shape generators
The main motivation for this change is getting *all* shape generators to
run the ramp through a cubic mapper - this will allow adding
ease-in/ease-out support in a follow up CL.

As a bonus, the new implementation is more straightforward and concise
(at the expense of dropping some likely-premature optimizations).

Change-Id: Ia2bc53525ae529c35300be124220b4d61e4fc474
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238061
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-29 18:56:23 +00:00
Brian Osman
8a97782956 Move common particle code to an automatically-injected header
Change-Id: If99e1802c8187ebd98b67717d744c6695bb25900
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238118
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-29 18:49:33 +00:00
Hal Canary
b1f411ac05 tools/skui: put all enums in a common namespace
Change-Id: Icd331e8946d80652750b8b6ea0db65f5f676ac3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238058
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-29 15:39:32 +00:00
Hal Canary
63b4d5880a SkPlainTextEditor/app: cycle typeface with ctrl-0
Change-Id: I0bcf38b0ec75a52df856948a85e5711a68e6585e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237430
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-28 15:55:36 +00:00
Kevin Lubick
556df5b860 [canvaskit] Fix duplicate gold name
Change-Id: Ic62f44d20ff7ceba111260841d64322d1b6610f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237802
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-08-28 13:56:46 +00:00
Florin Malita
511d2c281c [skottie] Disable text baseline snapping
Change-Id: I51ba09c78d200986a3116774f5dfd3a02bb597e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237523
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-08-27 21:24:21 +00:00
Hal Canary
a0b66fc79d SkPlainTextEditor: from experimental to modules
Change-Id: I8896283ee3a57af926a43f6647e27059d52dd7a8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237146
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-27 20:32:19 +00:00
Mike Klein
334a642b20 remove unused sk_sp comparison operators
These unused comparison operators are the only users of
<functional> in SkRefCnt.h, for std::less.  <functional>
is an expensive header to compile, and SkRefCnt.h is popular,
so it helps to cut dependencies like this.

Mostly we just need to add #include <functional> in a few
places that were picking it up via SkRefCnt.h.

In SkPixmapPriv.h, it looked simpler to template the argument,
since everything was inline anyway.

Change-Id: I7c125bb26a04199847357c729a1b178256c6ef8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236942
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-27 14:52:01 +00:00
Shachar Langbeheim
ebe48959ee compile.sh: Use emar in order to bundle libraries.
This is necessary in order to use emscripten's new compiler, as
described here:
https://bit.ly/2ZlwQmz

Change-Id: I66e0a6e4e403b7a9ba94860ea9cc7e53027d6f46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237396
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-27 13:33:20 +00:00
Mike Klein
48e08aa973 <ostream> -> <iosfwd>
<ostream> is one of the more expensive headers to include
and that's amplified by SkRefCnt.h's popularity.

We've been including <ostream> for sk_sp's operator<<.  That's only
used by Chromium and while we could just sprinkle in a bunch of .get()
calls and remove operator<<, when I started going through and actually
doing that I got the feeling I was making things pointlessly harder to
read and write, and wanted to find a way to make it actually work.

My next instinct was to template it without mentioning ostreams,

    template <typename OS, typename T>
    auto operator<<(OS& os, const sk_sp<T>& sp) -> decltype(os << sp.get()) {
        return os << sp.get();
    }

but that makes this operator<< ambiguous with some other templated operator<<
in GTest.  They got in first, so they win...

So ultimately, switch <ostream> to <iosfwd>.   Anyone using our
operator<<() presumably has <ostream> included already, and the #include
cost for <iosfwd> is small enough that I don't think we'll mind keeping
this around indefinitely.

To repro, look at before/after of -ftime-trace:

    ~/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++ -I. -Os -c src/core/SkCanvas.cpp -ftime-trace

I have tested locally that Chromium builds with this change.

Change-Id: I9decc2e65b5cc8fd07d8106a5eff81901aedd7d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237190
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-08-27 13:08:56 +00:00
Kevin Lubick
e384df4f5e [canvaskit] Add sundry APIs and tests
To the reviewer: I've tried to make it so each PS adds one new API.

Change-Id: I81fc85c7a93a19ce4fd725a125e138d35471e693
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237155
Reviewed-by: Mike Reed <reed@google.com>
2019-08-27 12:35:49 +00:00
Florin Malita
3c8f9cb45d [skottie] Harden motion blur
1) don't attempt to attach the effect when the layer is null

2) sksg::onRender can receive a null context - handle it gracefully

TBR=

Change-Id: I4fae08b15d448849c7c99b17df6811ad31f190c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237276
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-27 00:21:12 +00:00
Mike Reed
92b33354dd more rect api simplifications
set --> setLTRB
set(pts, count) --> setBounds

Bug: skia:9328
Change-Id: I807c0598a8b23b2f721db118ec41c1607114205a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237038
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-25 10:12:57 +00:00
Florin Malita
8828a731d8 Revert "[canvaskit] Optimize CK builds for size"
This reverts commit a3094a55fe.

Reason for revert: significant slowdown, perf bot timing out.

Original change's description:
> [canvaskit] Optimize CK builds for size
> 
>   canvaskit.wasm:   6855515 -> 5445330
>   canvaskit.wasm.gz 2554712 -> 2189897
> 
> Change-Id: I9749cf8dc66e08eb95c2f996d5b631d5fcdff342
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229078
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>

TBR=mtklein@google.com,kjlubick@google.com,fmalita@chromium.org

Change-Id: I34569bdc935b9e73b6e916fe029b871fb86ebb3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236496
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-22 20:09:38 +00:00
Florin Malita
a3094a55fe [canvaskit] Optimize CK builds for size
canvaskit.wasm:   6855515 -> 5445330
  canvaskit.wasm.gz 2554712 -> 2189897

Change-Id: I9749cf8dc66e08eb95c2f996d5b631d5fcdff342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229078
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-22 17:45:09 +00:00
Brian Osman
badfe7a43e Enable SkSL interpreter in CanvasKit to get particles working again
Change-Id: I24a9aa04c423cc92204a9b2eb9dca9e61a1ee639
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236336
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-22 14:45:59 +00:00
Julia Lavrova
a40db4240e Bug fixes for Flutter
Change-Id: Ic71e377290acc8a1b4cf62c52b3cc760c31dbb3b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235802
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-08-21 19:22:10 +00:00