Commit Graph

1362 Commits

Author SHA1 Message Date
Nathaniel Nifong
50940aba5d fix a few failing gm tests in wasm
The skia gn/ninja build step and the emscripten build step were using
a different set of defines. this violated assumptions of a couple of
tests

Change-Id: Id5364c0e1281b2e4024685fe8f106ee55c4961cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338343
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-01-09 02:48:38 +00:00
Ben Wagner
b06ebee1e8 Make SkBase64 interface less unpleasant.
Change SkBase64::decode interface completely and better document
how to use. Unfortunately there are users of ::decode (and they are
leaking) so will need to keep the old interface until users can be
updated.

Change-Id: I214b771136d78fef758c5d0d9ec302f956f6e4f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351201
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-01-08 20:28:19 +00:00
Nathaniel Nifong
0355118f22 debug build for wasm gm tests
Change-Id: I802160c5734648a57b5ffe19f0df990c526e2c2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350896
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2021-01-08 16:46:49 +00:00
Mike Reed
f4ea30580c Revert "Cache ICU break iterators in SkUnicode_icu"
This reverts commit 504451c7cc.

Reason for revert: breaking android roll?

external/skia/modules/skshaper/src/SkUnicode_icu.cpp:199:28: error: use of undeclared identifier 'ubrk_safeClone'
            iterator.reset(ubrk_safeClone(cachedIterator->get(), nullptr, nullptr, &status));
                           ^
1 error generated.


Original change's description:
> Cache ICU break iterators in SkUnicode_icu
>
> Change-Id: I2d6abd1a12d629b590a6616d0d1c71d71d5f4812
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344476
> Commit-Queue: Jason Simmons <jsimmons@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>

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

Change-Id: Iccc8c630bb2461ca3509144a25961b478e6a634d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351916
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-08 02:29:03 +00:00
Julia Lavrova
bdd9a7bf2e RTL run broken by text styles crashes SkParagraph
Bug: skia:11148
Change-Id: I92f941faa645b98e2fc6827eac80020637780a1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351501
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-01-07 21:03:01 +00:00
Jason Simmons
504451c7cc Cache ICU break iterators in SkUnicode_icu
Change-Id: I2d6abd1a12d629b590a6616d0d1c71d71d5f4812
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344476
Commit-Queue: Jason Simmons <jsimmons@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-01-07 19:57:46 +00:00
Kevin Lubick
5779a86072 [canvaskit] Add docs and example for flags
Change-Id: I9ad8a591b9f9dc5c454bfa30405244e49ad6b593
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350816
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
2021-01-07 16:38:58 +00:00
Brian Osman
be0b3b7363 Strip down SkSL::ExternalValues, limit them to functions
Previously ExternalValues were flexible, and could be used as raw values
(with the ability to chain access via dot notation), or they could be
callable. The only non-test use-case has been for functions (in
particles) for a long time. With the push towards SkVM, limiting
ourselves to this interface simplifies things: external functions are
basically custom intrinsics (and with the SkVM backend, they'll just get
access to the builder, and be able to do any math, as well as
loads/stores, etc).

By narrowing the feature set, we can rename everything to reflect that,
and it's overall clearer (the SkSL types now mirror FunctionReference
and FunctionCall directly, particularly in how they're handled by the
CFG and inliner).

Change-Id: Ib5dd34158ff85aae6c297408a92ace5485a08190
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350704
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-07 14:28:41 +00:00
Florin Malita
736c992966 [svg] Deferred text position adjustments
Upcoming textPath changes require position adjustments (relative offset,
rotation) to be applied after mapping to path, at chunk flush time.

Bug: skia:10840
Change-Id: Ifccea2983d5d5c57876d0a25e1da113e4c9cd51a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350018
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-05 21:52:25 +00:00
Florin Malita
2d059fcc22 [svg] Text rotate support
Implement support for text 'rotate' attribute:
https://www.w3.org/TR/SVG11/text.html#TSpanElementRotateAttribute.

Unlike other character-positioning attributes (x/y/dx/dy), rotate

  - is not cumulative
  - only applies to its respective node scope (does not affect other
    fragments in the current chunk)
  - has different padding semantics: if there are fewer rotate
    values than characters, the remaining characters use the last
    specified value from the closest ancestor

