Commit Graph

53454 Commits

Author SHA1 Message Date
John Stiles
1cda194366 Remove deprecated form of SkRuntimeEffect::Make.
Chromium has migrated to the new API at https://crrev.com/c/2675855.

Change-Id: Id4af77db2c462348e8031d28f56e543ad619c19c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367060
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-02-09 21:27:34 +00:00
Brian Osman
62b039b36d Add .stage output to skslc for runtime effects
This emits SkSL that is more-or-less what the compiler re-ingests when a
runtime effect is used to create a GrFragmentProcessor.

Change-Id: I0926be44fc4493e722a5edc18198e161e4192cde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367883
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-09 20:11:56 +00:00
Brian Osman
cb208d4c1f Stop exposing non-square matrices to runtime effects
The SkSL names of these types were inaccessible (in the private symbol
table), but we had inadvertently made them usable via the GLSL aliases.

Bug: skia:10680
Change-Id: I2e22db39c623c872dca837a22ff6f99cf5db46b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368251
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-09 19:57:06 +00:00
John Stiles
34c098d7f8 Add SkSL test demonstrating missed optimization with +=.
Currently, SkSL is able to constant-propagate `x = x + constant` into
`x = constant` when the starting value of x is known. However, it is not
able to do the same optimization for `x += constant`. This test
demonstrates that once += is encountered, we lose track of x's value and
can no longer propagate its value.

(This is equally true of all the op-assignment operators, += -=
*= /= etc.)

Change-Id: I3523e96baf9a73982cf3b09f0d23b95adacf106b
Bug: skia:11192
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368248
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-02-09 19:17:26 +00:00
Ben Wagner
f5cbbc6c15 SkScalerContext to handle hairline paths.
Create an actual hairline path instead of a filled path. Allow metric
and image generation for glyphs to handle hairlines in the event a color
glyph has an outline and a hairline is needed. This also fixes glyph
bounds issues with path based glyphs drawn with hairlines.

Stroke+Fill is not handled very well, but is currently being deprecated
and so given less weight. It works, but is somewhat arbitrary.

Also add more paint overrides to Viewer.

Note that this only adds hairline handling for backup purposes. The code
in SkStrikeSpec::ShouldDrawAsPath which causes most harline glyphs to be
drawn directly from paths is not changed.

Change-Id: Icfadcd818d20b2557e4703c8e99d6d7dd0b4af70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368156
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-02-09 18:43:15 +00:00
Adlai Holler
863497b7fe Revert "SW mask gen: release scratch bitmap after upload"
This reverts commit 49e5b3a339.

Reason for revert: Going back to deferred proxies

Original change's description:
> SW mask gen: release scratch bitmap after upload
>
> This fixes a regression introduced in 366716, where we
> were retaining the scratch bitmap. Before that change we were
> destroying it after upload which is what we should do.
>
> Bug: skia:11288
> Change-Id: Ib567be037a2ff7595cd305a2ef3502d336795c46
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367880
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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

Change-Id: I454622563ad899691fa55cd99853261e2ce66086
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11288
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368253
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-02-09 17:42:16 +00:00
Adlai Holler
7f7a5dfbb8 Revert "Remove unused ActualUse param from GrResourceAllocator"
This reverts commit b80fb0879b.

Reason for revert: Going back to deferred proxies

Original change's description:
> Remove unused ActualUse param from GrResourceAllocator
>
> This was here for deferred proxies, which are gone now.
>
> Bug: skia:11288
> Change-Id: Idc8a3aef7c3cce62d9397338a0c77d41435527a9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367881
> Commit-Queue: Adlai Holler <adlai@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Auto-Submit: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I67c3fa9dd7bb886c956f7ccaf2cc928bfc269604
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11288
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368252
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-02-09 17:41:26 +00:00
John Stiles
47c0a74911 Replace clear_write/clone_with_ref_kind with Analysis::UpdateRefKind.
It turns out that walking an expression to update the refKind of its
embedded VariableReference is so useful that we had implemented it
twice. I will need to do it a third time in a followup CL.

