Commit Graph

24233 Commits

Author SHA1 Message Date
Chris Dalton
6937103881 Revert "Abolish absClear"
This reverts commit f948db6228.

Reason for revert: Vulkan assertion on Nexus5

Original change's description:
> Abolish absClear
> 
> Bug: skia:
> Change-Id: Ic4a0e640623677c06112d0735ffc5682049baf11
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240771
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I071c9878d26ce0f1d91473ada48e9a702bb472de
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242480
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-09-18 15:44:34 +00:00
Brian Salomon
14cb4139eb Use mipmapping/protected to lookup scratch textures.
Include protected in scratch key.

Change-Id: I0dfc58c9f54e8279a39adf4bad808b7e0e72cba2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241397
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-18 15:35:05 +00:00
Jim Van Verth
e3671013e5 Reland "Add ETC2 support to Metal backend."
This is a reland of c25802db30

Original change's description:
> Add ETC2 support to Metal backend.
> 
> Fills out onCreateCompressedTexture and sets iOS caps to support ETC2.
> Skia supports no compressed texture formats on MacOS as yet.
> 
> Bug: skia:8243
> Change-Id: I2ce20f601c035a8822e658c88b815fdd8587aa98
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240692
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:8243
Change-Id: Idebc46f29f4b75d216cf877606af290b0b3b8318
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242080
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-09-18 15:19:02 +00:00
Chris Dalton
f948db6228 Abolish absClear
Bug: skia:
Change-Id: Ic4a0e640623677c06112d0735ffc5682049baf11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240771
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-09-18 08:54:02 +00:00
Chris Dalton
fac91963fc Revert "Reorder msaa and mipmap resolves to happen all at once"
This reverts commit fd1414608b.

Reason for revert: red bots

Original change's description:
> Reorder msaa and mipmap resolves to happen all at once
> 
> Makes it so every renderTask has only one textureResolveTask, and
> modifies GrTextureResolveTask to perform multiple resolves
> back-to-back.
> 
> Bug: skia:9406
> Change-Id: I93566cf4b23764bd846a1e0a0848642c9b3a507a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241936
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,robertphillips@google.com,csmartdalton@google.com

Change-Id: I12f340da3dfec81477ceeab806ca76ce2b3c397b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9406
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242390
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-09-18 08:24:01 +00:00
Chris Dalton
fd1414608b Reorder msaa and mipmap resolves to happen all at once
Makes it so every renderTask has only one textureResolveTask, and
modifies GrTextureResolveTask to perform multiple resolves
back-to-back.

Bug: skia:9406
Change-Id: I93566cf4b23764bd846a1e0a0848642c9b3a507a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241936
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-18 06:38:59 +00:00
Herb Derby
a9d44b61f2 Revert "SkZip - synchronized indexing of several pointers"
This reverts commit f3c4a829c6.

Reason for revert: std::get<T> is a c++14 std library call

Original change's description:
> SkZip - synchronized indexing of several pointers
> 
> This is the mechanism for syncing a bunch of things with
> contiguous memory like vector<>, array<> and SkSpan<>.
> 
> In a following CL, a convenience function SkMakeZip will
> easily convert most containers into a zip.
> 
> Change-Id: Icda5b1774ae21c4c163a663f6d2b0f119f63ccba
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240200
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Idc52b0552cd01b163357a45d43d9531e62694dda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242356
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-09-18 04:29:19 +00:00
Chris Dalton
a37ea9246e Use a "decal" domain for filterMaskGPU
In addition to requiring absClear, the old approach yielded
asymmetrical blurs where the top and left edges got a "clamp" mode,
and the right and bottom edges effectively got a "decal" mode.

Bug: skia:
Change-Id: If72da4374eb2f0475acae59e269d44cb72c5ce95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240759
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-09-18 04:04:38 +00:00
Herb Derby
f3c4a829c6 SkZip - synchronized indexing of several pointers
This is the mechanism for syncing a bunch of things with
contiguous memory like vector<>, array<> and SkSpan<>.

In a following CL, a convenience function SkMakeZip will
easily convert most containers into a zip.

Change-Id: Icda5b1774ae21c4c163a663f6d2b0f119f63ccba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240200
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-17 23:01:50 +00:00
Ethan Nicholas
5a9a0b388e fixed an SkSL parse issue
Change-Id: Icc44b10184c7be564fe7d759075a9c87c53af712
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242141
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-17 21:25:06 +00:00
Chris Dalton
6ff0613abc Reland "Use "clamp" when reexpanding gaussian blurs"
This is a reland of f19510e320

Original change's description:
> Use "clamp" when reexpanding gaussian blurs
> 
> Bug: skia:
> Change-Id: Ib0a59a56b38eb743f0c78de2cf717d04c775c8df
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240666
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Bug: skia:
Change-Id: Ie2bb23e1c0def395b5af88bd42745627e9e9b05a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242075
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-09-17 18:56:15 +00:00
Ethan Nicholas
409f6f0dec Additional SkSL swizzle optimizations
Now optimizes away identity swizzles and collapses swizzles of swizzles
down to a single swizzle.

Bug: skia:9180
Change-Id: I259ff4b316ec3479647abf9615a0e4c61c0f34c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241880
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-17 18:39:41 +00:00
Brian Salomon
db151e073f Respect ImageSetEntry alpha in one-at-a-time code path
Previously it was ignored. Update GM with test case that covers this.