To the last point, we now have to discriminate three states:

  - unspecified (default -> 0)
  - explicit value for the given character index
  - implicit value (last value in the closest ancestor)

Local implicit values override implicit ancestor values -- but not
explicit ancestor values.

High level changes:

  - plumb 'rotate' attribute
  - expand per-character position info (ShapeBuffer) to include rotation
  - expand per-glyph position info (RunRec) to include rotation
  - expand PosAttrs to include rotation and add specific inheritance
    rules (see above)
  - pass computed rotation values to RSX blob buffers

Bug: skia:10840
Change-Id: Ia19ec5e8bb6fea06d49a9bd72ace575c2ffd100e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348877
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-05 17:43:51 +00:00
Florin Malita
e5a2171d6e [svg] Convert text rendering to RSX form
In preparation of per-character rotation support, switch to RSX text
blobs.

TBR=
Bug: skia:10840
Change-Id: Ia7de0983d1445e61e97caae9404d472cc3736730
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348880
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2020-12-30 17:13:07 +00:00
Mike Reed
4f23dec742 Reland "Add new virts, hide old ones"
This reverts commit 8f924ac0ce.

Reason for revert: suppressions landed for fuchsia images to rebaseline

Original change's description:
> Revert "Add new virts, hide old ones"
>
> This reverts commit c56e2e5aa6.
>
> Reason for revert: suspected of breaking chrome roll
>
> Original change's description:
> > Add new virts, hide old ones
> >
> > Add virtuals for the draw methods that now take sampling/filtermode.
> >
> > drawImage
> > drawImageRect
> > drawImageLattice
> > drawAtlas
> >
> > Add a flag that can remove the older virtuals, once each client has
> > stopped overriding them. In that situation, the older public methods
> > will simplify extract the sampling from the paint, and call the new
> > public methods.
> >
> > Bug: skia:11105, skia:7650
> > Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,fmalita@chromium.org,reed@google.com
>
> Change-Id: I0a90952c11a180d918126ea06a630f4a0bf9b49b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11105
> Bug: skia:7650
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348194
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,bsalomon@google.com,fmalita@chromium.org,reed@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:11105
Bug: skia:7650
Change-Id: Ia2b4537a2d330460b7554278d2c05075cf27162a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348876
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-30 15:21:01 +00:00
Derek Sollenberger
8f924ac0ce Revert "Add new virts, hide old ones"
This reverts commit c56e2e5aa6.

Reason for revert: suspected of breaking chrome roll

Original change's description:
> Add new virts, hide old ones
>
> Add virtuals for the draw methods that now take sampling/filtermode.
>
> drawImage
> drawImageRect
> drawImageLattice
> drawAtlas
>
> Add a flag that can remove the older virtuals, once each client has
> stopped overriding them. In that situation, the older public methods
> will simplify extract the sampling from the paint, and call the new
> public methods.
>
> Bug: skia:11105, skia:7650
> Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I0a90952c11a180d918126ea06a630f4a0bf9b49b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11105
Bug: skia:7650
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348194
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-12-30 13:41:52 +00:00
Mike Reed
c56e2e5aa6 Add new virts, hide old ones
Add virtuals for the draw methods that now take sampling/filtermode.

drawImage
drawImageRect
drawImageLattice
drawAtlas

Add a flag that can remove the older virtuals, once each client has
stopped overriding them. In that situation, the older public methods
will simplify extract the sampling from the paint, and call the new
public methods.

Bug: skia:11105, skia:7650
Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-29 21:36:08 +00:00
Kevin Lubick
70019c6085 [canvaskit] Fix bug if webgl context not available
Bug: skia:11107
Change-Id: Ibf697a2c0b471ea79bee1a33d8230086509147ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347677
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-28 14:47:43 +00:00
Mike Reed
dc607e35e1 Use bitmap.asImage()
Change-Id: Ie16194937530d7cd75f84d9af66c31b77875ef83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347043
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 17:41:47 +00:00
Mike Reed
839eef3e9a Work on hiding filter-quality
SkPaintPriv methods are just an internal stopgap

