Commit Graph

1320 Commits

Author SHA1 Message Date
Tyler Denniston
62a683e476 [svg] Prep work for filter primitive subregion
- Add primitiveUnits attribute to SkSVGFilter class
- Add optional x, y, width, height attributes to filter effect base
  class (SkSVGFe)
- Add function to return list of inputs for all filter effects
- Add function to compute filter primitive subregion and use it in all
  filter effect classes.

Currently the "primitive subregion" just returns the entire filter
effect region, so there should be no diffs on gold with this change.

Bug: skia:10841
Change-Id: I1de283bebe302c0710d6b09d62a2472787820a49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343107
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-11 18:21:21 +00:00
Tyler Denniston
b2d1a3bdd7 [svg] Minor cleanups
- Consolidate SVGColor resolution into one method in render context, now
  that it's a shared type.
- Remove all instances of `~TypeName() override = default;`. The only
  thing this provides is slight/unreliable protection against someone
  inadvertently removing 'virtual' from the base class destructor. In
  our case that is SkRefCnt, which I'm assuming has very low risk of
  that happening.
- Clean up some .h copy/paste issues of the form
  `#endif  // Typename_DEFINED`

Change-Id: I67fb40b2828b010fb7fdd83046bc1eae1a476267
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343421
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-11 16:25:20 +00:00
Tyler Denniston
8ed044363f [svg] Add feFlood filter node
Several related W3C tests still won't pass until we implement the filter
primitive subregion.

Bug: skia:10841
Change-Id: I9e4beb9da8aa769f23a979ad5116a38fcda85ca4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343105
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-11 15:02:20 +00:00
Kevin Lubick
f7fdf1aa29 [canvaskit] Add API for deleting webgl ctx
Change-Id: I55e70cc1ae6b16d642dd63170e9402bd3c192d5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343101
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-11 12:29:17 +00:00
Mike Reed
b86cd3d3f0 Use samplingoptions in imageshader
Change-Id: I7d94fe7aed702afd0626a40db201caaf7c2a7764
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342927
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-12-10 21:59:19 +00:00
Jason Simmons
6d14f3841d Reland "Cache text blobs computed by TextLine::paintText"
Change-Id: If166d7a2b287774054f833ac0f7b564bbcac9fa8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342936
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2020-12-10 19:03:19 +00:00
Florin Malita
8655eab56c [skottie] Add text colorization GM
Expand existing SkottieColorizeGM to also handle text properties and
add text-focused instance.

Update layer names in one of the json assets to match expected demo
prefix ($).

TBR=
Change-Id: I076229067523fe597be66c611a8653897f995bc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342916
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-12-10 17:10:48 +00:00
Mike Klein
2e9a03ec11 Revert "Cache text blobs computed by TextLine::paintText"
This reverts commit ff7bfea4ab.

Reason for revert: several broken bots, e.g.

../SRC/skia/modules/skparagraph/src/TextLine.cpp:309:21: error: non-const lvalue reference to type 'skia::textlayout::TextLine::TextBlobRecord' cannot bind to a temporary of type 'void'
    TextBlobRecord& record = fTextBlobCache.emplace_back();
                    ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Original change's description:
> Cache text blobs computed by TextLine::paintText
>
> Change-Id: I7d4414fb64b14a714623e4c20199cab06e6ed18c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342297
> Commit-Queue: Jason Simmons <jsimmons@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>

TBR=jsimmons@google.com,jlavrova@google.com

Change-Id: I467c61eead7b0d8c190cb2f883b05537de97a08e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342856
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-10 13:28:09 +00:00
Jason Simmons
ff7bfea4ab Cache text blobs computed by TextLine::paintText
Change-Id: I7d4414fb64b14a714623e4c20199cab06e6ed18c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342297
Commit-Queue: Jason Simmons <jsimmons@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2020-12-10 01:11:37 +00:00
Tyler Denniston
04e03bc181 [svg] Convert stop-color and stop-opacity to presentation attrs
These are somewhat the first presentation attributes of their kind,
in that they are non-inherited but also not applied via canvas layers.