Change-Id: I93e7de285a9d4020dd48e14e09e55fdfb346fff7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242083
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-17 17:07:54 +00:00
Brian Osman
3257dda627 Fix standalone SkSL build after adding SkOnce to SkSLByteCode
Also trim includes in SkSLCompiler while I'm there

Change-Id: I87b27199b84e5e856e0a914f44368313a6f226e4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242085
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-17 16:51:37 +00:00
Herb Derby
9830fc463c A fix and unit test for jagged characters
For tip of tree

Test 1 - half pixel rendering
Adjust the positions of the glyph quads so they never land on a 1/2
pixel position. Having a 1/2 pixel position causes some drivers to
point sample the glyphs poorly because the round differently for
different pixels.

Test 2 - smooth scrolling
Move a textblob very slowly in y to make sure in matches a freshly
constructed textblob.

Fix:
Regen the GrTextBlob if the translation is not by whole pixels.

Change-Id: Ifa8ac9c759a31d5108c47e7ee2ffccbbdc994026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241360
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-17 16:42:18 +00:00
Brian Osman
1f4305d1b5 Move raster hack for color type on layers with image filters to device
Change-Id: I64e5abcaba909c46c9e350cb24b68c158df54a8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241878
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-17 16:10:26 +00:00
Brian Osman
11b877e6dc Make SkSL::ByteCodeFunction::preprocess thread-safe
Change-Id: I64a1731efb8d5923f81d2449ae2c27fda37fd0b6
Bug: skia:9427
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242079
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2019-09-17 14:47:04 +00:00
Brian Salomon
a90382fcf6 Pass color types when creating texture with initial data.
One describes the color type use case for the texture and the other
the color type of the texel data, a la writePixels().

Bug: skia:6718

Change-Id: I3ca2ab9f76aaeca4b2861a171b1aaacaa0709d1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240679
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-17 13:38:23 +00:00
Brian Salomon
747b3409bc Fix bug where coverage on interior of stroked rects is applied twice
When we were not supposed to be folding coverage into alpha we would still
set the innermost rectangle's color to transparent black.

Change-Id: Idfc29da9778f9d7d0381a8084717134e835dc744
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241882
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-17 13:10:43 +00:00
Jim Van Verth
ae80107766 Revert "Add ETC2 support to Metal backend."
This reverts commit c25802db30.

Reason for revert: Causing assert in MtlBackendAllocationTest.

Original change's description:
> Add ETC2 support to Metal backend.
> 
> Fills out onCreateCompressedTexture and sets iOS caps to support ETC2.
> Skia supports no compressed texture formats on MacOS as yet.
> 
> Bug: skia:8243
> Change-Id: I2ce20f601c035a8822e658c88b815fdd8587aa98
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240692
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I45adf78a7106be69bd8a6437f61abe28eddedbb2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8243
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241877
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-09-16 19:49:17 +00:00
Jim Van Verth
c25802db30 Add ETC2 support to Metal backend.
Fills out onCreateCompressedTexture and sets iOS caps to support ETC2.
Skia supports no compressed texture formats on MacOS as yet.

Bug: skia:8243
Change-Id: I2ce20f601c035a8822e658c88b815fdd8587aa98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240692
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-16 18:24:04 +00:00
Brian Osman
4af42fcca1 Fix precompiling shaders on GLES / Android
We need to specify attribute locations and (sometimes) frag shader
output locations. Desktop GL worked fine without this, but Flutter
ran into this problem, and a Pixel 2 reproduced the issue.

Note that both APIs (BindFragDataLocation and BindAttribLocation)
don't take effect until the next time the program is linked, so
we have to relink the program after applying those changes.

I was afraid that re-linking would eliminate the perf benefits of
pre-compiling the shaders, but (at least on Pixel 2) that's not
the case. I traced the life of a single program, and the initial
link (during precompile) was 4.4 ms. The re-link took 0.23 ms.

Change-Id: Iadb3b425a8cf9f6a52e015c2e37f875c0fd73d6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241758
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-16 17:13:23 +00:00
Nigel Tao
6447a1a777 Remove a deprecated Wuffs io_buffer::reader call
Bug: skia:8235
Change-Id: I4bd439bd8449b419cfc2ccedc2aef9e7e7ed154f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241496
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-09-16 15:40:31 +00:00
Brian Salomon
c22498502c Mark last render target bound ID invalid after clearing texture levels using glClear
Fixes WebGL invalid framebuffer issues.

Change-Id: I841b8aa27f126feeb9971123c8b025630cdd3e0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241757
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-16 15:39:41 +00:00
Mike Reed
4241f5e0a8 Revert "add guard to switch to SkPathTypes"
This reverts commit e1af44498b.

Reason for revert: breaking google3?

Original change's description:
> add guard to switch to SkPathTypes
> 
> Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=robertphillips@google.com,kjlubick@google.com,fmalita@chromium.org,reed@google.com

Change-Id: If1fffb6310921ee6f213af000da793afcf62ab0b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241560
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-14 19:13:44 +00:00
Mike Reed
e1af44498b add guard to switch to SkPathTypes
Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-14 01:26:38 +00:00
Khushal Sagar
2cb1315d99 Reland "gpu: Update GrGLCaps usage of fTextureRectangle with chromium."
This reverts commit f010089975.

Reason for revert: Fixes landed in chromium (see crbug.com/998038).