Change-Id: Ibe6e37c5871068d8cd67dc0948961444dfd2b62a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347041
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 17:05:17 +00:00
Brian Osman
e11c43804b Remove use of uint from particle random system
uint (and bitwise operations) aren't supported by our minimum spec, and
they're going to be removed from public SkSL. For now, convert the
random generator to a good-enough chaotic sequence of high-frequency
sine waves.

If/when the interpreter (and particles) are converted to the newer skvm
backend, it will be straightforward to support custom intrinsics that
emit skvm instructions directly into the builder, and re-introduce a
better integer-based PRNG, without requiring SkSL language support.

Bug: skia:11093
Change-Id: I885b15a51a9e5c12b4274b5938d8deb77219d41b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347036
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-23 16:21:17 +00:00
Mike Reed
ac9f0c9e27 Bitmap.asImage()
... and lots and lots of IWYU

Change-Id: Ie5157dcdd2e6d29b95c71b39153278ab48ef4eb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346778
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 15:54:57 +00:00
Brian Osman
265064450f Remove 'flags' feature from particles
No longer used by any example content, and it requires unsigned integers
and bitwise ops (which are both going to be hidden from public SkSL).

Bug: skia:11093
Change-Id: I1941f7a1bed6c8512a5117ef256d18e420cbabee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346779
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-22 21:05:23 +00:00
Florin Malita
735ac97eb4 [svg] Relative postioning support for text
Introduce support for relative position adjustments [1]:

  - plumb dx, dy attributes
  - extend ScopedPosResolver to also handle the new attributes
  - introduce ShapeBuffer to store both utf8 text and position
    adjustments for shaping (replaces prev 'filtered' array).
  - position adjustments are cumulative (relative adjustments affect
    all following characters)
  - utf8 encoding is variable length; for simplicity, ensure that the
    pos adjustment array and the utf8 array are always the same size by
    repeating the pos adjustment times number of utf8 bytes
  - introduce a temporary buffer for retrieving utf8 cluster information
    from SkShaper
  - post-shaping, use the utf8 cluster info to map back to character
    indices and apply the associated position adjutment

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

Bug: skia:10840
Change-Id: Ia9f227f91723400711ff2b5d260976290da1e2e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346636
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-12-22 19:19:12 +00:00
Leon Scroggins III
e42716032b SkAnimatedImage: Always respect exif orientation
No known clients (CanvasKit, Android) want to ignore the exif
orientation in an animation.

A follow-on CL will deprecate SkAndroidCodec::ExifOrientation, leaving
it up to the client (e.g. SkAnimatedImage, hwui/ImageDecoder) to
handle the orientation. Add SkEncodedOriginSwapsWidthHeight to assist
clients to do so.

Update stoplight_animated_image GM. It previously showed using
SkAnimatedImage without respecting the orientation, which is no longer
supported. The new version replaces the left half of the image with the
right.

Remove assert that is no longer true. Originally, an SkAnimatedImage was
"simple" if it did not have a crop or postProcessor. This is no longer
true if has an exif orientation. Add a test that calls the simple
constructor and verifies it does not crash.

Change-Id: I421fd02700f220fb90458cd03c4431dee7daf399
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344762
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-12-21 16:39:12 +00:00
Mike Reed
e78f8cebca Starting to hide setFilterQuality
Bug: skia:7650
Change-Id: I511859e9b34af21d351db87b658dad970f0802a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345171
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-19 20:56:50 +00:00
Florin Malita
dec78021f5 Reland "[svg] Absolute positioning support for text"
This reverts commit e2f6245352.

Reason for revert: relanding with fixes

