Commit Graph

179 Commits

Author SHA1 Message Date
Brian Salomon
8a97f56c06 Swap x/y radii for EllipticalRRectOp depending on matrix.
Bug: chromium:946965
Change-Id: Ia85e07d7fc76aa9e0b0a8fe0daf3ab80d517cbd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209167
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-04-18 19:56:00 +00:00
Brian Osman
937d967457 Always mark bitmap glyph runs as such, to ensure they are properly regenerated
If all glyphs were culled (by being too small), we could end up with a
run that never called setHasBitmap. That would prevent us from looking
at the view matrix on a subsequent draw, when deciding if we needed to
regenerate.

Bug: skia:8955
Change-Id: Ic7a2539762527f91bdb50ab78bdf5801bfda0034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206266
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-04-05 16:26:23 +00:00
Herb Derby
2273c900ea GM for SkOverdrawCanvas
Change-Id: Ice39bca25df0255448dce726e5c0d86dce889a60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205940
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-03 20:28:54 +00:00
Michael Ludwig
0c4b581564 Add reproduction test case for crbug/947055
Bug: chromium:947055
Change-Id: If271112285aa413a71c094502c81b501c77a129e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204742
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2019-03-29 18:24:03 +00:00
Brian Osman
917d356838 Remove all of the _as_paths GMs
These GMs are confusing to triage, and are checking behavior that I
don't think we care about any longer.

Bug: skia:6652
Change-Id: I331f9a51623a0e90d4a848c8209be93403bc90ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202128
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-20 14:47:51 +00:00
Brian Osman
e938c92fe7 Remove SkToSRGBColorFilter (now unused)
This was another stop-gap color management "solution".

Bug: skia:
Change-Id: I7c0c362840dd35aad51ad8780f2dab591c42a7e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199720
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 13:19:28 +00:00
Brian Salomon
c512eae566 Add GM for crbug.com/938592
Bug: chromium:938592
Change-Id: I317c13c6f81c54989267325061bcb1c57428f478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200043
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-11 20:49:42 +00:00
Chris Dalton
d7291ba7a1 Restore support for multisample locations
Bug: skia:
Change-Id: I971455867e54d431cc1094fca041f773f78748ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196218
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-07 22:00:48 +00:00
Ethan Nicholas
a70693b234 Add support for runtime color filters written in SkSL.
Bug: skia:
Change-Id: I9b930e81cff1c656908125dcf900279f73570204
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195581
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-05 16:03:25 +00:00
Mike Reed
e36d408b26 add gm to test backdrop blurs and clipping/hintrects
Bug: skia:8783
Change-Id: I27907673d4a5e1f8c5c0b26c704da367e0437a79
Reviewed-on: https://skia-review.googlesource.com/c/194190
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-22 22:28:50 +00:00
Mike Reed
1b8aa7226e add test for mac aa on fonts
Bug: skia:
Change-Id: I93b18ee84345e27eb5cf3a94feccb35391ac0e71
Reviewed-on: https://skia-review.googlesource.com/c/193661
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-21 15:04:01 +00:00
Michael Ludwig
009b92e3aa Add general quad factories to GrFillRectOp and GrTextureOp
Bug: skia:
Change-Id: I1f9e9013d20496554891b72749ed9b0844747566
Reviewed-on: https://skia-review.googlesource.com/c/191570
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-19 15:11:02 +00:00
Florin Malita
346ce63daa Add a SkMixerColorFilter GM
Change-Id: I26382a669601f2bebb1f95e56eab2ad3718db4b9
Reviewed-on: https://skia-review.googlesource.com/c/193165
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-17 14:31:30 +00:00
Jim Van Verth
1676cb9282 Restore ETC1 compressed texture support.
Brings back GL ETC1 support and adds Vulkan support as well.