Original change's description:
> Revert "gpu: Update GrGLCaps usage of fTextureRectangle with chromium."
> 
> This reverts commit c43ab22a8c.
> 
> Reason for revert: crbug.com/998038
> 
> Original change's description:
> > gpu: Update GrGLCaps usage of fTextureRectangle with chromium.
> > 
> > R=​bsalomon@google.com
> > 
> > Bug:900706
> > Change-Id: I0ca0062f12f905c47e9f096acf675b93f131e390
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234990
> > Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,khushalsagar@chromium.org
> 
> Change-Id: Iebdaed117229987f23ec1b1ad48ec6719972ad95
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 900706
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237431
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,khushalsagar@chromium.org,michaelludwig@google.com

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

Bug: 900706, 998038
Change-Id: I959fbc97c2424ebb9d4e8fa570d71ff941194daa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240824
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
2019-09-13 21:42:32 +00:00
Ethan Nicholas
cf4deab60e Improved skslc depth tracking
This fixes a class of bugs discovered by fuzzing, in which a very
complicated expression leads to a stack overflow.

Bug: oss-fuzz:15510
Change-Id: Idee6df8bb1dd4ca101bcc0ef21a974c58017f8a8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240510
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-13 20:54:50 +00:00
Michael Ludwig
bd2f070633 Always create an approx-size texture for approx-fit proxies
Bug: chromium:1003415
Change-Id: I699a22aaca36b6ec9f78076732eb810a90154337
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241356
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-13 19:55:59 +00:00
Ethan Nicholas
e455f65ecf SkSL now supports constant 1/0 in all swizzle channels, as well as "LTRB" as an alias for "xyzw" / "rgba".
Bug: skia:9181
Change-Id: Iedefbb94bbb05ce37fcf66ca0b40c97f2adf7698
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241276
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-13 19:50:59 +00:00
Michael Ludwig
043dba039e Revert "Use "clamp" when reexpanding gaussian blurs"
This reverts commit f19510e320.

Reason for revert: chrome layout tests need rebasing

Original change's description:
> Use "clamp" when reexpanding gaussian blurs
> 
> Bug: skia:
> Change-Id: Ib0a59a56b38eb743f0c78de2cf717d04c775c8df
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240666
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I53b3a16259ea9a9d1863be85fd5f2e0f1383ff3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241277
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-13 14:46:40 +00:00
Mike Reed
430470d519 make rectcontour and nestedrects private
Change-Id: I37b81f3cd96acc310ce78244d427eeb9c7999061
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241078
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-09-13 00:17:49 +00:00
Stephen White
7ea2ada521 Tiny Dawn fix: don't submit empty list of command buffers to the queue.
Change-Id: I1a474007e26a5973431c2ddf9bae99c3e3cb1c37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241047
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-09-12 21:08:16 +00:00
Stephen White
9ec33d1748 Update Dawn backend to recent GrGpu::onCreateTexture() change.
Change-Id: I9e329406f70eb1a0f8b86088ee9c2b7baa32f9af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241046
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-09-12 20:44:06 +00:00
Jim Van Verth
c13030169f Fix ETC1 support on iOS.
iOS doesn't support the ETC1 GL format, but does support ETC2 which has
ETC1 support as well. We should probably default to ETC2 in any case.

Change-Id: Ifd34fc602a1227f76316a8e27cf5555605c66840
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241045
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-09-12 17:47:39 +00:00
Chris Dalton
f19510e320 Use "clamp" when reexpanding gaussian blurs
Bug: skia:
Change-Id: Ib0a59a56b38eb743f0c78de2cf717d04c775c8df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240666
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-09-12 17:43:39 +00:00
Brian Salomon
1d19da0c11 Update fully lazy proxy checks to look for negative w/h
Bug: chromium:1000004
Change-Id: I73fcd98682853a057d8ee6a1c224bf43587f906a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240691
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-12 13:40:19 +00:00
Mike Klein
a424536401 rewrite tricky loop to avoid -Wsizeof-array-div
I don't see anything particularly wrong with the code as written, but
it's triggering a warning from the new Clang -Wsizeof-array-div because
it _looks_ like a bug, dividing sizeof(SkPoint[2]) by sizeof(SkScalar).
(The answer is 4.)

We can rewrite this to just not trigger the warning.

See https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=36439

Bug: fuchsia:36439
Change-Id: I73bef83add9050d95b3ccf69e613ab009c6a152b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240825
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-12 13:26:39 +00:00
Robert Phillips
429f0d380c Add kRG_1616 and kAlpha_16 SkColorTypes
This also switches GrColorType::kR_16 to kAlpha_16 to more closely match raster.

Bug: skia:9121
Change-Id: I03c6e6c52c90aa4223478c5ea6c8b2ed8558f677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239930
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-12 12:20:09 +00:00
Brian Salomon
120e7d6766 Make building in Chrome with base/logging.h included in SkTypes.h work.
Doesn't add base/logging.h, just fixes conflicts with doing so (at least
on Linux build.)

Change-Id: I6f5d1000f0c6ddf77d6c4319f243fc5c6ef38475
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240684
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-11 14:58:43 +00:00
Brian Salomon
d2a8ae2b71 Reland "Separate texture creation from uploading in GrGpu subclasses."
This is a reland of a7398246cb

TBR:egdaniel@google.com

