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