Bug: skia:8684
Change-Id: Ie65da0a3172793081f0e4072f161bfb9b14678bc
Reviewed-on: https://skia-review.googlesource.com/c/179724
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-15 19:56:28 +00:00
Michael Ludwig
4edd420290 Bugfix for Nexus 5 mipmap+scissor generation failure
Bug: skia:8664
Change-Id: Ic1b4f5afb2847eabb2290cbba808c5692a876972
Reviewed-on: https://skia-review.googlesource.com/c/182152
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-15 18:04:27 +00:00
Hal Canary
8cb7376b2d SkPDF: rasterize for color-filter+layer
Bug: chromium:918512
Change-Id: I2a487cb1145c63daec7cb50610efa1e9fa00f5ef
Reviewed-on: https://skia-review.googlesource.com/c/182444
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-09 15:13:27 +00:00
Jim Van Verth
753403cb64 Add new GM to verify Plots marked correctly during regenerate.
There was an issue on Android where a client was drawing a small bit of text,
and then a large chunk of text below it. On the next frame they started fading
out the text and then swapped out all of the large chunk of text. We were not
marking the Plot containing the small bit of text as still in use in this case,
so it was getting overwritten by later uploads. That bug has been fixed,
but this GM tests that codepath.

Bug: b/118850208
Change-Id: I81b795d6b0ee5d5d0b8e380823a568a52118ed0c
Reviewed-on: https://skia-review.googlesource.com/c/178924
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-12-18 16:32:42 +00:00
Brian Salomon
5ceda554f5 Fix stroked round capped circular arc batched with filled circle.
A stroked arc with round caps was batched with a filled circle. The circle op
code would choose a GeometryProcessor configuration that expected round cap
centers as vertex attributes. However, the tessellation code for the filled
circle would not put in dummy round cap centers and then didn't advance the
pointer into which vertex data was being written by the expected vertex
stride.

Bug: b/119394958
Change-Id: I6fe95b32d750599e775ed96e656757fe3087795a
Reviewed-on: https://skia-review.googlesource.com/c/177881
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-12-14 22:11:06 +00:00
Mike Klein
0aa0508e87 convert bug fiddle into a GM
Bug: skia:6886
Change-Id: Ic184ef7e5dd76615f626581b897a3606c6241aa7
Reviewed-on: https://skia-review.googlesource.com/c/177001
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2018-12-12 18:07:42 +00:00
Brian Osman
c32aeb326e Fix two GPU image filters handling of subset inputs
Added a GM that demonstrates the bug. Should draw a blur with
the center masked out, and a circular blurry shape that's
roughly the inverse. On raster, this was already the result.
On GPU, the blurred/eroded layer becomes a subset with an
origin other than (0,0), and that layer was shifted.

I *think* this is the correct fix - we are including 'offset'
in the texture matrices, but that's just based on the crop
rects and adjustments from each filter. We still need to adjust
the texture coords for the subsets themselves.

Bug: chromium:905548
Change-Id: I19c936adad90311aef243a9395a270d2e015df2f
Reviewed-on: https://skia-review.googlesource.com/c/173321
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-12-03 16:46:29 +00:00
Michael Ludwig
6985853f88 Reland "Initial definition of fill rect op"
This reverts commit 1a2476d294.

Reason for revert: Fixes printf signatures and asserts.

Original change's description:
> Revert "Initial definition of fill rect op"
> 
> This reverts commit d3c92d9a36.
> 
> Reason for revert: printf build failure on gcc, assert failures on CQ
> 
> Original change's description:
> > Initial definition of fill rect op
> > 
> > Bug: skia:
> > Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
> > Reviewed-on: https://skia-review.googlesource.com/c/163486
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
> 
> Change-Id: Ib32f91a39d91aeb87982a7b19719485e4a1bf8ae
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/173233
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: I415913a269ba5bcdebd169b5ebc3510673247bfd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173234
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2018-11-28 20:38:25 +00:00
Michael Ludwig
1a2476d294 Revert "Initial definition of fill rect op"
This reverts commit d3c92d9a36.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Initial definition of fill rect op
> 
> Bug: skia:
> Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
> Reviewed-on: https://skia-review.googlesource.com/c/163486
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: Ib32f91a39d91aeb87982a7b19719485e4a1bf8ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173233
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-11-28 19:58:33 +00:00
Michael Ludwig
d3c92d9a36 Initial definition of fill rect op
Bug: skia:
Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
Reviewed-on: https://skia-review.googlesource.com/c/163486
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-11-28 19:08:34 +00:00
Brian Osman
017aa53068 Remove tonalshadows GMs
These aren't testing Skia core functionality