Original change's description:
> Separate texture creation from uploading in GrGpu subclasses.
>
> GrGpu base class still allows creation with initial data, but separated
> at subclass level into create and then write pixels.
>
> GrGpu handles determining which levels need clearing and GrGpu
> subclasses take a mask and clear levels with mask bit set.
>
> GrGLGpu uses three pronged clear strategy:
> glClearTexImage() if supported, glClear() if format is FBO bindable, and
> lastly glTexSubImage2D with zero'ed buffer.
>
> Change-Id: I65fb1e60eed8f9d0896d686d3baeb10b57ff8f39
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236676
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

Change-Id: I54cda3b6a4b017a94ef1f50bb3748c45a24d8936
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240558
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-10 21:27:13 +00:00
Stephen White
c0c05047c2 Dawn: implement Sampler cache (optimization).
Change-Id: I0b1fabadb3fddd90350eff3b13037ce92c5dbfd8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238178
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-09-10 20:27:39 +00:00
Jim Van Verth
a431186414 Wrap MTLEvent code in availability attributes.
Allows us to build with a newer SDK and an older deployment target.

Bug: skia:8243
Change-Id: I06dc2737e2661dc81d98c2411b93123642d4a1e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240514
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-09-10 19:51:35 +00:00
Brian Salomon
8e63cab2e8 Revert "Separate texture creation from uploading in GrGpu subclasses."
This reverts commit a7398246cb.

Reason for revert: breaking bots

Original change's description:
> Separate texture creation from uploading in GrGpu subclasses.
> 
> GrGpu base class still allows creation with initial data, but separated
> at subclass level into create and then write pixels.
> 
> GrGpu handles determining which levels need clearing and GrGpu
> subclasses take a mask and clear levels with mask bit set.
> 
> GrGLGpu uses three pronged clear strategy:
> glClearTexImage() if supported, glClear() if format is FBO bindable, and
> lastly glTexSubImage2D with zero'ed buffer.
> 
> Change-Id: I65fb1e60eed8f9d0896d686d3baeb10b57ff8f39
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236676
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Icc6860053242ff1a55784a0f38938968f9e5e5b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240556
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-10 19:02:47 +00:00
Stephen White
7fba36b88a Dawn: implement staging buffer manager.
Use managed staging buffers for texture uploads, uniforms and buffers.

Change-Id: I063707c160236725d27a1d1bfb197d3096a07b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238120
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-09-10 19:02:15 +00:00
Stephen White
2adbf9ce1c Update Dawn backend to accommodate recent Skia API changes.
Change-Id: Ib0667fbff9a16fe796378134a17008ece6267d06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240508
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-09-10 18:55:45 +00:00
Brian Salomon
a7398246cb Separate texture creation from uploading in GrGpu subclasses.
GrGpu base class still allows creation with initial data, but separated
at subclass level into create and then write pixels.

GrGpu handles determining which levels need clearing and GrGpu
subclasses take a mask and clear levels with mask bit set.

GrGLGpu uses three pronged clear strategy:
glClearTexImage() if supported, glClear() if format is FBO bindable, and
lastly glTexSubImage2D with zero'ed buffer.

Change-Id: I65fb1e60eed8f9d0896d686d3baeb10b57ff8f39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236676
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-09-10 18:06:43 +00:00
Ethan Nicholas
66d8006c2b fixed an assertion error with unspecified sksl array sizes
Bug: oss-fuzz:15329
Change-Id: I994e58e794e4c0ee97a59ff83f295dc981ba5dba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240276
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-10 17:35:03 +00:00
Brian Osman
2ab2ac03d8 GL: Don't leak shader objects when program linking fails
Change-Id: I9e0895811176c795cafd356495802128539e4cab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240278
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-10 15:30:37 +00:00
Brian Salomon
b2d5d40a33 Adapt GrRectBlur for cases with rect W/H less than six sigma.
Add GM that generates reference blur rect images and compares against
actual.

Change-Id: If0ce291e211fefe96af8afdf0a60636b5f40ef47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239757
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-10 14:39:07 +00:00
Brian Salomon
b88894c881 Remove per-format glCheckframebufferStatus checks.
A long time ago we were more aggressive about attempting to make
renderable surfaces that were not required color-renderable than
currently.

Doing this check seems to be tickling a driver bug on some Mali
drivers, discovered while working on
https://skia-review.googlesource.com/c/skia/+/236676/7

Change-Id: I89d5d84ea2d63230b89dff65c7a93789327bbe09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240283
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-10 13:06:47 +00:00
Herb Derby
b831e26be3 Cleanup SkPackedGlyphID
Simplify lengths, positions and masks. The old code used to support
both unicode, and SkGlyphIDs; unicode support is not needed since
unicode->glyphID translation was moved to the typeface. Change the
glyph id field from 24 bits to 16.

Change-Id: I28524870c97a441159c5b00acfc2c43834924c8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240280
Commit-Queue: Herb Derby <herbderby@gmail.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-09-09 21:52:44 +00:00
Brian Osman
9c173c8347 Remove temporary Metal pipeline cache size hack
Landed a Chromium CL to set this in GrContextOptions:
https://chromium-review.googlesource.com/c/chromium/src/+/1790501

Change-Id: I0d328b74eb356768638fb851a4523884456fd543
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240279
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-09 21:11:37 +00:00
Ethan Nicholas
c2d84bfa74 fixed byte/ubyte types in SPIR-V output
Bug: oss-fuzz:15313
Change-Id: Id694413b5c4de41b4e64ed45b732aaa4c52b5f1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240198
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-09 18:53:38 +00:00
Greg Daniel
28d40b2e7a Reland "Add support for direct use of vulkan primary command buffer in render pass."
This reverts commit db53a59cb9.