Change-Id: Idd2794ea50f8c71725bb998ac8a625b36d076746
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368118
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-02-09 17:14:24 +00:00
Chris Dalton
ff4a53300e Calculate join tessellation values in the vertex shader
Each patch has one join and one set of stroke parameters, so the
vertex shader is the correct place to do it. This is also an important
cleanup that will allow us to create "dynamic" stroking parameters and
batch together strokes with different join types or stroke widths.

Bug: chromium:1172543
Bug: skia:10419
Change-Id: Icef0c20858fba6c18685006550dc75246710cd35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368043
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-02-09 16:54:01 +00:00
Brian Osman
030903a180 Ignore most modifiers in PipelineStageCodeGenerator
We ought to reject all of these in the parser, but even if they slip
through, we don't want to be emitting them for the backend. This leaves
'const' until we decide how to resolve the difference in semantics
between SkSL and GLSL.

Bug: skia:11301, skia:10837
Change-Id: I62730f6f971be04bcc3d367ceb7f211436b197c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368256
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-09 16:45:19 +00:00
Greg Daniel
af1d193d46 Remove old GrVkBuffer class and rename Buffer2 to Buffer.
Bug: skia:11226
Change-Id: I5f507a0d3ffe0a2698b10b0535486986c2a8b5b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367977
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-02-09 14:23:32 +00:00
John Stiles
38d92ef668 Only track compile-time expressions in definition maps.
This avoids an error case where the definition map points to an
expression that is later eliminated, leaving the definition map holding
a dangling pointer.

In practice we only use values from the definition map if they are
compile-time constants, so this generates the same code during
optimization.

Change-Id: I314ce8e1f9b4e0c90fbfe7c97e2a3950b65a5819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368059
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-02-09 14:23:31 +00:00
Mike Klein
11a1bb1cf6 make luma color filter runtime-only
See previous patchsets for what we can delete after lifting this guard.

Change-Id: Ia87a9b77e53bb79279f1305d6411b0a7fe5dbb9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367016
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-02-09 13:14:41 +00:00
Greg Daniel
4a0bc2b344 Revert "Only store resources in the GrResourceCache::fScratchMap that are available to be scratch."
This reverts commit 1a2326363a.

Reason for revert: breaking win10 quadro400 perf bot on vk and vkmsaa

Original change's description:
> Only store resources in the GrResourceCache::fScratchMap that are available to be scratch.
>
> Currently when we create a scratch resource, we immediately add it to
> scratch map and it will stay there until we delete the resource. The one
> exception to this is adding a unique key will remove a resource from
> the scratch map. This means there are resources in the scratch map that
> can't be returned when looking for a scratch because they are either
> already in use by something else or their budget was changed to
> unbudgeted. This means everything time we do a scratch lookup, even
> after finding the list of resources that match a key, we still have to
> iterate that list to see if we can use that resource or not.
>
> The problem comes when we may have lots of resources that all match the
> same key (think 1000s of identical buffers). Then the cost of iterating
> this list starts to get very high.
>
> This change makes it so only resources that can actively be used as a
> scratch at that moment are stored in the scratch map. Thus when we find
> a scratch resource we pull it out of the scratch map. When that resources
> refs go back to zero it is added back to the scratch map. Similar removal
> is also now used for changing a resource to and from budgeted.
>
> Change-Id: I52b415d0e035dfc589f3d712be85799a56827bf0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367976
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I1e57e10e75f930adfecb0e4167c1d6269798c893
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368236
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-02-09 13:03:02 +00:00
Jim Van Verth
205e99a161 Add push constant support
Change-Id: I2a09249cefc2f1aab123afa1a07d4ae494284e05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324632
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-02-09 12:49:11 +00:00
skia-autoroll
1ae440a3cb Roll Chromium from 3842e9ea8162 to 983950b467bc (508 revisions)
3842e9ea81..983950b467

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-skia-autoroll
Please CC borenet@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: borenet@google.com
Change-Id: I9ec3aff9ef64eb254dfb4a265499414c89a0d0c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368180
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-02-09 07:05:54 +00:00
skia-autoroll
1572ca4d7f Roll Dawn from 2831f0584028 to e7e42ebbed90 (3 revisions)
https://dawn.googlesource.com/dawn.git/+log/2831f0584028..e7e42ebbed90