Bug: skia:7518
Change-Id: Ib564dc7b0aa8f137c2c40141fa5d7e9a1bfe4d64
Reviewed-on: https://skia-review.googlesource.com/c/172968
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-27 17:32:35 +00:00
Brian Osman
368895b0da Remove gamut GM
This was based on old ideas about color management. We have better
mechanisms for testing this now.

Bug: skia:
Change-Id: If59b5039f31ab0ebbdbed4205c941dd9266f67c1
Reviewed-on: https://skia-review.googlesource.com/c/172860
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-26 15:45:35 +00:00
Brian Salomon
908bb23983 When outsetting for rect blur fast path use abs of scale factors.
Fixes an issue where negative scales caused an inset rather than an outset.

Add GM.

Bug: chromium:899512
Change-Id: I9164c76da479af80d4f5389b057ec52a946726fb
Reviewed-on: https://skia-review.googlesource.com/c/171641
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-11-19 15:35:42 +00:00
Brian Salomon
09181ef042 Fix dst copy bounds for aa draw contained within clip.
Bug: chromium:892988

Change-Id: I615b60facec5724fb3a7c22a2eb59f72790156a3
Reviewed-on: https://skia-review.googlesource.com/c/171001
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-11-16 19:24:04 +00:00
Chris Dalton
09212197d7 sksl: Support fwidth()
Adds fwidth() to SkSL, and adds a gm that draws an AA squircle to test
it.

Bug: skia:
Change-Id: Ida306cc535a1d4b4568d0ad5cc9a5f235098f4e8
Reviewed-on: https://skia-review.googlesource.com/c/170726
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-11-13 20:52:47 +00:00
Mike Klein
024072af62 Reland "Improve degenerate 2pt conical gradient cases"
This reverts commit 95af4726bf.

Reason for revert: I think this may not have been the reason the Android roll was failing.  We've rolled, so it's a good time to try again.

Original change's description:
> Revert "Improve degenerate 2pt conical gradient cases"
> 
> This reverts commit 879dab87ab.
> 
> Reason for revert: Android roll failed.
> https://sponge.corp.google.com/target?id=93bc6b8d-9b42-4805-b204-46ae62f1b005&target=x86+CtsGraphicsTestCases&searchFor=&show=FAILED&sortBy=STATUS
> A test VectorDrawableTest.testVectorDrawableGradient fails.
> 
> Original change's description:
> > Improve degenerate 2pt conical gradient cases
> > 
> > This was originally a reland of "Fix div-by-zero loophole in gradient factory func", c34dd6c526, but:
> > 
> > The change caused blink layout tests when encountering very small or zero radii. The original patch switched the order of checking if the radii are equal and if the start radius was 0. In the case where both radii are 0, the original code created an actual radial gradient of radius 0 and the new code rejected the shader. A radial gradient with radius of 0 properly renders the last border color as a fill.
> > 
> > This made me realize that the case when the center positions and the radii are the same can be handled more correctly than just always returning an empty shader, so the fix now applies simplifications to the gradient definition depending on the tile mode and should not trigger any blink tests. I added a row to the gradient edge cases GM to make sure it degrades gracefully.
> > 
> > Original change's description:
> > > Fix div-by-zero loophole in gradient factory func
> > >
> > > Bug: oss-fuzz:10373
> > > Change-Id: I4277fb63e3186ee34feaf09ecf6aeddeb532f9c1
> > > Reviewed-on: https://skia-review.googlesource.com/c/168269
> > > Reviewed-by: Kevin Lubick <kjlubick@google.com>
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > 
> > Docs-Preview: https://skia.org/?cl=168487
> > Bug: oss-fuzz:10373
> > Change-Id: Ib0a6e7f807560a5dcf24d1c8e0146817af2d9606
> > Reviewed-on: https://skia-review.googlesource.com/c/168487
> > Reviewed-by: Mike Reed <reed@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=caryclark@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,michaelludwig@google.com
> 
> Change-Id: I91b896c4a438c02206679b327a01b47f40993965
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: oss-fuzz:10373
> Reviewed-on: https://skia-review.googlesource.com/c/170272
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>