Reason for revert: Going to reland with the code but the caps flag turned off.

Original change's description:
> Revert "Add support for direct use of vulkan primary command buffer in render pass."
> 
> This reverts commit eedd08576a.
> 
> Reason for revert: This is causing image failures on 5x and s9 which look like driver issues. But going to revert for the weekend and probably reland with those devices behind a flag.
> 
> Original change's description:
> > Add support for direct use of vulkan primary command buffer in render pass.
> > 
> > Change-Id: Icd43965da49963fc9b6ac6c1f7a40be50f2055e8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239920
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,jvanverth@google.com
> 
> Change-Id: Ia2e0f0d01b5aaf12f7d42584f19ae745bee0765c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239929
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

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

Change-Id: Ia0fc279d17f8829ce412955dea88106f8676b1d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240199
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-09-09 15:25:52 +00:00
Ethan Nicholas
73b8376b30 Fixed skslc assertion failure discovered by fuzzer
This particular issue probably wouldn't ever occur in hand-written code, but
such is fuzzing...

Bug: oss-fuzz:17061
Change-Id: Ia5da7b75afef8b49bb19ddb7f1ea8696053c2e54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240197
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-09 14:05:41 +00:00
Brian Osman
e8820d45ce Remove legacy flag: GrContextOptions::fDisallowGLSLBinaryCaching
Subsumed by fShaderCacheStrategy, clients have switched over.

Change-Id: I70b6ade4ccab2f48f2ef9437ae65c78cf458cfe4
Bug: skia:9402
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239928
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-09 13:43:51 +00:00
Mike Reed
78fb80a2b3 share private iterator/helpers for building paths
pre-cl to pave the way for SkPathRaw and pathbuilders

Change-Id: Ieda1230b91353e92b75bc7336fc35bbb4c7abdaa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240196
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-09-09 12:31:51 +00:00
Greg Daniel
db53a59cb9 Revert "Add support for direct use of vulkan primary command buffer in render pass."
This reverts commit eedd08576a.

Reason for revert: This is causing image failures on 5x and s9 which look like driver issues. But going to revert for the weekend and probably reland with those devices behind a flag.

Original change's description:
> Add support for direct use of vulkan primary command buffer in render pass.
> 
> Change-Id: Icd43965da49963fc9b6ac6c1f7a40be50f2055e8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239920
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ia2e0f0d01b5aaf12f7d42584f19ae745bee0765c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239929
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-09-06 20:57:09 +00:00
Greg Daniel
c30f1a936d Move surface wait ops to GrRenderTasks.
Change-Id: Id989a666e67be85af6ed72447696657b8c11aaa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239443
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-06 19:57:26 +00:00
Mike Reed
689188a438 simplify convexity-helper code
Change-Id: I7dd015a1cf76570bc2a6f00601800c46a3bd88a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239926
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-09-06 19:47:42 +00:00
Brian Osman
ed58e004e0 Add support for pre-compiling cached SkSL shaders
The client can do a test run of their application with
a persistent cache set to SkSL mode. They store the key
and data blobs that are produced.

Ship those blobs with the application. At startup, call
GrContext::precompileShader for each key/data pair. This
compiles the shaders, and stores the GL program ID, plus
a small amount of metadata in our runtime program cache.

Caveats:
* Currently only implemented for the GL backend. Other
  backends will require more metadata to do any useful
  amount of work. Metal may need a more drastic workflow
  change, involving offline compilation of the shaders.
* Currently only implemented for cached SkSL (not GLSL
  or program binaries). Supporting other formats again
  requires more metadata, and the cached shaders become
  increasingly specialized to GPU and driver versions.
* Reusing the cached SkSL on different hardware is not
  supported. Many driver workarounds are implemented in
  the SkSL -> GLSL transformation, but some are higher
  level. Limiting device variance by artificially hiding
  extensions may help, but there are no guarantees.

* The 'gltestprecompile' DM config exercises this code
  similarly to 'gltestpersistentcache', ensuring that
  results are visually identical when precompiling, and
  that no cache misses occur after precompiling.

Change-Id: Id314c5d5f5a58fe503a0505a613bd4a540cc3589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239438
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-06 19:45:09 +00:00
Mike Reed
f6cb6eddec speed-up rotated rects for drawAtlas
Apply the rotation before we init the path, saving the cost of calling
path.transform().

Before

  14/14  MB	1	8.39ms	8.51ms	8.49ms	8.63ms	drawAtlas_colors_rotated
  14/14  MB	1	7.08ms	7.23ms	7.23ms	7.49ms	drawAtlas_rotated

After

  14/14  MB	1	7.74ms	7.87ms	7.84ms	7.93ms	drawAtlas_colors_rotated
  16/16  MB	1	6.28ms	6.59ms	6.51ms	6.63ms	drawAtlas_rotated

Change-Id: Iae117acec8c4f2b5e5810330529951079a13420c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239922
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-09-06 19:42:39 +00:00
Ethan Nicholas
c70027b151 Revert "Revert "switched SkSL interpreter over to threaded code""
This reverts commit cbdc829ff1.