Implementation-wise the main difference is that these attributes are
not propagated through the fInherited field of the render context's
presentation attribute list.

Change-Id: I0909507b0ecbd21732b3f80c46a343f5a0a9bf7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340661
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-09 21:37:17 +00:00
Tyler Denniston
7416571f4e [svg] Split out SkSVGColor from paint
This color type will be shared in paint, stop-color, and flood-color
attributes (mainly so they can use 'currentColor').

Change-Id: Ib4200ea729a91a0db5da069c68d64e5e8e3f5010
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340617
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-09 21:28:07 +00:00
Florin Malita
9c1f1be078 [svg] xml:space support
Add xml:space attribute and implement related white space filters.

(https://www.w3.org/TR/SVG11/text.html#WhiteSpace)

Bug: skia:10840
Change-Id: I52fda50fae1cd7cf8b0dd7c1a2ee2e667ffa947b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342299
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-09 20:07:25 +00:00
Florin Malita
7dc984aff0 [svg] Text shaping and layout
Introduce proper text shaping via SkShaper/drawTextBlob (to replace
SkTextUtils::DrawString).

Also add basic text layout support (text chunk alignment and default
fragment advances -- see [1]).

[1] https://www.w3.org/TR/SVG11/text.html#TextLayoutIntroduction

Bug: skia:10840
Change-Id: I246f899d2926d1e365dac06b414c8e1ab4371e1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341736
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-08 20:48:43 +00:00
Mike Klein
cdd6cced45 quiet SkParagraph non-tests
These print out all the time when I'm testing things locally.  :/

Change-Id: I110a80c5b59c3fa024bee99f1516853b1dfd05d9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341797
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-08 18:40:42 +00:00
Florin Malita
512ff75a0b [svg] Initial <tspan> support
Introduce classes to support text node nesting:

  - TextContainer -- base class for nestable text containers
    (<text>, <tspan> etc)
  - TextLiteral -- actual text string/payload

Example structure mapping:

  <text>Foo<tspan>Bar</tspan>Baz</text>

  TextContainer[text]
    TextLiteral["Foo"]
    TextContainer[tspan]
      TextLiteral["Bar"]
    TextLiteral["Baz"]

Also add text layout state (SkSVGTextContenxt) to SkSVGRenderContext.
This will be used to track layout across a text subtree.

For now we don't touch rendering, so the output is quite garbled for
non-trivial text (no advance propagation -> things draw on top of each
other).

Bug: skia:10840
Change-Id: Ic6d3990ec8635b586f5d3d226be070fbf134e391
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341236
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-12-07 15:29:19 +00:00
Kevin Lubick
f3b959c000 [canvaskit] Respect Exif metadata for animated images.
Change-Id: I58a5095ea3314a21d895f34a4b8cab9484c29b1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340717
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-12-07 11:10:07 +00:00
Kevin Lubick
e7c1a731ff [canvaskit] Remove 2d point arrays from API.
I kept in an array of Color (Float32Array) because it's very convenient
and not worth the hassle of removing.

Change-Id: I34c430c2b5112b6d073b049a81994e946428f21c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340797
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-07 11:09:49 +00:00
Julia Lavrova
b42686ad01 Painting styled text blocks in RTL
Bug: skia:11017
Change-Id: I13bd210a0d38614bab4a5a98c4507150043224cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340317
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-12-03 21:51:40 +00:00
Florin Malita
38921cafe1 Reland "[skottie] Add image sampling and transform options"
This reverts commit b81842aa28.

Reason for revert: reland with fixes

Original change's description:
> Revert "[skottie] Add image sampling and transform options"
>
> This reverts commit 2f24405250.
>
> Reason for revert: broke Win/shared 
>
> Original change's description:
> > [skottie] Add image sampling and transform options
> >
> > Expand the SkImageAsset API to support controlling sampling options and
> > pass an additional transform.
> >
> > Bug: skia:10944, skia:10942
> > Change-Id: I7bad0b2ab58ed40fe4b425de0eb6970a4c7d7117
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340097
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Florin Malita <fmalita@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
>
> TBR=fmalita@chromium.org,fmalita@google.com,reed@google.com,aparchur@google.com
>
> Change-Id: I59d4161356ffdc20588f1bd3beb33c54e44807a2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10944
> Bug: skia:10942
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340619
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10944
Bug: skia:10942
Change-Id: I91892f4db6366ceb07d1a49a7bc54da17cea5399
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340657
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-03 19:21:57 +00:00
Tyler Denniston
041f6656dc [svg] Remove kInherit from several SVG types
We can now remove kInherit from all of the SVG types, but this CL does
just a few to get us started / prove the concept.

SkSVGPaint, SkSVGClip and SkSVGLineCap now do not contain kInherit as an
enum value. Also, SkSVGLineCap (and eventually others) can be a bare
enum class now.

Change-Id: I7de001459bcb1f5586d66b975f92fecedb125dde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335827
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-03 17:36:54 +00:00
Florin Malita
b81842aa28 Revert "[skottie] Add image sampling and transform options"
This reverts commit 2f24405250.

Reason for revert: broke Win/shared 

Original change's description:
> [skottie] Add image sampling and transform options
>
> Expand the SkImageAsset API to support controlling sampling options and
> pass an additional transform.
>
> Bug: skia:10944, skia:10942
> Change-Id: I7bad0b2ab58ed40fe4b425de0eb6970a4c7d7117
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340097
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

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

Change-Id: I59d4161356ffdc20588f1bd3beb33c54e44807a2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10944
Bug: skia:10942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340619
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-03 17:11:00 +00:00
Florin Malita
2f24405250 [skottie] Add image sampling and transform options
Expand the SkImageAsset API to support controlling sampling options and
pass an additional transform.

Bug: skia:10944, skia:10942
Change-Id: I7bad0b2ab58ed40fe4b425de0eb6970a4c7d7117
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340097
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-03 16:17:24 +00:00
Julia Lavrova
f9433fa316 Fixing some round problems with metrics
Bug: skia:10996
Change-Id: I003086d3625bb713f4f6c682346ab190dddd7426
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339856
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-12-03 14:52:23 +00:00
Herb Derby
c9a24c9815 default to using new/delete for GrOp
Currently, new/delete is not on for Google3. After this
CL new/delete will be used on all platforms.

Change-Id: Idfc6217b809c9eb986e618ffa575004893b3aa0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339859
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-12-02 15:15:26 +00:00
Kevin Lubick
658cb7173a [canvaskit] Fix drawPoints to be flattened point array
Bug: skia:11012
Change-Id: I0866f791f6fba82d073b5b5acd37aa8509b6fdef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339836
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-02 15:07:57 +00:00
Tyler Denniston
4c6f57a23e [svg] Use new code path for rest of presentation attrs
This is another necessary step in order to remove kInherit from all of
the base SVG type enums.

Change-Id: I2185e744f7b27369f7bad36591f896d3a9982b42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335817
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-11-30 21:27:04 +00:00
Julia Lavrova
611b2a6a0d Heuristic for filtering out too big editing text cases
Bug: skia:10487

Change-Id: Ie13db40ceee6edfcc1cfb28a131ff2cfa02038fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335664
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-25 15:54:27 +00:00
Julia Lavrova
36d06a806f Fixing background rectangle sizes for Flutter
Bug: skia:10982
Change-Id: Id5b352c1139293195ca421b069e8632079acf37b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337181
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Jason Simmons <jsimmons@google.com>
2020-11-24 23:03:46 +00:00
Julia Lavrova
748db70156 Make sure maxIntrinsicWidth is always no less than minIntrinsicWidth
Bug: skia:10992
Change-Id: Ifd3b8e799c76d09f6a01623747f646ce15de51b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338045
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-24 21:13:06 +00:00
Mike Reed
ce0c876ce2 hide legacy scalePixels and makeShader
Change-Id: Idae1e44aa0417adb943fd20112fb4f1fa81167f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337719
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-24 00:41:33 +00:00
Florin Malita
9a5aa0a295 [svg] Handle zero-radius radial gradients
Per [1]:

"A value of zero will cause the area to be painted as a single color
using the color and opacity of the last gradient stop."

[1] https://www.w3.org/TR/SVG11/pservers.html#RadialGradientElementRAttribute

Bug: skia:10981
Change-Id: I5c4c8444c4dd72d2224b1d8b2536e7aa8c1f4712
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337180
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-11-22 19:12:10 +00:00
Brian Osman
0006ad01ce Stop cloning builtin functions
Previously, any builtin functions would be optimized as a side-effect of
optimizing programs that used them. Now that shared elements aren't
being optimized in that way, we explicitly optimize any shared modules
when they are first created. We don't remove dead elements, but we
we do substitute settings, simplify, and inline.

Bug: skia:10905
Change-Id: I701b5e9f52fb880ef3e6f4c67694d08602f47e95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336440
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-20 15:02:54 +00:00
Brian Salomon
94584f4574 Remove unused macros from GrGLConfig.h, GrGLConfig_chrome.h, and scripts
Change-Id: I5a9e7d490fd71f326ac37a72eb942fc64f557733
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335666
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-11-18 20:23:35 +00:00
Florin Malita
c743164d30 [skottie] More robust font style parsing
- both weight and slant are optional
  - handle arbitrary whitespace separators
  - case insensitive keys

Change-Id: Iadd3a43167cd71654d7578549bd331fde243c28f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335822
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-18 19:16:45 +00:00
Kevin Lubick
ae0d3ffe6d [canvaskit] Document and tweak MakeImage API
Change-Id: I84b8bc8b84e0b79ea4a8a6b53bb3358e0ec9c138
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335665
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-11-18 17:43:56 +00:00
Tyler Denniston
79832e3151 [svg] Parse "inherit" generically for SkSVGProperty
This generic parsing will allow us to later remove kInherit and
"inherit" parsing from all other specific SVG types.

Also convert "filter" presentation attribute to new-style parsing
for compatibility with the setter.

Change-Id: Id917e12d77cdefb1a8f1404cac1e0c4e486d8b53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335660
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-11-18 16:51:55 +00:00
Tyler Denniston
75c38f94ef [svg] Add SkSVGProperty class for presentation attributes
This CL adds a new SkSVGProperty<T,B> class and uses it instead of
SkTLazy for the presentation attributes. Ideally this will form the
foundation for improvements to our presentation attribute parsing
as well as correctness for inherited/non-inherited properties.

Change-Id: Ie1cdb3db9674c55376e127cc1a8b8cb303a1bd13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334837
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-11-17 18:11:24 +00:00
Florin Malita
ebbacd8a37 [skottie] Initial direction for text shaping
Extend text properties to allow specifying an initial direction.

Bug: skia:10946
Change-Id: Ia037aa060a4e2bb404cd50b0d6c8883ffe0ee38a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334677
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-13 20:57:03 +00:00
Florin Malita
4ad2cca236 [skottie] Fix font style parsing
1) avoid partial matches (e.g. "Extra" vs. "ExtraLight")