TBR=caryclark@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,stani@google.com,michaelludwig@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: oss-fuzz:10373
Change-Id: I7577fcea9eb8a875e94723ab2cca2fcc990b82b2
Reviewed-on: https://skia-review.googlesource.com/c/170279
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-11 00:28:01 +00:00
Stan Iliev
95af4726bf Revert "Improve degenerate 2pt conical gradient cases"
This reverts commit 879dab87ab.

Reason for revert: Android roll failed.
https://sponge.corp.google.com/target?id=93bc6b8d-9b42-4805-b204-46ae62f1b005&target=x86+CtsGraphicsTestCases&searchFor=&show=FAILED&sortBy=STATUS
A test VectorDrawableTest.testVectorDrawableGradient fails.

Original change's description:
> Improve degenerate 2pt conical gradient cases
> 
> This was originally a reland of "Fix div-by-zero loophole in gradient factory func", c34dd6c526, but:
> 
> The change caused blink layout tests when encountering very small or zero radii. The original patch switched the order of checking if the radii are equal and if the start radius was 0. In the case where both radii are 0, the original code created an actual radial gradient of radius 0 and the new code rejected the shader. A radial gradient with radius of 0 properly renders the last border color as a fill.
> 
> This made me realize that the case when the center positions and the radii are the same can be handled more correctly than just always returning an empty shader, so the fix now applies simplifications to the gradient definition depending on the tile mode and should not trigger any blink tests. I added a row to the gradient edge cases GM to make sure it degrades gracefully.
> 
> Original change's description:
> > Fix div-by-zero loophole in gradient factory func
> >
> > Bug: oss-fuzz:10373
> > Change-Id: I4277fb63e3186ee34feaf09ecf6aeddeb532f9c1
> > Reviewed-on: https://skia-review.googlesource.com/c/168269
> > Reviewed-by: Kevin Lubick <kjlubick@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> Docs-Preview: https://skia.org/?cl=168487
> Bug: oss-fuzz:10373
> Change-Id: Ib0a6e7f807560a5dcf24d1c8e0146817af2d9606
> Reviewed-on: https://skia-review.googlesource.com/c/168487
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=caryclark@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,michaelludwig@google.com

Change-Id: I91b896c4a438c02206679b327a01b47f40993965
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: oss-fuzz:10373
Reviewed-on: https://skia-review.googlesource.com/c/170272
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2018-11-09 23:05:44 +00:00
Michael Ludwig
879dab87ab Improve degenerate 2pt conical gradient cases
This was originally a reland of "Fix div-by-zero loophole in gradient factory func", c34dd6c526, but:

The change caused blink layout tests when encountering very small or zero radii. The original patch switched the order of checking if the radii are equal and if the start radius was 0. In the case where both radii are 0, the original code created an actual radial gradient of radius 0 and the new code rejected the shader. A radial gradient with radius of 0 properly renders the last border color as a fill.

This made me realize that the case when the center positions and the radii are the same can be handled more correctly than just always returning an empty shader, so the fix now applies simplifications to the gradient definition depending on the tile mode and should not trigger any blink tests. I added a row to the gradient edge cases GM to make sure it degrades gracefully.

Original change's description:
> Fix div-by-zero loophole in gradient factory func
>
> Bug: oss-fuzz:10373
> Change-Id: I4277fb63e3186ee34feaf09ecf6aeddeb532f9c1
> Reviewed-on: https://skia-review.googlesource.com/c/168269
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