Bug: skia:
Change-Id: Idb7ad413431e6556bc040369df258655c2349ef2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239447
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-06 19:11:10 +00:00
Greg Daniel
eedd08576a Add support for direct use of vulkan primary command buffer in render pass.
Change-Id: Icd43965da49963fc9b6ac6c1f7a40be50f2055e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239920
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-09-06 18:39:40 +00:00
Robert Phillips
aee18c95b1 Cleanup after removal of IORefs from GrSurface
The removal of IORefs from GrSurface makes a lot of other cruft obsolete.

Change-Id: I0e02d680a17dc4f4ec705cb6ee4c294738271e28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239919
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-06 17:55:45 +00:00
Robert Phillips
d470e1b905 Add kRG_88_SkColorType
Bug: skia:9121

Change-Id: Id2a12a5d607b84ce393d2b58233bf8e23f646059
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235797
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-06 17:55:26 +00:00
Mike Reed
7b5abd8a9b don't call mutex if we're unique
Takes the overhead of invoking the Editor down to near 0. This affects
every call to SkPath for adding segments (e.g. moveTo, lineTo).

10% faster for rotated drawAtlas

Change-Id: Ice66fc78042429dc545e597a352195cf1ce54187
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239918
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-06 16:27:05 +00:00
Brian Osman
172bb44f2d Make the size of program/pipeline caches configurable in GrContextOptions
Change-Id: I988fd8cc7e78e2124f20b7d8a815f160bb166756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239756
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-06 14:43:05 +00:00
Mike Reed
43ad1a4e30 use scratch path to save on mallocs in drawAtlas
20% savings on drawAtlas with rotated content

Change-Id: I928de590629c9f1ea41e9053041095922cab3efc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239917
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-09-06 14:26:45 +00:00
Robert Phillips
bf8bf83642 Remove IORefs from GrSurface
Change-Id: Ib52b54acbf91e3993a6791b83c759fa768c3fdd1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236339
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-06 12:41:35 +00:00
Herb Derby
d9401037cd Remove bool for RemoteStrike send
Change-Id: Iae5afc5601786030af74c3af3d760f5a942d30a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237897
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
2019-09-05 22:54:09 +00:00
Mike Reed
8fda88ed6d reverse/restore order of verbs in path to be forward (normal)
As part of this (clean up), also removed support for serialized-paths
older than version-4, which was introduced Feb 2018.

Change-Id: I2dc74a52bb8bdd7ea0cb2d8a78b644ca783eb31f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239102
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-05 21:14:08 +00:00
Khushal
498a9b2449 Reland: Only send the RemoteStrikes that have pending glyphs.
This reverts commit 94c6647556. The issue
was that we were not clearing the set of locked strikes, if there is no
data to send. As a result the client was assuming strikes are locked
even after they were purged on the service side.

R=herb@google.com

Bug:999682
Change-Id: I767dd0cab81e085123058201dab042628ac4e241
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239343
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-09-05 20:39:12 +00:00
Greg Daniel
f0c681e459 Begin renderpasses immediately in GrVkOpsRenderPass.
This change will allow us to easily switch between rendering to a
primary vs secondary command buffer.

Change-Id: Iaa066f24b64a686db41a1554b0d75c185714ef8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239100
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-09-05 20:23:12 +00:00
Michael Ludwig
b6e8922955 Clean up prior backdrop-filter CL
This addresses reviewer comments from https://skia-review.googlesource.com/c/skia/+/239108 that were postponed to get the first CL landed ASAP.

Additionally, removes the now unnecessary applyCTMForBackdrop() function.

Bug: skia:9074
Change-Id: Ibc3ac4a4edd7e5546fa83145346869a68efc33f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239440
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-05 19:59:46 +00:00
Greg Daniel
f793de1189 Update some ops to create their buffers in onPrepare.
Need for a follow on change, we need all ops to do all their prep work
which includes creating needed buffers before we start calling
execute on ops. This change updates the few ops that were creating their
buffers in onExecute.

Change-Id: I0f43b0cc35359e1e7ccfb3b159e79bdfe288dcb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239436
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-09-05 19:43:11 +00:00
Ethan Nicholas
cbdc829ff1 Revert "switched SkSL interpreter over to threaded code"
This reverts commit adecf4b6d5.

Reason for revert: breaking the entire world

Original change's description:
> switched SkSL interpreter over to threaded code
> 
> Bug: skia:
> Change-Id: I2a7b772a874aa920b8509214c25e874020c896ce
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238962
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=brianosman@google.com,ethannicholas@google.com

Change-Id: I1d5ce9d11b2d94feb29c9bd2f0608526ddea2d99
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239556
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-05 18:06:59 +00:00
Ethan Nicholas
adecf4b6d5 switched SkSL interpreter over to threaded code
Bug: skia:
Change-Id: I2a7b772a874aa920b8509214c25e874020c896ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238962
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-09-05 17:44:43 +00:00
Michael Ludwig
6d1c0d4196 Avoid use of SkMatrixImageFilter to handle CTM for backdrop filtering
The DrawDeviceWithFilter function used to rely on SkImageFilter's
applyCTMForBackdrop, which would create a new DAG and use an
SkMatrixImageFilter node to account for the transformation. However,
that filter is really meant to perform a transformation prior to the
CTM matrix. Abusing matrix math to instead have it map the backdrop
contents back into the CTM local space grossly inflated the size of the
temporary images needed when under many perspective transforms.

This CL instead takes over control of the CTM decomposition and draws
the backdrop (src) content into a temporary layer directly, and then
feeds that through the image filtering. The code is somewhat cumbersome
to follow because of the combination of coordinate spaces and need to
make everything relative to the top left corner of the images.