2) weight/slant are space-separated (e.g. "ExtraLight Italic")

Change-Id: Id2db44d8b4a32b97674ec7490992974135b39ae9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334164
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-12 18:36:49 +00:00
Kevin Lubick
83bbd7c0ad [canvaskit] Roll to 0.20.0
Change-Id: I5025a5ca8deca45dfe3e222e3bf4b6f047416eb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334419
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-11-12 15:48:12 +00:00
Julia Lavrova
c90084a9a3 Revert "Some testing images in Google3 look slightly different with this change. Need to change them, too."
This reverts commit b776a105e5.

Reason for revert: This will be the first step of a staged change.

Original change's description:
> Some testing images in Google3 look slightly different with this change. Need to change them, too.
>
> Revert "Roll back #10487 fix (so now spaces always resolved in the main font)"
>
> This reverts commit ff5d8700b3.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Roll back #10487 fix (so now spaces always resolved in the main font)
> >
> > Bug: skia:10715
> > Change-Id: I06bb881998d00228c79a218967eda6468cbc5bed
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334053
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=bungeman@google.com,jlavrova@google.com
>
> Change-Id: Icc1f262f60fa2ec9b4425ce3088b5eaac9313374
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10715
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334158
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=bungeman@google.com,jlavrova@google.com

Change-Id: I0f2f46fc21eec795026ea98696f68112915f7979
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10715
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334159
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-12 15:32:48 +00:00
Kevin Lubick
6df5cd28db [canvaskit] Revert raster change.
Drawing to a Premul Raster Surface and then copying out Unpremul pixels
was 15x slower. Drawing to an Unpremul Raster surface was a little
slower than the previous RasterDirect surface.

