- 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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>