Original change's description:
> Revert "[svg] Absolute positioning support for text"
>
> This reverts commit febb1b87a5.
>
> Reason for revert: breaking the android roll
>
> Original change's description:
> > [svg] Absolute positioning support for text
> >
> > Implement per-character position attribute lookup based on [1]:
> >
> >   - convert "x" and "y" attributes to arrays
> >   - introduce ScopedPosResolver to handle positioning attribute lookup
> >     and fallback
> >   - push a new resolver every time we enter a text positioning element
> >     scope (<text>, <tspan>, etc).
> >   - flush/reposition a new text chunk every time we encounter explicit
> >     absolute positions
> >
> > The position attribute fallback logic is complex enough to warrant a
> > unit test.
> >
> > [1] https://www.w3.org/TR/SVG11/text.html#TSpanElementXAttribute
> >
> > Bug: skia:10840
> > Change-Id: I66c478fea4a179fdb8b1a6a9ff00c4dd9509f8d2
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345161
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Florin Malita <fmalita@google.com>
> > Reviewed-by: Tyler Denniston <tdenniston@google.com>
>
> TBR=fmalita@chromium.org,fmalita@google.com,tdenniston@google.com
>
> Change-Id: I80e3396d555369fe835ee73102135061f63e8bf0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10840
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345417
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,fmalita@chromium.org,fmalita@google.com,tdenniston@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:10840
Change-Id: I4c6f6a9f19c0f7598bdcf34e915f43c139b995a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345420
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-18 02:09:18 +00:00
Jason Simmons
62db68aad1 Precompute the size of fClusters in ParagraphImpl::buildClusterTable
Change-Id: I337564ed308abee0e014ce6afc4cab8035a35052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344521
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2020-12-17 20:02:15 +00:00
Derek Sollenberger
e2f6245352 Revert "[svg] Absolute positioning support for text"
This reverts commit febb1b87a5.

Reason for revert: breaking the android roll

Original change's description:
> [svg] Absolute positioning support for text
>
> Implement per-character position attribute lookup based on [1]:
>
>   - convert "x" and "y" attributes to arrays
>   - introduce ScopedPosResolver to handle positioning attribute lookup
>     and fallback
>   - push a new resolver every time we enter a text positioning element
>     scope (<text>, <tspan>, etc).
>   - flush/reposition a new text chunk every time we encounter explicit
>     absolute positions
>
> The position attribute fallback logic is complex enough to warrant a
> unit test.
>
> [1] https://www.w3.org/TR/SVG11/text.html#TSpanElementXAttribute
>
> Bug: skia:10840
> Change-Id: I66c478fea4a179fdb8b1a6a9ff00c4dd9509f8d2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345161
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@google.com>
> Reviewed-by: Tyler Denniston <tdenniston@google.com>

TBR=fmalita@chromium.org,fmalita@google.com,tdenniston@google.com

Change-Id: I80e3396d555369fe835ee73102135061f63e8bf0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10840
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345417
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-12-17 19:21:37 +00:00
Florin Malita
febb1b87a5 [svg] Absolute positioning support for text
Implement per-character position attribute lookup based on [1]:

  - convert "x" and "y" attributes to arrays
  - introduce ScopedPosResolver to handle positioning attribute lookup
    and fallback
  - push a new resolver every time we enter a text positioning element
    scope (<text>, <tspan>, etc).
  - flush/reposition a new text chunk every time we encounter explicit
    absolute positions

The position attribute fallback logic is complex enough to warrant a
unit test.

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

Bug: skia:10840
Change-Id: I66c478fea4a179fdb8b1a6a9ff00c4dd9509f8d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345161
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-12-17 17:31:25 +00:00
Kevin Lubick
81da68af2e [canvaskit] Update to 0.22.0
We also include the CHANGELOG in the release notes.

Change-Id: Icbdedf124c114c2f4be757f408a437fda71c40ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345288
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-17 15:10:15 +00:00
Julia Lavrova
acace5d7bc Remove static allocattion of UText
Bug: skia:11046
Change-Id: Iaad37b8f664b523b8a8b2a5e1aa895db40332d87
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345038
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-12-17 15:06:15 +00:00
Kevin Lubick
2d6334988b [canvaskit] Modify drawImageNine API to handle Filter quality
Bug: skia:11099
Change-Id: Ia019bd5107d5646d6e314876610ecdeb37004e36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345277
Reviewed-by: Mike Reed <reed@google.com>
2020-12-17 14:58:58 +00:00
Kevin Lubick
72f407636e [canvaskit] Expose sampling variants of drawImage and drawImageRect
Change-Id: I91f40374de1861385bddb977917f2e7a24fb6a27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345130
Reviewed-by: Mike Reed <reed@google.com>
2020-12-16 21:19:58 +00:00
Kevin Lubick
b9a818471d [canvaskit] Update to 0.21.0
Change-Id: Id093d3026bdb406b66374839820ae44a7696a981
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345096
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-16 17:44:47 +00:00
Florin Malita
adc6889228 [svg] Refactor text rendering context plumbing
Instead of relying on RenderContext to pass text rendering options
downstack, introduce a dedicated virtual (onRenderText) and pass options
explicitly.