When the rest of my image filter refactor is more underway, I believe that
a lot of the coordinate space math and image origin accounting will
be much cleaner, but the overall backdrop filtering strategy would remain
similar to this new implementation.

Bug: skia:9074
Change-Id: Ibd2995e81d2b308c74b2d298da5e38daa74c8677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239108
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-05 16:35:18 +00:00
Chris Dalton
d6cda8d1cb Rename GrGLIRect to GrNativeRect
This will allow us to reuse the "setRelativeTo" logic in more places
than GL.

Bug: skia:
Change-Id: Ic67b211d2a1b27535187ddae8e4771f595dc0397
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239414
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-05 15:46:18 +00:00
Chris Dalton
76500e5d0a Clean up GrGLIRect
Renames fLeft/fBottom to fX/fY, removes the GL calls, and adds static
"MakeRelativeTo" methods.

Bug: skia:
Change-Id: I7a09673f29a771a35cc52ec049421591d6077659
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239413
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-09-05 15:37:08 +00:00
Brian Salomon
f0b8bf35a8 Fix profile width check in GrRectBlurEffect.
Previously this code was given a rectangle that was already outset
3 sigma. Thus, the 12 sigma check was correct. However, it is now
given the original rect so the check should be against 6 sigma.

Bug: chromium:995308
Change-Id: Ibd234c6de7ee4e993b174608bbad11209755f8b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239439
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-05 14:37:08 +00:00
Brian Salomon
e736684166 Go back to rect blur profile textures.
It's faster than analytic.

This version of profile texture has better binning and simpler shader
logic than the original. I believe it also avoids some integralization
that led to artifacts in the previous texture implementation.

We oversize the profile for the blur, bin by pow 2 with a 32 texel min
and then rescale the texture coordinates over a 6 sigma range in the
shader. We pre-inset the rect uniform so the texture is always placed
with one end at the rect edge, extending outward.

Bug: chromium:995308
Change-Id: I739db98d4df69de0f5b2f5dda079cf034ba32035
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239119
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-04 17:31:26 +00:00
Florin Malita
8bb6f61d6f [svgcanvas] Refactor clipping
Instead of emitting one fully-resolved clip per primitive, build a
clip hierarchy based on SkClipStack genIDs and SVG groups.

Bug: skia:9344
Change-Id: Ic26c7cd2e268a4cc2f251757f0e9e22475fb9994
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236346
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-04 14:36:32 +00:00
Ben Wagner
6be3ea7a7d [pdf] Disable default width calculation.
Unfortunately, poppler does not currently appear to handle DW.

Change-Id: I394f0f28fab194275016ce70f0ae254254c7b3d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238964
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-09-04 00:42:19 +00:00
Brian Osman
a66081d943 Move SkSL caching out of GR_TEST_UTILS, trim persistent cache options
Combines the two boolean options into a single tri-state enum. Old GLSL
option is still present (temporarily) until Chrome is switched over.

Also add a type tag for cached program binaries, so we can safely
detect cache entries of the wrong type.

Change-Id: I0ddeefa9180b27bc2c46e2e7b77e6c9cdf4a730a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238856
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-03 20:18:48 +00:00
Brian Osman
e9d9a3278f Remove GrGLProgram cache stats, remove spurious declarations/includes
Change-Id: I5f3c17fc008a5ec92803000f17d7db65af1b4cfa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238901
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-03 19:12:07 +00:00
Greg Daniel
b20d7e5412 Track all sampled textures in GrOpsTask and pass them to GrOpsRenderPass.
In Vulkan we use this list to set the layout for these surface to be
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL at GrOpsRenderPass creation
instead of at submit. This gets us closer to being able to run with
primary or secondary command buffers.

Change-Id: I6e307485987e2c024ed9ecba3e41f588047c5f07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238444
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-09-03 18:22:32 +00:00
Ben Wagner
e91f2235bb [pdf] Only compute needed advances.
The previous code computed all advances in the font up front, not just
the ones in the subset. This can take a long time. Instead, only compute
the advances in the subset.

This replaces the previous state machine with slightly easier to
understand look ahead. There is never a need to look ahead more than two
positions, so this isn't too bad.

This also calculates the most common advance width in the subset and
uses it as the default (the default was previously always zero). Other
than ommiting the defaults, this code should produce the equivalent
output to the previous code.

On my local Windows 10 box this reduces Chromium's
IsolateOriginsPrintBrowserTest.PrintIsolatedSubframe test runtime
(standalone) from 20 seconds to 15.

Bug: chromium:996185
Change-Id: I40d8b27ab1344d546de3958b3198b675bda81b76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238596
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-09-03 18:08:02 +00:00
Brian Salomon
7a7ddc447f Add parens to assert
TBR= robertphillips@google.com

Change-Id: Id0d7cee8a9b5f28e28e073928b29055b2efaae1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238858
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-03 16:00:16 +00:00
Greg Daniel
4fe92577c5 Comment out assert in onClear in GrVkOpsRenderPass.
Change-Id: I65d8bf85749ee543e392d406cb2c976199e3856c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238857
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-03 15:44:36 +00:00
Florin Malita
a3d88db57f [svgcanvas] Skip redundant clip-rule attributes
- when nonzero (default)
 - when applied to <rect> (no effect)