Docs-Preview: https://skia.org/?cl=168487
Bug: oss-fuzz:10373
Change-Id: Ib0a6e7f807560a5dcf24d1c8e0146817af2d9606
Reviewed-on: https://skia-review.googlesource.com/c/168487
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-11-09 16:36:05 +00:00
Mike Klein
c9eace8194 add unpremul gm
Change-Id: I3126fb8b055b58e45f1bd0d913413b4d4d38f032
Reviewed-on: https://skia-review.googlesource.com/c/166740
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-31 15:41:30 +00:00
Mike Reed
c88cc779ef remove (unused) vertical-text
Bug: skia:8487
Change-Id: Ia6715346a0214b0db2fc67294e45b5e04c1c24d8
Reviewed-on: https://skia-review.googlesource.com/c/163889
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-10-23 16:33:02 +00:00
Brian Salomon
d7065e72da Revert "Revert "Add experimental API to draw a set of SkImages in one SkCanvas call.""
This reverts commit 8d5b41b553.

Bug: skia:8444
Change-Id: I29b52c6fe9475c6113ec954b7918cf591111846c
Reviewed-on: https://skia-review.googlesource.com/c/161627
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-12 16:09:21 +00:00
Brian Salomon
8d5b41b553 Revert "Add experimental API to draw a set of SkImages in one SkCanvas call."
This reverts commit 0a0304c426.

Reason for revert: Breaking metal

Original change's description:
> Add experimental API to draw a set of SkImages in one SkCanvas call.
> 
> The client provides a src and dst rect for each image as well as
> a bitfield that indicates whether each edge of the image should be
> antialiased. This per-edge AA is useful for tiled compositors.
> 
> Rather than take a full SkPaint this API only takes an alpha, a filter
> quality (which is pinned to kLow), and a blend mode. This is a likely
> point of future evolution.
> 
> Currently the API is only fully implemented for kSrcOver on the GPU
> backend. With other blend modes or on other backends AA will be ignored
> for images that do not have all four edge AA flags set.
> 
> BUG: skia:8444
> 
> Change-Id: I143998dda8ad6a25f64e18cd600392ba553030ac
> Reviewed-on: https://skia-review.googlesource.com/c/159062
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@google.com,bsalomon@google.com,brianosman@google.com,reed@google.com

Change-Id: I815baaeee5de9c6722cf2b9d071a8e2f7c1b6a96
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/161622
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-12 14:25:06 +00:00
Brian Salomon
0a0304c426 Add experimental API to draw a set of SkImages in one SkCanvas call.
The client provides a src and dst rect for each image as well as
a bitfield that indicates whether each edge of the image should be
antialiased. This per-edge AA is useful for tiled compositors.

Rather than take a full SkPaint this API only takes an alpha, a filter
quality (which is pinned to kLow), and a blend mode. This is a likely
point of future evolution.

Currently the API is only fully implemented for kSrcOver on the GPU
backend. With other blend modes or on other backends AA will be ignored
for images that do not have all four edge AA flags set.

BUG: skia:8444

Change-Id: I143998dda8ad6a25f64e18cd600392ba553030ac
Reviewed-on: https://skia-review.googlesource.com/c/159062
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-12 13:14:24 +00:00
Michael Ludwig
72535fb55a Reland "Reland "Implement an explicit binary search-based analytic gradient colorizer""
This is a reland of f065907ccc

3rd time's the charm:

The new analytic gradient shader was sporadically triggering violations of the coverage as alpha
compatibility optimization. Unfortunately, even when using the same device and random seed for the
test, the bots did not always reproduce the error. However, we identified the likely cause of the
violation.

The test requires that all output channels are less than the input alpha, which it uses to validate
whether or not the shader is modulating its values by the input alpha. This test does not pass if
the RGB values are greater than 1. The original version of the analytic gradient shader used half4s
for its scale and bias values. Given the threshold limit for hardstops of 0.00024 (SkNearlyZero),
a very small interval that is not treated as a hardstop can create a scale or bias of over 4000.
This moves into the very imprecise region of 16-bit floats, making it plausible that the gradient
outputs colors greater than 1, due to rounding. The kicker is that the random test generation for
stop locations does not use a uniform distribution, but is instead biased towards the remaining
interval, which increases the likelihood of generating a small interval that is not treated as a
hard stop. We are keeping this behavior since ill-conditioned gradients are useful in testing.