Root text nodes bridge from onRender() -> onRenderText().

This removes some complexity from RenderContext and incidentally fixes
xml:space = preserve (the value was being dropped during local ctx
copying).

Bug: skia:10840
Change-Id: Ic5fd9e0f9382f52f65108521574fcb2a422b97aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344559
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-15 16:54:42 +00:00
Tyler Denniston
dcf288ba82 [svg] Fix filter region bounds
When the filter units are objectBoundingBox, values are fractions/pcts
of the object's bounding box, which we were miscomputing.

Also adding in a small tweak to return bounds for <polygon> elements
(will be needed for future filter tests).

Bug: skia:10841
Change-Id: I7fcac21258570d872672c42e99a9739a65c53e30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343520
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-15 16:15:19 +00:00
Chris Dalton
23096a33a8 Get CanvasKit viewer compiling again
This probably isn't ideal, but it's a step to keep it compiling while we
get this utility up and running in a more permanent way.

Change-Id: I98f56fe28b98862000a134f697bb441d87e47f30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344176
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-15 01:10:48 +00:00
Jorge Betancourt
f607dbbbe8 implement SkAudioPLayer for Android
move SkAudioPlayer for Android to proper module
refine playback features for the Android AudioPlayer

Change-Id: I1906c3b3ef91fa4173f66c2c068dc40a3cf824ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319037
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2020-12-15 00:12:48 +00:00
Kevin Lubick
1d2b075ce0 [wasm-gms] Enable filesystem by default.
Some of the SVG libraries, there appear to be some SYScalls
(getStreamFromFD) that are no longer included in an emsdk 2.0.10 build.

Change-Id: Ib6ac4c20186e79316cd5b2566ed2deb2d3e3d0af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344076
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-14 20:40:40 +00:00
Kevin Lubick
5df97bb89b [canvaskit] Replace core build with profile build in npm
Change-Id: I22cbaf1ee6469444e0a272d8d894ccbccdcbd24c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343997
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
2020-12-14 17:46:02 +00:00
Kevin Lubick
035cd91cfb [canvaskit] Update to emsdk 2.0.10
(also update pathkit).

Bug: skia:11077
Change-Id: I7d06e05ed8f445313bedee055af5ded79c7b40b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343505
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-14 15:27:28 +00:00
Kevin Lubick
371967f791 [canvaskit] Update Chrome version and use npm ci for tests
By using npm ci, we can make sure the versions of the helper
libraries (e.g. Karma, Jasmine) we are testing with locally
is the same as the versions we are using in the continuous
integration system.

The copying is needed because our docker recipe forces us
to run as not root, and this was causing some issues. As a
result, I changed the canvaskit test/perf to not re-use the
same file as pathkit does so copying was easier and the
dependencies between the two modules is broken.

Bug: skia:11077
Change-Id: Ib05890d666d3507d4f724a4ae298484629c7932a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343503
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-14 15:03:42 +00:00
Kevin Lubick
4b208f76f0 [canvaskit] Update npm dev dependencies
Update pathkit too. I want to make sure we are up to date with testing
harnesses that could support testing as ES6 modules.

Bug: skia:11077
Change-Id: I1ecd8acbdf6ad47a5877aa7dbb6772406d2edb54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343501
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-14 15:03:24 +00:00
Kevin Lubick
652d790355 [canvaskit] Remove filterquality on paint.
Bug: skia:7650
Change-Id: I16c7940b4bc0be100a45ea983e0a684416363976
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343441
Reviewed-by: Mike Reed <reed@google.com>
2020-12-11 20:27:27 +00:00
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