TBR=
Bug: skia:9344
Change-Id: I1162c4a9c93177fc5c1eadde8901eb888d16bfc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236342
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Florin Malita <fmalita@chromium.org>
2019-09-03 15:31:16 +00:00
Robert Phillips
cf39f375d1 Remove maxCount resource cache limit
Change-Id: I0f1064c8433d69e24ca3d5b970c99d539dc1dadd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238442
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-03 14:59:51 +00:00
Brian Salomon
beb7f525c8 Make GrSurfaceProxy constructors take arg that determines participation in
GrResourceAllocator.

Removes LazyInstantiationType. All callbacks can be invoked one time (if successful).
Lazy callbacks indicate whether their lifetime should be extended, which is used by
promise image proxy callbacks.

Promise image proxies are no longer deinstantiated at the end of flush and
GrDeinstantiateProxyTracker is removed. They will be instantiated the first time
they are encountered in GrResourceAllocator::addInterval (without actually adding
an interval) and then remain instantiated.

Also removes some "helper" versions of proxy factory functions that took fewer
params. They weren't much used outside of test code and as the total number of params
has grown their relative utility has diminished. We could consider a params struct
or radically simpler helpers that take only a few params if desired.

Change-Id: Ic6b09e7b807b66cb9fcbb7a67ae0f9faf345485f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-09-03 14:58:41 +00:00
Khushal Sagar
94c6647556 Revert "Only send the RemoteStrikes that have pending glyphs."
This reverts commit 3783375c4d.

Reason for revert: Glyph cache miss issues are back with this change (landed in 78.0.3898.0) : https://crash.corp.google.com/browse?q=product_name%3D%22Chrome%22+AND+expanded_custom_data.ChromeCrashProto.channel+IN+%28%22canary%22%29+AND+expanded_custom_data.ChromeCrashProto.magic_signature_1.name%3D%22%5BDump+without+crash%5D+SkScalerContextProxy%3A%3AgenerateMetrics%22

Original change's description:
> Only send the RemoteStrikes that have pending glyphs.
> 
> Count the number of strikes in fRemoteStrikesToSend that have
> glyphs to send. The strike may not have glyphs to send, because they
> were sent previously. Then, send the strikes that have glyphs to send.
> Keep the bool in the serialization which indicates that strike
> has glyphs and should always be true now. The bool will be removed in the next CL.
> 
> Change-Id: I8b75d1bda574fd71adfd21cb20ff912340fc2e33
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237815
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>

TBR=herb@google.com,khushalsagar@chromium.org,khushalsagar@google.com

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

Change-Id: I910734d9db570784b73e108d7b5abedd2efc5ad7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238778
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
2019-09-03 00:55:44 +00:00
Michael Ludwig
0a1e9efa39 Don't use AA convex path renderer if direction can't be determined
Without the changes to GrShape and GrAAConvexPathRenderer, this new GM
would not draw the red circle at the center when using Ganesh. Raster
drew the red circle. The difference came about because they checked
convexity after transforming by the view matrix, and Ganesh checked
before.

With this particular path construction and the very large scale factor
on the CTM, the convexity calculator in local space computed small
enough edge vectors that it thought the contour backtracked on itself
instead of winding in a consistent direction.

The GrAAConvexPathRenderer would claim it could draw the convex path,
but later when actually preparing to draw, it would do nothing if it
turned out the convex path didn't have a direction. This CL updates it
so that the convex path renderer's canDraw() function matches what it
is actually able to draw.

There is the separate issue of the convexity/direction checking
precision.

Bug: chromium:996140
Change-Id: I6f2af2d9ba6752663d97c8573deb2d767a3f1245
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238121
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-02 01:57:03 +00:00
Andy Weiss
8ef18d359b Override operator delete for GrCCPathCache::Key
GrCCPathCache::Key allocates extra space for a buffer in Make but using sized
delete will then lead to UB as operator delete is not implemented.

This change overrides the delete operator to force the unsized variant
which gets rid of the UB at the cost of not taking advantage of sized
delete. Once P0722R1 is available to safely compute the full size of
the object inside delete, this code can change to use sized delete.

c.f. https://bugs.chromium.org/p/skia/issues/detail?id=6384
and http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0722r1.html

Change-Id: Id92edc71374be6880aa362e625bb9a5d20e07ac0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238116
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-30 20:08:21 +00:00
Greg Daniel
15ecdf94fd Just skip uninstantiated GrOps instead of delete them on flush.
Change-Id: I4e1755872979b635ad993cfba6b17d7b79ee2c54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238179
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-30 20:01:41 +00:00
Chris Dalton
4ece96d76d Reland "Initiate MSAA resolves during DAG generation"
This is a reland of 804f6a0fe7

Original change's description:
> Initiate MSAA resolves during DAG generation
> 
> Adds an "fIsMSAADirty" flag to GrRenderTargetProxy and switches to
> resolving MSAA in GrTextureResolveRenderTask. This completes our push
> to resolve textures outside of render passes.
> 
> For the time being, we only store a dirty flag on the proxy and still
> rely on the GrRenderTarget itself to track the actual dirty rect. This
> will be followed by a CL that moves the dirty rect out of
> GrRenderTarget and into the proxy.
> 
> Bug: skia:
> Change-Id: I21219a58028bdb4590940210e565133093cd34b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235672
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: skia:
Change-Id: I805b3af1404eb7919ae937cff3dfa97921e32c69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237482
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-30 17:54:10 +00:00