Original change's description:
> Reland "Implement an explicit binary search-based analytic gradient colorizer"
>
> This reverts commit 9461dcf130.
>
> Reason for revert: Fixes for ANGLE's incorrect shader behavior
>
> Original change's description:
> > Revert "Implement an explicit binary search-based analytic gradient colorizer"
> >
> > This reverts commit dcc85fc610.
> >
> > Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
> >
> > Original change's description:
> > > Implement an explicit binary search-based analytic gradient colorizer
> > >
> > > Provides a reasonably flexible fragment processor that defines another
> > > colorizer implementation for gradients. It can support up to 8
> > > interpolation intervals (which is 16 colors if every stop is a hard stop
> > > or 9 colors if every stop is a smooth transition). It
> > > supports mixtures of hard and smooth stops. It is conditionally compiled
> > > into versions specific to the interval count (so it can produce up to
> > > 8 shader variants).
> > >
> > > The GrGradientShader controller does not remove the single and dual
> > > interval colorizers, which are useful specializations of this explicit
> > > binary search colorizer. Similarly, since it can only handle up to 8
> > > intervals, the texture colorizer is still used as a fallback.
> > >
> > > Currently it does not employ capabilities detection to determine if the
> > > hardware can support the number of required uniforms, which can become
> > > substantial for the larger gradient configurations.
> > >
> > > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> > > Reviewed-on: https://skia-review.googlesource.com/155080
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> >
> > TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
> >
> > Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > Reviewed-on: https://skia-review.googlesource.com/156541
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
>
> Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Reviewed-on: https://skia-review.googlesource.com/156542
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Change-Id: I2d050624781c77cdd160291cadbadac602b48bde
Reviewed-on: https://skia-review.googlesource.com/c/157569
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 13:10:29 +00:00
Robert Phillips
bfa76f20bf Add GM for less common YUV formats (take 2)
Bug: skia:7903
Change-Id: I2399e4aaae6b91914d637ff0e921e04596b52836
Reviewed-on: https://skia-review.googlesource.com/159141
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-03 17:22:02 +00:00
Mike Klein
b5ba83993b Revert "Add GM for less common YUV formats"
This reverts commit 412dd56589.

Reason for revert: serialize-8888

Original change's description:
> Add GM for less common YUV formats
> 
> Bug: skia:7903
> Change-Id: I0d6e6d6274d66a71aaf24b68b6d9ceb0f2148b68
> Reviewed-on: https://skia-review.googlesource.com/157601
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

TBR=jvanverth@google.com,robertphillips@google.com

Change-Id: I3c8375244ddee5d12836076793ec78a46cc04450
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7903
Reviewed-on: https://skia-review.googlesource.com/c/159043
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-02 20:36:15 +00:00
Robert Phillips
412dd56589 Add GM for less common YUV formats
Bug: skia:7903
Change-Id: I0d6e6d6274d66a71aaf24b68b6d9ceb0f2148b68
Reviewed-on: https://skia-review.googlesource.com/157601
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-10-02 18:57:58 +00:00
Brian Salomon
2213ee94c7 Add support for per-edge AA to GrTextureOp.
Outsetting in perspective case outsets the original homogeneous quad
points rather than the homogenized 2d points in order to avoid seaming
issues along shared edges.

Currently there is no way to trigger this from the public API and it
is tested by directly accessing GrRenderTargetContext from the added gm.

Change-Id: I24e0d53cc5821c8c8be07c23aca5bfafb4935c33
Reviewed-on: https://skia-review.googlesource.com/157600
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-02 16:45:07 +00:00
Mike Reed
1eb9af9029 delete textonpath code -- not used anywhere
Bug: skia:
Change-Id: Ib645f7c140f87123429170a0bf6f7ed86ce53b3f
Reviewed-on: https://skia-review.googlesource.com/158224
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-01 16:52:32 +00:00
Brian Osman
e2a801ddaa Revert "Reland "Implement an explicit binary search-based analytic gradient colorizer""
This reverts commit f065907ccc.