2021-02-08 senorblanco@chromium.org Only default ANGLE to swiftshader if envvar empty.
2021-02-08 bajones@chromium.org Add ability to generate typedefs from dawn.json
2021-02-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from a2fa690cda46 to 4a7981e300f3 (1 revision)

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from a2fa690cda46 to 4a7981e300f3

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dawn-skia-autoroll
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: kainino@google.com
Change-Id: Ieff5f1972af53a68f35f78367d43b2789e7c3d41
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368153
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-02-09 05:55:51 +00:00
skia-autoroll
a0d09b3a0a Roll SwiftShader from 266614a36dbd to 9d35d544ce96 (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/266614a36dbd..9d35d544ce96

2021-02-08 amaiorano@google.com Make vk-unittests use VulkanWrapper

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-skia-autoroll
Please CC borenet@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: borenet@google.com
Change-Id: If71c56accab2b60c0d8c341250de24fe7826bfbe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368151
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-02-09 05:36:00 +00:00
skia-autoroll
9b4986a7b0 Roll ANGLE from 6b20e1c88488 to 4968f6f2b109 (6 revisions)
6b20e1c884..4968f6f2b1

2021-02-08 jonahr@google.com Move getRendererDescription from ContextImpl to DisplayImpl
2021-02-08 jonahr@google.com GL: Consolidate glGetString calls
2021-02-08 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 38d88d12b2fd to d6c9a9f3f705 (29 revisions)
2021-02-08 jmadill@chromium.org infra: Remove ssd:0 from builderless config.
2021-02-08 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from ff010f9f0131 to 266614a36dbd (2 revisions)
2021-02-08 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 19ae187233a0 to 82fe35376dee (607 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC borenet@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Tbr: borenet@google.com
Change-Id: Id84947300cb7fb492cfd537acca0c050a2e3803e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368150
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-02-09 05:26:29 +00:00
Ben Wagner
e573626c33 Allow filtering RSXForm text in viewer.
Prior to this change Viewer would crash in debug or act quite strangely
in release when attempting to filter any RSXForm blobs. This adds the
ability to allocate an RSXForm run and directly query the number of
positioning scalers per glyph it contains.

Change-Id: I90e118102a0f4d535e97026eecad9ac2f70e448f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367957
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-02-09 02:57:57 +00:00
Mike Klein
3d955979bb remove SkRP TODOs
I don't intend to improve SkRP beyond fixing bugs.

SK_DISABLE_LOWP_BILERP_CLAMP_CLAMP_STAGE guards the largest chunk here;
I never got that flag to flip in Chromium.

Change-Id: Ic71e9d058ae3dae75bd5006dc76faba7de1df300
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368039
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-02-09 02:44:14 +00:00
John Stiles
e8a2492b68 Migrate DefinitionMap logic to its own class.
This doesn't change any functionality. It just compartmentalizes a large
chunk of logic that was previously intertwined in the Compiler class.
This logic stands alone and doesn't need anything from the Compiler at
all except the generic "Defined" expression from the Context.

In followup CLs I intend to experiment with changes to the API and
logic, but factoring the code out seemed like a big enough change that
it deserved its own CL.

Change-Id: I3e1a7c62812c6f284167c967086ef4dd828a0b2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367879
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-02-09 02:27:26 +00:00
Florin Malita
21b8cec137 ResourceProviderProxyBase should forward loadAudioAsset()
ResourceProviderProxyBase is supposed to forward all virtuals to fProxy,
but it currently drops loadAudioAsset().

TBR=
Change-Id: I8c690802cd3ba6078232e210b032aa67499d7ba8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368116
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2021-02-09 01:24:04 +00:00
Chris Dalton
a43d58393a Convert stroke tessellation to using GrVertexWriter
Bug: chromium:1172543
Bug: skia:10419
Change-Id: Ie2d05b0d37e03e8cd3eb69c67da89c02ffa49ddb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367576
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-02-08 23:16:34 +00:00
Weston Tracey
3dd203d7bd [fuzzing] Paint SkParagraph.
Bug: skia:10894
Change-Id: I5663f126467a7ff9027955de4eee0fcc7967d94a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367878
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Weston Tracey <westont@google.com>
2021-02-08 22:42:53 +00:00
Florin Malita
dfa269f1cd [skottie] Implement skew & skew axis support
Also add a SkMatrix::Skew() helper.

Change-Id: I3d385ddda107e54db2d5078e51da4e799defd8ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368016
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-02-08 22:24:38 +00:00
Brian Osman
690b6f3a92 Remove PipelineStageArgs and format-string handshake
There is now PipelineStage::ConvertProgram, which takes a collection of
callbacks, and processes an entire program. For program objects that may
need name mangling, the callbacks return the new name, which is recorded
and used for future references to that object (eg uniforms & functions).

The callbacks let the FP inject new elements programmatically:
  - Declare uniforms and get handles
  - Emit child functions
  - Invoke child processors for calls to sample()

In a follow-up CL, we can add an skslc `.rte -> .sksl` mode, where the
callbacks just emit the description() of the relevant element. We can
also follow the same pattern to emit declarations of types (structs,
enums), and global variables.

Change-Id: I81df68a2f41bcb48f866d37af3b77ad43e880236
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367058
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-08 22:04:05 +00:00
Robert Phillips
78c30176c6 Check for a finite result in GrAAConvexTessellator's intersect helper
Bug: 1175355
Change-Id: I51a45fbd4951b187bb16621354e156b7491c4a83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367876
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-02-08 21:59:38 +00:00
Adlai Holler
b80fb0879b Remove unused ActualUse param from GrResourceAllocator
This was here for deferred proxies, which are gone now.

Bug: skia:11288
Change-Id: Idc8a3aef7c3cce62d9397338a0c77d41435527a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367881
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-02-08 21:59:00 +00:00
John Stiles
ecd7c2278f Migrate the last SkSL tests in shared/ to dm.
The leftover tests in shared/ are not easily testable as Runtime
Effects; they do things that ES2 doesn't support or use a feature not
exposed directly by Runtime Effects.

Change-Id: I7ebe170cf713c4a0d2dbef333c1fcbac2410c67f
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367059
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-02-08 21:37:48 +00:00
Greg Daniel
5af72c1abe Move mesh buffers over to new vulkan buffer class.
Bug: skia:11226
Change-Id: I7939233559e673b10c9e471137d44282b9612f8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366317
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-02-08 21:08:28 +00:00
Tyler Denniston
627c6d2569 [svg] Refactor <pattern> and gradient stop elements to new parsing
Change-Id: I1fb84760f7a657aefeb7e0af3758766daac2d0f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367882
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-02-08 20:27:17 +00:00
Tyler Denniston
c683482e58 [svg] Refactor <polygon> and <polyline> to use new parsing
Change-Id: I7cc2dcce4a645326dcacadd28cbe1b3ea5f4ae36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367877
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-02-08 20:27:17 +00:00
Tyler Denniston
52d9475b05 [svg] Refactor several simple nodes to new parsing code
Refactored nodes are <circle>, <ellipse>, <rect>, <line>.

Change-Id: I955c6a01d6533e61a0c12f56f97040ae0b5ed879
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366721
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-02-08 20:27:17 +00:00
Greg Daniel
1a2326363a Only store resources in the GrResourceCache::fScratchMap that are available to be scratch.
Currently when we create a scratch resource, we immediately add it to
scratch map and it will stay there until we delete the resource. The one
exception to this is adding a unique key will remove a resource from
the scratch map. This means there are resources in the scratch map that
can't be returned when looking for a scratch because they are either
already in use by something else or their budget was changed to
unbudgeted. This means everything time we do a scratch lookup, even
after finding the list of resources that match a key, we still have to
iterate that list to see if we can use that resource or not.

The problem comes when we may have lots of resources that all match the
same key (think 1000s of identical buffers). Then the cost of iterating
this list starts to get very high.

This change makes it so only resources that can actively be used as a
scratch at that moment are stored in the scratch map. Thus when we find
a scratch resource we pull it out of the scratch map. When that resources
refs go back to zero it is added back to the scratch map. Similar removal
is also now used for changing a resource to and from budgeted.

Change-Id: I52b415d0e035dfc589f3d712be85799a56827bf0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367976
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-02-08 20:16:44 +00:00
Adlai Holler
49e5b3a339 SW mask gen: release scratch bitmap after upload
This fixes a regression introduced in 366716, where we
were retaining the scratch bitmap. Before that change we were
destroying it after upload which is what we should do.

Bug: skia:11288
Change-Id: Ib567be037a2ff7595cd305a2ef3502d336795c46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367880
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-02-08 19:22:52 +00:00
Chris Dalton
a6a3d05ffb Add a writer class for indirect draw commands
This enforces write-only access to the mapped buffers, will enable
chaining of indirect strokes, and gives us the ability to reorder the
fields for Metal.

Bug: chromium:1172543
Bug: skia:11291
Bug: skia:10419
Change-Id: I4449ff85dd0019f6d6d6781ede52bcf26dee8b02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367416
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-02-08 19:13:42 +00:00
Mike Klein
fc017c7c7e simplify skvm tests using allow_jit
We can of course use allow_jit to test with and without JIT!

This testing was the only reason Program::dropJIT() was public.  Given
how tricky its implementation is, I'd rather keep it a private detail
than exposed API, in case one day we find need to make it impossible.

Change-Id: Ifa256355309d9baf1bae506d75951381dce9b53c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367896
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-02-08 19:07:52 +00:00
Mike Klein
c7c1f9c148 add per-program control over JIT
We have a global flag controlling whether skvm::Programs JIT,
and this adds a per-Program flag to skvm::Builder::done().

Use it for single-color color filtering, and add a unit test.

Change-Id: I3a87761c8c6b818111d03c97b31f8b30d9f2c194
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367856
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-02-08 19:07:25 +00:00
Mike Reed
6d7357c143 Work to improve blendmode dox
Change-Id: I0ea12ad5c651aa6bd2f9b22c1ad539415d5da9bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367760
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-02-08 18:41:01 +00:00
Adlai Holler
9c3b6df1a1 Handle merging ops tasks with color clears better
This fixes the reduceOpsTaskSplitting bot.

Bug: skia:10877
Change-Id: Ief0343f5ce62121edd8f87aa57c68b74b736bd80
Docs-Preview: https://skia.org/?cl=363941
Cq-Include-Trybots: luci.skia.skia.primary:Test-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-ASAN_ReduceOpsTaskSplitting_Vulkan
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363941
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-02-08 18:34:34 +00:00
Greg Daniel
2e967df83d Reland "Switch vulkan transfer buffers to new buffer class."
This reverts commit 393debc430.

Reason for revert: reland with fixes

Original change's description:
> Revert "Switch vulkan transfer buffers to new buffer class."
>
> This reverts commit 2d4c32987a.
>
> Reason for revert: maybe breaking chrome roll?
>
> Original change's description:
> > Switch vulkan transfer buffers to new buffer class.
> >
> > Bug: skia:11226
> > Change-Id: I58fc7e02dc9ea9a06e855107aad4fbbd7b98d347
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366316
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
>
> TBR=egdaniel@google.com,jvanverth@google.com
>
> Change-Id: I7de37315a10c2cd9148003643d9543e883c17053
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11226
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367065
> 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 this is a reland.

Bug: skia:11226
Change-Id: Ib6c2e1cddc13afdf85f556074d1c475d286db398
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-02-08 18:10:34 +00:00
Chris Dalton
e6ae4761c1 Reland "Don't simplify strokes that could have been tessellated"
This is a reland of 3f95357c4c

Original change's description:
> Don't simplify strokes that could have been tessellated
>
> Bug: chromium:1172543
> Change-Id: I3be0d822ca0a338118059c7aa37b2fd7822869b8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362936
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: chromium:1172543
Change-Id: I514211c3d46e62d3bacb0beb8fc9ea6959144e4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367022
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-02-08 17:57:45 +00:00
Mike Klein
447f33105a streamline skvm errors
store() returns a success bool only because it can, because it wasn't
going to return any sort of skvm::Value anyway.  But it should never
fail given a well-formed skvm::PixelFormat, e.g. one from
SkColorType_to_PixelFormat.  So move the "error handling" inside, really
just asserting/assuming it doesn't fail.

And similarly, skvm::SkColorType_to_PixelFormat() can no longer fail, so
have it return the skvm::PixelFormat directly instead of the bool I used
to stage things back when building this out.

Change-Id: I6dc3b6da32cdaaef377fe59b8c94846e902841ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367796
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-02-08 17:49:25 +00:00
Tyler Denniston
4c0a35f9d6 Improve conic Wang's formula correctness tests
- Treat randomly generated control points as pre-projected
- Use double-precision conic evaluation for "within tolerance" test.
  This allows us to test with larger magnitude control points (the
  SkConic/SkGeometry single-precision functions lose too much accuracy).

Bug: skia:10419
Change-Id: Iba0915dccb50131e1a1b28a7d556863497f636e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367057
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2021-02-08 17:49:24 +00:00
Chris Dalton
c740d93628 Lift stroke cusp detection out of GPU shaders
Cusps are rare, and simply detecting if a curve has one or not is
cheap. This CL handles cusps on the CPU side by chopping them into two
different patches joined by a bowtie. By removing cusps on the GPU
side, we greatly reduce the amount of complexity required in the
tessellation shaders. For now we only remove the line detection in
order to fix a rendering artifact, but in the future we will be able
to significantly simplifty these shaders.

Bug: chromium:1172543
Bug: skia:10419
Change-Id: I9c27c3cf002e0cbd91d4877f0ce7ec5a9136ef2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367018
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-02-08 17:10:04 +00:00
Adlai Holler
a3987cc587 Remove deferred proxy machinery
These aren't used any more in favor of lazy proxies.

Bug: skia:11288
Change-Id: I992e1a3dd343e0ebc7f3a4f18c0054453dfebbaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366896
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-08 16:23:04 +00:00
John Stiles
a793f4f6fc Add additional cases to folding tests.
These cover new ground; when combined with some additional optimization
work, they can cause crashes in the optimizer that we don't see from any
existing test.

Change-Id: I3958a5522cfe0929d0753e6e617d72e032c7f5a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367063
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-02-08 16:17:18 +00:00
John Stiles
c2c1b0c460 Migrate some SkSL swizzle tests to dm.
Change-Id: I2bd6bf9c368359a2b21861c1b6f621040d335111
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367056
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-02-08 16:16:28 +00:00
skia-autoroll
75b7606c0f Roll Chromium from e94d2f0da382 to 3842e9ea8162 (629 revisions)
e94d2f0da3..3842e9ea81

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-skia-autoroll
Please CC borenet@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: borenet@google.com
Change-Id: Id8e79958a8f5d26798a83dfbde1caf21dbbc14e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367639
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-02-08 06:20:33 +00:00