Commit Graph

548 Commits

Author SHA1 Message Date
Ben Wagner
1ca50524c4 Allow better font fallback.
The intent is to allow the creation of a MakeFontMgrRunIterator which
uses the passed font's typeface as the primary typeface, but uses a
given family name and style as for the request for fallback fonts. This
allows the user to provide the actual request for the primary typeface
as opposed to making a request based on the resolved primary typeface
(which may not be the right thing to do).

To support this, the selection of language for fallback is also added.
Since this information is already in the language iterator, this change
makes the font iterator the lowest priority iterator for consume,
allowing the font iterator to rely on the current value of the language
iterator to provide the language.

In order to allow these changes to be exercised, this also adds a few
generic 'Make' methods for bidi and script. These new methods will use
the best available implementation. These are needed since the most
capable implementations may not always be available (such as on our
testing ios builds).

Change-Id: I1b8d9c9007058adcb2a26e0581d903b835a6118f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245460
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-10-02 22:19:13 +00:00
Florin Malita
e3e4b0cfc1 [skottie] Fix motion blur glitches around domain edges
For motion blur we're sampling within some window around a given t.

If t is close to the layer in/out point, things get murky: for samples
which fall outside the layer lifespan, we skip drawing => fewer samples
are accumulated => the opacity of the result drops => visual glitches.

The solution is to modulate the frame alpha based on the number of
*visible* samples, and skip rendering when no samples are visible.

Bug: skia:9486
Change-Id: I8d9692ae1589b43d9e6f728d7b7ac2fbf39153fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245363
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-10-01 17:25:12 +00:00
Brian Osman
9b8b4558d2 Change ByteCode and ByteCodeFunction to classes
The lack of encapsulation was finally starting to bother me. Had to
change the Interpreter namespace to a struct so that it could be
friended, but otherwise this was a nice and simple cleanup.

Also updated the comments on the two run functions, and renamed
fInputSlots to fUniformSlots, to reflect recent clarification
around in vs. uniform.

Change-Id: I24bbc59778b3ab6448bffcf98133d5c149a060a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244883
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-30 18:02:24 +00:00
Ben Wagner
89e1f600ec Improve implementations of copyTable.
The CoreText version relies on undefined behavior and the DirectWrite
version makes an extra copy of the data. This fixes several issues
introduced in https://skia-review.googlesource.com/c/skia/+/229384 .

Change-Id: I29a2170465bafcf6fe7ae5ad107e85a9e882bd33
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244721
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-09-30 14:55:44 +00:00
Kevin Lubick
7aeabcfa6a [SkParagraph] Require len if using addText(const char*)
Bug: skia:9469
Change-Id: Ie3ae11db9be4b1cf1645e8db0bf29dc8e59bc4cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244877
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-29 11:39:34 +00:00
Florin Malita
26013e93b5 [skottie] Minimize top layer size
Limit the optional/top layer size to the dest area.

Change-Id: Ic3825ff3c12d87b01f18f52ea60bfc31710e2272
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244885
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-09-27 19:29:50 +00:00
Florin Malita
4122c4d23a [skottie] Fix skottie_tool anim null check logic
Pre-compute the scale matrix based on the main thread animation size,
to avoid touching thread-local animations before null-checking.

Change-Id: Ib2b91d9db7d60a1bd31b21972de136fd838b8377
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244836
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-09-27 15:24:46 +00:00
Brian Osman
b23d66e10a Interpreter: Lots of minor cleanup/refactoring
- Update the parameter lists to both run and runStriped so
  that they're in the same (sane) order, named consistently,
  and always take counts with pointer arguments.
- Add the same count-based safety checks to run that were
  already in runStriped.
- Remove the N parameter to run, it was only used to run
  things one-at-a-time (other than one spot in unit tests),
  and it simplifies the code quite a bit. If you want to run
  multiple times, use the striped version. I also moved that
  functions 'N' earlier in the parameter list, to make the
  pattern of the remaining parameters clearer.
- Remove an interpreter benchmark class that was never used.

Change-Id: Ibff0a47bdb2d29d095a0addd27e65ab13cb80fce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244716
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-27 15:02:16 +00:00
Kevin Lubick
ffbfe87887 [canvaskit] remove debugging code
By passing null into reportSurface, it "crashes" the test, allowing me
to visually inspect the results while running locally. However, on
production code, it just breaks the tests.

Change-Id: I93339f03ee5a9f86959b30353912526a442f6375
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244677
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-09-26 20:13:21 +00:00
Kevin Lubick
61887c7b88 [canvaskit] Create SkFontMgr from passed in data
This repurposes much of our embedded SkFontMgr code
to take in data directly instead of from compiled-in
variables.

Also makes no_font and no_embedded_font work better.

Bug: skia:9469
Change-Id: Ibde49c9a448cfca79c5712aa9abbe15997a163d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244510
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-26 19:27:12 +00:00
Ethan Nicholas
31cff27607 Revert "Revert "remove 'in uniform' support from GrSkSLFP, make rules more clear""
This reverts commit 85705c1b3b.