Reason for revert: Processor test failing (inconsistently) on several bots.

Original change's description:
> Reland "Implement an explicit binary search-based analytic gradient colorizer"
> 
> This reverts commit 9461dcf130.
> 
> Reason for revert: Fixes for ANGLE's incorrect shader behavior
> 
> Original change's description:
> > Revert "Implement an explicit binary search-based analytic gradient colorizer"
> >
> > This reverts commit dcc85fc610.
> >
> > Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
> >
> > Original change's description:
> > > Implement an explicit binary search-based analytic gradient colorizer
> > >
> > > Provides a reasonably flexible fragment processor that defines another
> > > colorizer implementation for gradients. It can support up to 8
> > > interpolation intervals (which is 16 colors if every stop is a hard stop
> > > or 9 colors if every stop is a smooth transition). It
> > > supports mixtures of hard and smooth stops. It is conditionally compiled
> > > into versions specific to the interval count (so it can produce up to
> > > 8 shader variants).
> > >
> > > The GrGradientShader controller does not remove the single and dual
> > > interval colorizers, which are useful specializations of this explicit
> > > binary search colorizer. Similarly, since it can only handle up to 8
> > > intervals, the texture colorizer is still used as a fallback.
> > >
> > > Currently it does not employ capabilities detection to determine if the
> > > hardware can support the number of required uniforms, which can become
> > > substantial for the larger gradient configurations.
> > >
> > > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> > > Reviewed-on: https://skia-review.googlesource.com/155080
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> >
> > TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
> >
> > Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > Reviewed-on: https://skia-review.googlesource.com/156541
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
> 
> Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Reviewed-on: https://skia-review.googlesource.com/156542
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com

Change-Id: Icd925d568d8cdffdc3020c07a9c50a4aa9cf0bb9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Reviewed-on: https://skia-review.googlesource.com/157429
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-27 16:50:52 +00:00
Michael Ludwig
f065907ccc Reland "Implement an explicit binary search-based analytic gradient colorizer"
This reverts commit 9461dcf130.

Reason for revert: Fixes for ANGLE's incorrect shader behavior

Original change's description:
> Revert "Implement an explicit binary search-based analytic gradient colorizer"
>
> This reverts commit dcc85fc610.
>
> Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
>
> Original change's description:
> > Implement an explicit binary search-based analytic gradient colorizer
> >
> > Provides a reasonably flexible fragment processor that defines another
> > colorizer implementation for gradients. It can support up to 8
> > interpolation intervals (which is 16 colors if every stop is a hard stop
> > or 9 colors if every stop is a smooth transition). It
> > supports mixtures of hard and smooth stops. It is conditionally compiled
> > into versions specific to the interval count (so it can produce up to
> > 8 shader variants).
> >
> > The GrGradientShader controller does not remove the single and dual
> > interval colorizers, which are useful specializations of this explicit
> > binary search colorizer. Similarly, since it can only handle up to 8
> > intervals, the texture colorizer is still used as a fallback.
> >
> > Currently it does not employ capabilities detection to determine if the
> > hardware can support the number of required uniforms, which can become
> > substantial for the larger gradient configurations.
> >
> > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> > Reviewed-on: https://skia-review.googlesource.com/155080
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
>
> Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Reviewed-on: https://skia-review.googlesource.com/156541
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com

Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Reviewed-on: https://skia-review.googlesource.com/156542
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-09-27 16:02:30 +00:00
Stephen White
cfe1264d74 GrTessellator: two fixes for boundary simplification artifacts.
The "pointy vertex" test was only considering the distance from the
next (outgoing) edge to the previous point. It must also consider the
distance from the previous (incoming) edge to the next point. If
either are less than a quarter pixel, the vertex is considered pointy
and should be removed. (884166)

Also (887103), when an interior region was completely removed due to
boundary simplification, it would leave a degenerate edge consisting
of the same vertex. So avoid introducing a join edge when prev == next.

