Not currently used, but will be used for <image> support.
Change-Id: I3bbb79c88890100901a8b85734d3a4d86a618848
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360605
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
This is a reland of 2c3cec998f
Original change's description:
> [canvaskit] Break up helper.js into smaller files
>
> This will hopefully make some things easier to find/understand.
> I have a few more ideas for breaking up other parts.
>
> Bug: skia:11203
> Change-Id: Ia54c13fd6e3c897e04a737b258f6e77c50a1aed3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356839
> Reviewed-by: Nathaniel Nifong <nifong@google.com>
Bug: skia:11203
Change-Id: I8850e8e9e5f39f537232e0f1f8a814f763ab7853
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363942
Reviewed-by: Kevin Lubick <kjlubick@google.com>
TSAN caught this when I added particle GMs.
Change-Id: I6c03afe4b7a4323c7b8d8a1eaf197ff9aa76a09c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362498
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 964b4465c4.
Reason for revert: Earlier CL needs revert
Original change's description:
> Add particle GM that uses uniforms, fix related bug in particle effect
>
> We weren't allocating uniform storage until after the first update, far
> too late for users to pump uniform values in. They're now allocated as
> soon as the effect is created, which is tested by the new GM.
>
> Change-Id: Ia0084bcec5986479c350ead27d14344c3ed82520
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362176
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=brianosman@google.com
Change-Id: Ib6f963840af2abba0a4e6b99185f4010b61dde54
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362418
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The gms are failing to link at the moment with the current build.
Change-Id: I3c73c68c9bfd053ffb2687e54ed9d0899dadca5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362337
Reviewed-by: Brian Osman <brianosman@google.com>
We weren't allocating uniform storage until after the first update, far
too late for users to pump uniform values in. They're now allocated as
soon as the effect is created, which is tested by the new GM.
Change-Id: Ia0084bcec5986479c350ead27d14344c3ed82520
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362176
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This CL adds a type enum to SkSVGIRI that will eventually be used to
distinguish between local fragments ('#frag-id'), non-local fragments
('/path/to/file.png') and data URIs ('data:image/png;base64,...').
To do so required a bit of refactoring of other types that previously
treated IRIs as basic strings. There are no functional changes in this
CL.
Change-Id: I8bf426f77c0779890bce74d2d243c09617f024c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360601
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
This will hopefully make some things easier to find/understand.
I have a few more ideas for breaking up other parts.
Bug: skia:11203
Change-Id: Ia54c13fd6e3c897e04a737b258f6e77c50a1aed3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356839
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Allows the user to signal that any global outstanding cached data should
be cleaned up to free resources.
Change-Id: I59d4bb2bbb4356920dea8caf912d9cb5f13014cf
Bug: skia:10763
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360079
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
https://www.w3.org/TR/SVG11/filters.html#feSpecularLightingElement
Because a fair amount of functionality will be shared between
feSpecularLighting and feDiffuseLighting, this CL adds an intermediate
SkSVGFeLighting base class for common code.
The only light source type implemented in this CL is fePointLight, which
exercised by the filters-light-03 W3C test.
Bug: skia:10841
Change-Id: Icae26dedb1aae1cd25ba2db7c6468a243ebacbc5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359756
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
I had to stage the change with SK_PARAGRAPH_GRAPHEME_EDGES because of
some google3 tests.
Bug: skia:11196
Change-Id: Ic45e43e6c69f649c6bc0fedcc6f303891139b85e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359566
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This makes ParagraphCache::abandon just forward to
ParagraphCache::reset. This removes re-entering fParagraphMutex and an
empty loop.
Change-Id: I1f31474ec4e381c71e6eba062ba572a1c29d1a6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359839
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
https://www.w3.org/TR/SVG11/filters.html#LightSourceDefinitions
The three classes represent light source elements that will eventually
be used for feSpecularLighting and feDiffuseLighting. Currently they are
unused.
Also added the (currently unused) lighting-color presentation attribute.
Bug: skia:10841
Change-Id: Ic7824671662b8cd88cf627affc54173d5e881b7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359557
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Enables use of text as a clip path.
Bug: skia:10840
Change-Id: I9de40e23696083e8cdd7e0b82221da3f3c36ac8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358533
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
In preparation for text bounding box support, fission the actual
rendering phase from the shaping/alignment phase:
- rename onRenderText -> onShapeText
- introduce a ShapedTextCallback abstraction for consuming the result
of text processing
- relocate the final rendering step to a ShapedTextCallback impl
Bug: skia:10840
Change-Id: Ia8cc0d9a5a5484972a34042fd782f9e4fada6b12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358223
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Per spec [1], unspecified inputs ('in', 'in2' attributes) have different
meaning depending on whether the referencing filter is the first in the
pipeline. This CL adds previous result tracking to the filter context
and handles unspecified values accordingly during input resolution.
[1] https://www.w3.org/TR/SVG11/filters.html#FilterPrimitiveInAttribute
Bug: skia:10841
Change-Id: I64618ad712979f6dd62adb4686085fe31618c3cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357278
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Per spec (and empirically) <text> elements are not nestable (neither
directly or indirectly):
https://www.w3.org/TR/SVG11/intro.html#TermTextContentChildElement
Update the implementation to
- only bridge onRender -> onRenderText in the root SkSVGText
implementation
- disallow <text> elements as text container descendants
Change-Id: I07b3abaf943b820e01c88f78bddf7ce5970ee508
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358220
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
No longer used. Remove old numerically unstable scaling.
Change-Id: I3aa05369167377e0277eaca155536c2f1e8036b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356379
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Change-Id: Ib150e6d6d3de34a85ce8051eea843ab3b2d7ab75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356921
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Also cleanup some of the duplicate code in SkRecords
Bug: skia:7650
Change-Id: I4d3167a892c126c19a54002beab25c9a6c96fa5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357000
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This was the last remaining user of ByteCode. The skvm solution
is faster, and lets us delete the ByteCode system.
Testing on 15 instances of sinusoidal_emitter (90k particles):
- ByteCode ~9 ms
- ByteCode (older, optimized): ~5.5 ms
- skvm ~2.1 ms
Change-Id: Ia2e5c9ab2d36c97e59af28a6f989bf212889e439
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356919
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
The basic problem was that WasmContextInfo shadowed non-virtual members
of ContextInfo. the tests, which work with that type, end up calling the
super class's methods which return null for directContext()
The context created and stored in WasmContextInfo would have worked if it
could be returned, but I've opted to go with what looks like a more
canonical way to test a new backend, that is to create a platform-
specific subclass of GLTestContext, and let GrContextFactory create the
GL context.
Bug:skia:10869
Change-Id: Ie9e1142cf2e7268242ff9aab70f76151714850a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355116
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
- Allow resolving inputs without modifying their colorspace
- Add helper to get the colorspace of a particular input
- Make resolveColorspace() virtual and add filter context to its
signature
Bug: skia:10841
Change-Id: I2e226ec26205f527c2d171140072f106ec35fbe0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356416
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Without the "spawn another effect" binding (that was recently removed),
these serve no purpose.
Change-Id: Ica8cc3f444c6b749c634c41453501edfff9d9a23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356417
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Instead of attempting to keep fill & stroke SkPaints synchronized with
the current presentation attributes throughout the DAG walk, build the
SkPaints on the fly, only when needed.
This simplifies presentation attribute handling and enables further
/future refactoring.
Change-Id: I3791b4244530644e7e4b983d93b3c966ea7a1b22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355096
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
The hb_position is always tracked in 16.16 now, so take direct advantage
of that instead of relying on the ratio of the requested size and size
as known by HarfBuzz. This avoids potential issues with division of zero
by zero when shaping zero sized fonts.
Bug: oss-fuzz:29240
Change-Id: I9715629034008552f88afd4feb1074a11cae15e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354117
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Property inheritance is supposed to follow the tree hierarchy, but we
implement it based on the render path.
One nasty side effect is when resolving IRI paint servers
(gradients, patterns), the referencing node properties get inherited
(leak) into the paint server fragment. E.g.
<pattern id="pat">
<rect fill="green"/>
</pattern>
<rect stroke="blue" fill="url(#pat)" stroke="blue"/>
The pattern subtree incorrectly inherits a blue stroke property from
the referencing node when we resolve the fill.
As a temporary (and imperfect) workaround, we can reset the presentation
context when resolving IRI paint servers.
Change-Id: Ia4a8a6199222820661f805c43340b5e16902feff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354668
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Note we are still not passing filters-blend-01-b because we don't yet
support feImage.
Bug: skia:10841
Change-Id: Ibca52c0e8e8d45e73473dea3b0252d6b81eaa584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354657
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Also fix a crash if you try to play an effect that has never compiled
correctly. (After the first compile, the arrays were always large enough
to set "dt" -- this code is all going to be reworked soon for SkVM, but
I hit this while diagnosing the type coercion error).
Change-Id: I5bfab539c7304bde2da36b0b0604991d5b5b303a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354660
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>