Change-Id: If189dafce53491728296a4292c76af55b05835ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244509
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-26 18:11:45 +00:00
Kevin Lubick
16d998f24b [canvaskit] fix null terminator on drawText
Bug: skia:9314
Change-Id: I09449276b687caf8397c901b391cb882537ef5d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244498
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-26 17:26:03 +00:00
Florin Malita
49c0732570 [skottie] Add null sink option for skottie_tool
Useful for excluding encoder/IO from scaling tests.

Change-Id: Ib76cc07a54d3cd3e00b4a3b3c9ea6f049440b7f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244396
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-09-26 16:11:14 +00:00
Ethan Nicholas
85705c1b3b Revert "remove 'in uniform' support from GrSkSLFP, make rules more clear"
This reverts commit ac18a5ca60.

Reason for revert: breaking Chrome roll

Original change's description:
> remove 'in uniform' support from GrSkSLFP, make rules more clear
> 
> Bug: skia:
> Change-Id: Iaa4d33c1bfb295d87343411ba6aacc8fae68ef9c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244300
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=brianosman@google.com,ethannicholas@google.com

Change-Id: I6e53f5197c751d961abfa21861b940d4168de213
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244508
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-26 16:04:26 +00:00
Florin Malita
fbe61189f6 [skottie] Minor MotionBlurEffect cleanup
Change-Id: I9d02ff9f6bcc86cdc10e01a4e3379014557172e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244507
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-09-26 16:01:44 +00:00
Ethan Nicholas
ac18a5ca60 remove 'in uniform' support from GrSkSLFP, make rules more clear
Bug: skia:
Change-Id: Iaa4d33c1bfb295d87343411ba6aacc8fae68ef9c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244300
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-26 14:05:10 +00:00
Mike Klein
1585d7e108 opt skottie_tool into thread-local strike caches
I think this is largely free win if done once at process startup:

    $ time out/skottie_tool -i ~/Downloads/mb/data.json -w before
    166.59user 29.42system 0:06.13elapsed 3195%CPU (0avgtext+0avgdata 1994888maxresident)k

    $ time out/skottie_tool -i ~/Downloads/mb/data.json -w after
    93.36user 34.96system 0:04.76elapsed 2690%CPU (0avgtext+0avgdata 1968568maxresident)k

    $ idiff before after
    1333 files are identical.

Change-Id: I5454aed5e64bf78d61dfdc22ea1ce629714bd70c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244120
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-09-25 16:57:56 +00:00
Mike Klein
5e6d36ac3e dump frame time stats in skottie_tool
$ time out/skottie_tool -i ~/Downloads/mb/data.json -w after

  Animation loaded with 2 errors, 0 warnings.
    !! Could not create typeface for Google Sans|Bold.
    !! Could not create typeface for Google Sans|Medium.
  frame time min 28ms, med 286ms, avg 441.18ms, max 1982ms, sum 264708ms
  93.74user 33.03system 0:04.70elapsed 2694%CPU (0avgtext+0avgdata 1976980maxresident)k

Things are looking pretty reasonable scaling-wise when we take ~5
seconds to run and some frames take up to ~2 seconds.

Change-Id: I0bfd955afcd9b8ac18e6614e1b5aa6889a06059a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244121
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-09-25 16:13:29 +00:00
Brian Osman
559ffe4a23 Particles: Added particle flags for tracking state (one-time triggers, etc)
Also removed some older effects that weren't interesting, improved others,
cleaned up the unused functions in several, and renamed most of them to
reflect which feature they're demonstrating.

Change-Id: Ib44a00ec3d25e852a1d1661918137ba13d30c86b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244119
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-25 15:58:09 +00:00
Florin Malita
01acb12110 [skottie] Disable skottie_tool on iOS
No thread_local support.

Change-Id: I8f22b237e099f36992da3483e06ae22ba3cd6de0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243625
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-09-24 22:27:10 +00:00
Shachar Langbeheim
497365778e Compile CanvasKit without -fPIC, for latest emscripten compatibility.
Due to an issue in emscripten's latest-upstream compiler (link below),
Skia's libraries can't be built using -fPIC. This change allows users
to opt-out of using -fPIC during compilation, and sets compile.sh to
opt-out accordingly.
https://github.com/emscripten-core/emscripten/issues/8995
https://github.com/emscripten-core/emscripten/issues/9317

Change-Id: I25b6e185b58ab1ba8263f2e2f450591f6025f62c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243317
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-09-24 20:19:02 +00:00
Florin Malita
052837c3d2 [skottie] Tweak skottie_tool --threads meaning
There's an implicit +1 to the SkTaskGroup worker count, as the
main/scheduling thread also participates in the queue.

This is quite confusing.

Adjust the --threads parameter such that 1 means single threaded,
2 means rendering on two threads, etc.

Change-Id: Ib55c4b0a29cb342c7d18a15384e1c511614ee7af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243740
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-09-24 19:54:02 +00:00
Florin Malita
c245673402 [skottie] Multi-threaded skottie_tool
Parallelize frame rendering and encoding:

  - introduce a caching/pre-decoding resource manager.

  - dispatch individual frames to a task group

  - use per-thread animation instances and sinks


Change-Id: I91549ed20e3346c445defa0d8734648f8a89f8df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243659
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-09-24 18:29:09 +00:00
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