Bug: 884166, 887103
Change-Id: I7f1d5b98e418d8f2a1c11643259d3cd74d08f286
Reviewed-on: https://skia-review.googlesource.com/157220
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-09-26 23:57:59 +00:00
Brian Osman
5ea41fc89b Remove more SkColorSpaceXform (and friends)
- gammaencodedpremul GM was just demonstrating something that we
  understand well (and have much better testing for).
- readpixels GM was filled with workarounds for things that are no
  longer true (unpremul images, clamped F16).
- Other uses can be switched to SkConvertPixels trivially.
- Remove SkColorSpaceXformPriv and SkColorLookUpTable, all unused.
- Remove SkColorSpaceXform_skcms.cpp, no longer referenced by clients.

Bug: skia:
Change-Id: I7298bb53aa61b49ad1398ebc504d35c119fd5cf4
Reviewed-on: https://skia-review.googlesource.com/157153
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-26 22:30:05 +00:00
Michael Ludwig
9461dcf130 Revert "Implement an explicit binary search-based analytic gradient colorizer"
This reverts commit dcc85fc610.

Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader

Original change's description:
> Implement an explicit binary search-based analytic gradient colorizer
> 
> Provides a reasonably flexible fragment processor that defines another
> colorizer implementation for gradients. It can support up to 8
> interpolation intervals (which is 16 colors if every stop is a hard stop
> or 9 colors if every stop is a smooth transition). It
> supports mixtures of hard and smooth stops. It is conditionally compiled
> into versions specific to the interval count (so it can produce up to
> 8 shader variants).
> 
> The GrGradientShader controller does not remove the single and dual
> interval colorizers, which are useful specializations of this explicit
> binary search colorizer. Similarly, since it can only handle up to 8
> intervals, the texture colorizer is still used as a fallback.
> 
> Currently it does not employ capabilities detection to determine if the
> hardware can support the number of required uniforms, which can become
> substantial for the larger gradient configurations.
> 
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> Reviewed-on: https://skia-review.googlesource.com/155080
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com

Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Reviewed-on: https://skia-review.googlesource.com/156541
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-09-24 19:40:54 +00:00
Michael Ludwig
dcc85fc610 Implement an explicit binary search-based analytic gradient colorizer
Provides a reasonably flexible fragment processor that defines another
colorizer implementation for gradients. It can support up to 8
interpolation intervals (which is 16 colors if every stop is a hard stop
or 9 colors if every stop is a smooth transition). It
supports mixtures of hard and smooth stops. It is conditionally compiled
into versions specific to the interval count (so it can produce up to
8 shader variants).

The GrGradientShader controller does not remove the single and dual
interval colorizers, which are useful specializations of this explicit
binary search colorizer. Similarly, since it can only handle up to 8
intervals, the texture colorizer is still used as a fallback.

Currently it does not employ capabilities detection to determine if the
hardware can support the number of required uniforms, which can become
substantial for the larger gradient configurations.

Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
Reviewed-on: https://skia-review.googlesource.com/155080
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-24 16:40:36 +00:00
Brian Salomon
d2fcfb5813 WEBGL_video_texture : sharing texture prototype in skia
Bug: 776222

Change-Id: I84c81bdaa6dc0b5548f116a28c6319e601effb32
Reviewed-on: https://skia-review.googlesource.com/146695
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kenneth Russell <kbr@google.com>
2018-09-18 02:22:00 +00:00
Mike Klein
8f5a7a6f50 first start on a P3 GM
We don't have anything drawing colors outside sRGB,
but now that we've got SkPaint::setColor4f(), that's easy.

Looks like we have lots of work to do.

Pin GrColor4f floats before converting to unsigned.
Underflowing floats would get pinned to 255 spuriously
instead of to 0.  I think this fixes the failing CQ
bot, and the white square problem.

Change-Id: I866963ff026e6ab891b4c7d57decc43538000099
Reviewed-on: https://skia-review.googlesource.com/153640
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-11 19:17:06 +00:00