Out of an abundance of caution, I'm going back to the way things were.
We can revisit drawing to a Raster surface in the future.

This also adds better error handling to the SkottieFrames test which
thankfully caught this regression.

Bug: skia:10717
Change-Id: Ib8b9d490c92e013c3311adb1d08de5fa0fc0351c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334356
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-11-12 14:49:47 +00:00
Kevin Lubick
43f0a7d724 [canvaskit] Fix the build
Change-Id: Ia3b3fa1183d5654bcfeab0bfd24ca04b8f622eed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334166
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-11-12 13:07:46 +00:00
Kevin Lubick
59bafeeaa7 [canvaskit] Deprecate measureText
After discussion on https://skia-review.googlesource.com/c/skia/+/334096
we decided to remove this misleading API.

Bug: skia:10480
Change-Id: I3daeb6251d5fed829742cfe39c7cade4f19e5a43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334101
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-11-11 22:49:10 +00:00
Kevin Lubick
15d7a38b04 [canvaskit] Use Raster instead of RasterDirect for Canvas2D surface
This also refactors some internal names to be more consistent
with the normal naming convention.

Bug: skia:10717
Change-Id: I69a0d95aaca359e121b3ff84002d0b5f7cadb260
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334041
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-11-11 22:48:53 +00:00
Leon Scroggins
70eba23828 Remove SkAnimatedImage::dimensions
The only caller is CanvasKit, and SkAnimatedImage already has getBounds
(from SkDrawable) which does the same thing, except it returns
SkScalars. It also takes scaling and cropping into account, which
CanvasKit does not use, and in a future commit, it will consider
orientation. Switch CanvasKit to use getBounds.

Change-Id: Ia956f91d241641aec450f3aba99583e95a3ff386
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333222
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-11-11 21:48:15 +00:00
Julia Lavrova
b776a105e5 Some testing images in Google3 look slightly different with this change. Need to change them, too.
Revert "Roll back #10487 fix (so now spaces always resolved in the main font)"

This reverts commit ff5d8700b3.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Roll back #10487 fix (so now spaces always resolved in the main font)
>
> Bug: skia:10715
> Change-Id: I06bb881998d00228c79a218967eda6468cbc5bed
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334053
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=bungeman@google.com,jlavrova@google.com

Change-Id: Icc1f262f60fa2ec9b4425ce3088b5eaac9313374
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10715
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334158
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-11-11 20:47:16 +00:00
Julia Lavrova
ff5d8700b3 Roll back #10487 fix (so now spaces always resolved in the main font)
Bug: skia:10715
Change-Id: I06bb881998d00228c79a218967eda6468cbc5bed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334053
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-11-11 18:11:25 +00:00
Florin Malita
7006e15df5 [svg] Allow clients to pass a custom SkFontMgr
Introduce a Builder helper and plumb the client-provided SkFontMgr for
font resolution.

Also clean up some of the legacy SkSVGDom factories.

Bug: skia:10840
Change-Id: I6e1eabe7c257cb75dfdb5bf67054f93f25769027
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333577
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-11-11 01:51:44 +00:00
Tyler Denniston
a0a5146ba9 [svg] Use new parsing for gradient classes
- Added new SVG_OPTIONAL_ATTR macro for lazy properties
- Added SkSVGIRI type -- we need explicit types now to be able to
  dispatch via the templated parse function
- Converted several attribute parse functions to templated version

Change-Id: I270d35983083f368e36afd96a62c768161d49942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333518
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-11-10 19:04:49 +00:00