Commit Graph

26097 Commits

Author SHA1 Message Date
Michael Ludwig
76312fbf97 Add conservative round rect intersect function
Change-Id: I1012a4b6c6eb67e01923f767baeb78ebc18a0fd5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284477
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-20 22:53:16 +00:00
Mike Klein
57ed6b8f12 remove LabelAndReg
The .reg part of this struct is unused (since removing
some of those old complex instructions).

Change-Id: I35a8344286e22d4acac4707d31eaf3794ae2fae4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284547
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 21:54:16 +00:00
Mike Reed
7d45a7ac9c rm unneeded SK_SUPPORT_LEGACY_DIDCONCAT44
Change-Id: I65cec59749f0e7f5fb13675293720afecffa6a80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284321
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-20 20:44:35 +00:00
Mike Klein
21e85eb549 Reland "Reland "gather8/16 JIT support""
This is a reland of 1283d55f35

... this time, also checking for HSW feature set.

Original change's description:
> Reland "gather8/16 JIT support"
>
> This is a reland of 54659e51bc
>
> ... now expecting not to JIT when under ASAN/MSAN.
>
> Original change's description:
> > gather8/16 JIT support
> >
> > The basic strategy is one at a time, inserting 8- or 16-bit values
> > into an Xmm register, then expanding to 32-bit in a Ymm at the end
> > using vpmovzx{b,w}d instructions.
> >
> > Somewhat annoyingly we can only pull indices from an Xmm register,
> > so we grab the first four then shift down the top before the rest.
> >
> > Added a unit test to get coverage where the indices are reused and
> > not consumed directly by the gather instruction.  It's an important
> > case, needing to find another register for accum that can't just be
> > dst(), but there's no natural coverage of that anywhere.
> >
> > Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
> > Reviewed-by: Herb Derby <herb@google.com>
> > Commit-Queue: Mike Klein <mtklein@google.com>
>
> Change-Id: I67f441615b312b47e7a3182e85e0f787286d7717
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284472
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Change-Id: Id0e53ab67f7a70fe42dccca1d9912b07ec11b54d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284504
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 20:25:06 +00:00
Mike Klein
7d5342d9ac Revert "Reland "gather8/16 JIT support""
This reverts commit 1283d55f35.

Reason for revert: one more try...

Original change's description:
> Reland "gather8/16 JIT support"
> 
> This is a reland of 54659e51bc
> 
> ... now expecting not to JIT when under ASAN/MSAN.
> 
> Original change's description:
> > gather8/16 JIT support
> >
> > The basic strategy is one at a time, inserting 8- or 16-bit values
> > into an Xmm register, then expanding to 32-bit in a Ymm at the end
> > using vpmovzx{b,w}d instructions.
> >
> > Somewhat annoyingly we can only pull indices from an Xmm register,
> > so we grab the first four then shift down the top before the rest.
> >
> > Added a unit test to get coverage where the indices are reused and
> > not consumed directly by the gather instruction.  It's an important
> > case, needing to find another register for accum that can't just be
> > dst(), but there's no natural coverage of that anywhere.
> >
> > Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
> > Reviewed-by: Herb Derby <herb@google.com>
> > Commit-Queue: Mike Klein <mtklein@google.com>
> 
> Change-Id: I67f441615b312b47e7a3182e85e0f787286d7717
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284472
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: I953fcd2aef308fd901880618fa540ac9f6d88e84
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284503
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 17:05:52 +00:00
Mike Klein
1283d55f35 Reland "gather8/16 JIT support"
This is a reland of 54659e51bc

... now expecting not to JIT when under ASAN/MSAN.

Original change's description:
> gather8/16 JIT support
>
> The basic strategy is one at a time, inserting 8- or 16-bit values
> into an Xmm register, then expanding to 32-bit in a Ymm at the end
> using vpmovzx{b,w}d instructions.
>
> Somewhat annoyingly we can only pull indices from an Xmm register,
> so we grab the first four then shift down the top before the rest.
>
> Added a unit test to get coverage where the indices are reused and
> not consumed directly by the gather instruction.  It's an important
> case, needing to find another register for accum that can't just be
> dst(), but there's no natural coverage of that anywhere.
>
> Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Change-Id: I67f441615b312b47e7a3182e85e0f787286d7717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284472
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 16:47:04 +00:00
Jim Van Verth
9b5e16c09e Add capture routines for D3D
Bug: skia:9935
Change-Id: I8149a5c04be5be44f129a7d66656182cb2f5babb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284045
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-04-20 15:31:18 +00:00
Mike Klein
86975cd168 Revert "gather8/16 JIT support"
This reverts commit 54659e51bc.

Reason for revert: ASAN

Original change's description:
> gather8/16 JIT support
> 
> The basic strategy is one at a time, inserting 8- or 16-bit values
> into an Xmm register, then expanding to 32-bit in a Ymm at the end
> using vpmovzx{b,w}d instructions.
> 
> Somewhat annoyingly we can only pull indices from an Xmm register,
> so we grab the first four then shift down the top before the rest.
> 
> Added a unit test to get coverage where the indices are reused and
> not consumed directly by the gather instruction.  It's an important
> case, needing to find another register for accum that can't just be
> dst(), but there's no natural coverage of that anywhere.
> 
> Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: I912273e6ffc9258537ba806951a5964be0218d58
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284471
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 15:27:49 +00:00
Mike Klein
54659e51bc gather8/16 JIT support
The basic strategy is one at a time, inserting 8- or 16-bit values
into an Xmm register, then expanding to 32-bit in a Ymm at the end
using vpmovzx{b,w}d instructions.

Somewhat annoyingly we can only pull indices from an Xmm register,
so we grab the first four then shift down the top before the rest.

Added a unit test to get coverage where the indices are reused and
not consumed directly by the gather instruction.  It's an important
case, needing to find another register for accum that can't just be
dst(), but there's no natural coverage of that anywhere.

Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 15:19:37 +00:00
Michael Ludwig
eaeb996253 Add inner bounds of round rect function
Change-Id: I6d48d4aebfffcf106ab22b511e43f76a4f8972c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284276
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-20 13:58:10 +00:00
Brian Osman
449b1157a7 Plumb SkMatrixProvider throughout Ganesh
Renames the provider to SkMatrixProvider, which is now also able to
provide the local-to-device matrix. Everywhere that does paint
conversion and FP generation now has access to the entire matrix
provider, instead of just the CTM.

This will allow the SkSL FP (and others) to fetch other matrix state.

Change-Id: Iffb00bae0d438da0e8de3eebe75183ed6d440fd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284040
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-20 13:48:40 +00:00
John Stiles
0ebc69c9ef Fix modulo-by-zero crash during SPIR-V conversion.
Array-stride calculation did not check for zero-sized objects before
performing a modulo. This would lead to undefined behavior (crash)
while attempting to build the AST.

Change-Id: I84b4662978955d49a3ca28f6bb577d15c87cccb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284354
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-18 13:41:40 +00:00
Jim Van Verth
c632aa6337 Flesh out more D3D command list and barrier code.
* Adds command queue sync
* Adds resource state transitioning

Bug: skia:9935
Change-Id: I891ef288fd2b3a1b24d649f0958f1eb83ddea532
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284317
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-17 21:36:08 +00:00
Michael Ludwig
2686d69bf0 Reland "Rename GrShape to GrStyledShape"
This reverts commit 73b86c1ade.

Reason for revert: wasn't the problem, relanding

Original change's description:
> Revert "Rename GrShape to GrStyledShape"
> 
> This reverts commit f3f08af010.
> 
> Reason for revert: maybe this is breaking the ios perf bot; it is the first CL that caused the bot to fail, but I can't really say why this would break them.
> 
> Original change's description:
> > Rename GrShape to GrStyledShape
> > 
> > Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Change-Id: I2e5adbfc820811fbbde9cb57af28f86a7ba40bd9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284231
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: Ifdd52f8bacb5d66a7bf58efd328675c4c443ac8a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284376
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-17 20:24:53 +00:00
Michael Ludwig
a17d2d502a Reland "Respect wrap mode when decimating for blur"
This reverts commit 57dbcd1fb2.

Reason for revert: this wasn't the problem, relanding

Original change's description:
> Revert "Respect wrap mode when decimating for blur"
> 
> This reverts commit 0dca280047.
> 
> Reason for revert: maybe this is the cause of the iOS failures.
> 
> Original change's description:
> > Respect wrap mode when decimating for blur
> > 
> > It used to be the case that bilerp wasn't supported for shader-based
> > repeats and mirrors, but that is no longer the case. If we switched
> > to ClampToBorder in those cases, we could introduce transparent black
> > into the decimated image that would then infect the final blur.
> > 
> > Bug: skia:10145
> > Change-Id: Ie273b4d64f082be3ddbdbf54acf201ff1fdfa133
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283940
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,michaelludwig@google.com
> 
> Change-Id: Id672e9ce4d5418db0d7e58fd15fa1c3b5c80e07a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10145
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284278
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I7f603b80385e29a182572576e62351f1c2ab24b2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10145
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284319
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-17 20:21:30 +00:00
Brian Salomon
b0aab2c7d1 Reland "Revert "Revert "GrDisplacementEffect uses GrTextureEffect."""
This is a reland of 16abfa5e42

Original change's description:
> Revert "Revert "GrDisplacementEffect uses GrTextureEffect.""
> 
> Also further limits the number of FP stages on ANGLE D3D9 to avoid
> varying limit.
> 
> This reverts commit 0b406736c1.
> 
> Bug: skia:10139
> 
> Change-Id: Ifda0b932ab8ce176f1a1cd1ca9c2deaf1fda20bd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284048
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:10139
Change-Id: I542506a87fadeeb54e2f749b199806d2155c6cab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284230
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-17 20:19:48 +00:00
Michael Ludwig
73b86c1ade Revert "Rename GrShape to GrStyledShape"
This reverts commit f3f08af010.

Reason for revert: maybe this is breaking the ios perf bot; it is the first CL that caused the bot to fail, but I can't really say why this would break them.

Original change's description:
> Rename GrShape to GrStyledShape
> 
> Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

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

Change-Id: I2e5adbfc820811fbbde9cb57af28f86a7ba40bd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284231
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-17 19:38:34 +00:00
Ethan Nicholas
36a3e014e1 Revert "Converted texture and runtime effects to use GrMatrixEffect"
This reverts commit 4ab84eda53.

Reason for revert: Breaking some GMs.

Original change's description:
> Converted texture and runtime effects to use GrMatrixEffect
> 
> Change-Id: I6e769d52291dd29c2d06983dae5013b6058864cb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283780
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Idb2c782ae619689744e868bf38111cc4eaf0b40a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284233
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-04-17 19:00:36 +00:00
Brian Salomon
4e7ee6e0af Put top level FPs into their own functions
Change-Id: I59916af90c30b07faed1198a745383d648c29e0e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284080
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-17 18:55:53 +00:00
Mike Klein
69080be5e9 support JITMode::Stack on ARM
Change-Id: I13fd1fef764591bc9e773aa1f29bfcace01f753b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284299
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-17 17:51:44 +00:00
Ethan Nicholas
4ab84eda53 Converted texture and runtime effects to use GrMatrixEffect
Change-Id: I6e769d52291dd29c2d06983dae5013b6058864cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283780
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-17 17:43:33 +00:00
Brian Salomon
414782d132 Disable testing of D3D9 ANGLE backend on NVIDIA
Bug: skia:10149

Change-Id: Ia9b0bf2ed2042ba75088409612f6b091c5052ea9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284220
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-17 17:28:35 +00:00
Mike Klein
b8e041e5f5 refactor arm instructions
Funnel the ARM instructions through two op() helpers, one for 3-arg
vector instructions, another for all others (0,1,2 arg, optional imm).

More consistent use of (immN & N_mask) to make things clearer.

Add missing imm12 offset to load and store instructions, with tests.
Notice they're in element counts, so we can go up to 4096 16-byte stack
entries, not 256 entries like you might think.

Change-Id: I99a3ad30b7b0926f93da671f00d89759934e65b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284255
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-17 17:12:13 +00:00
Mike Klein
48e782486f set up stack frames on aarch64
Going to be easier to work on stack/register things if we
don't have to keep thinking of aarch64 as a special case.

This just sets up the frames, will follow up with JITMode::Stack.

Change-Id: Ic0df4c5deb9c7d55eb73a62e4b6b1c9919996974
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284243
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-17 16:44:53 +00:00
Michael Ludwig
57dbcd1fb2 Revert "Respect wrap mode when decimating for blur"
This reverts commit 0dca280047.

Reason for revert: maybe this is the cause of the iOS failures.

Original change's description:
> Respect wrap mode when decimating for blur
> 
> It used to be the case that bilerp wasn't supported for shader-based
> repeats and mirrors, but that is no longer the case. If we switched
> to ClampToBorder in those cases, we could introduce transparent black
> into the decimated image that would then infect the final blur.
> 
> Bug: skia:10145
> Change-Id: Ie273b4d64f082be3ddbdbf54acf201ff1fdfa133
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283940
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Id672e9ce4d5418db0d7e58fd15fa1c3b5c80e07a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10145
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284278
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-17 16:27:34 +00:00
Stephen White
af564a5d0b Dawn: implement fences, callbacks and Finish (syncGpu) semantics.
Change-Id: I04e6c829fb122dc8b2192911bda94e5106927bff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275437
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-04-17 16:05:43 +00:00
Mike Klein
a73819bd2b test overdraw filter via public api
Change-Id: I5db5fb8c09a88162466ce5261d57258e5d20bd2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284237
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2020-04-17 15:25:42 +00:00
Brian Salomon
f49debf07d Fix two GrProcessor names that are not valid idenitfiers
Change-Id: I123caca8649097316f52f6fb0aed2e6ed0d5090a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284256
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>
2020-04-17 15:08:12 +00:00
Greg Daniel
a19abd58cb Fix spirv rtheight set.
Change-Id: I11699a09be9c7e2483f8b77117fae83f26e8e4c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284222
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-17 14:34:53 +00:00
Kevin Lubick
1bf127479c Reland "Revert "GrDisplacementEffect uses GrTextureEffect.""
This reverts commit 16abfa5e42.

Reason for revert: Appears to have made ANGLE and ios unhappy

Original change's description:
> Revert "Revert "GrDisplacementEffect uses GrTextureEffect.""
> 
> Also further limits the number of FP stages on ANGLE D3D9 to avoid
> varying limit.
> 
> This reverts commit 0b406736c1.
> 
> Bug: skia:10139
> 
> Change-Id: Ifda0b932ab8ce176f1a1cd1ca9c2deaf1fda20bd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284048
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I0e4b135a59f713342bf5c6c258779975762ccd1f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10139
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284217
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-04-17 11:51:47 +00:00
Mike Reed
9ad01787a8 remove legacy deserialization of overdrawcolorfilter
- just removing code we think isn't needed...
  we assume folks don't care about long-lived serialized overdrawfilters
  since the filter is just used in dev-tool settings
- easy to revert this if this assumption is not true

Change-Id: I77f6a4e2b38bbd49589c822c9aea19ed5eff2551
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284047
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-17 01:44:21 +00:00
Brian Salomon
16abfa5e42 Revert "Revert "GrDisplacementEffect uses GrTextureEffect.""
Also further limits the number of FP stages on ANGLE D3D9 to avoid
varying limit.

This reverts commit 0b406736c1.

Bug: skia:10139

Change-Id: Ifda0b932ab8ce176f1a1cd1ca9c2deaf1fda20bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284048
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-17 00:07:38 +00:00
Sean Gilhuly
4b06b0b9c9 Remove non-renderable formats in Dawn backend
kABGR_4444 and kBGR_565 don't have a matching wgpu::TextureFormat, so
they should return false in GrColorTypeToDawnFormat(). This was causing
a color type mismatch where GrAtlasManager was trying to use a 565
atlas.

Bug: chromium:1071428
Change-Id: Id086ab67bad012fbcbe5decb22e642c943093a8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284103
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2020-04-16 20:29:32 +00:00
Brian Osman
1c61eba304 SkM44: Remove unused determinant & redundant checks in invert
Also warn about unused returns from transpose(), which has different
semantics than the SkMatrix44 version.

Change-Id: I0cf271ee5e020a81ddd696cc269bdada937a841e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284116
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-16 20:25:41 +00:00
Mike Klein
c15c936c3e GP64 Operand conversion
Move all the non-vector instructions together,
and convert them to use Operand where possible.

In general that can be any of
   - (Operand, imm)
   - (Operand, GP64)
   - (GP64, Operand)
and that means there are two ways to encode (GP64,GP64)
instructions, so there's a disambiguator added.

Our measure of sucess is eliminating calls to rex()
except from our one helper, and so far, so good.

I haven't seen a need for Label Operands yet, and they're
only useful as (GP64, Operand) style arguments (can't
really be destinations in read-only memory) but we could
add support pretty easily if we find the need.

Tweak one test to avoid int/pointer ambiguity about 0.

Changed some of the instructions to always use a REX
prefix just to make it easier to funnel everything
through one place.  movzbl -> movzbq, etc.

Change-Id: I606f94e76e0ef8f491409f23748f5c8dcb607491
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284023
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-16 19:39:11 +00:00
Stephen White
b353c9bdd3 Reland "Refactor GL and Metal FinishCallback into a helper object."
This is a reland of b641ddbba0

Original change's description:
> Refactor GL and Metal FinishCallback into a helper object.
> 
> Change-Id: I52ede0363016459976e453ef71cafbcc6775f22e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283496
> Commit-Queue: Stephen White <senorblanco@chromium.org>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

Change-Id: Ia77c05c0358b6ccab1e8c0f0c06212786f415cb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284042
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-04-16 19:20:06 +00:00
Brian Salomon
0b406736c1 Revert "GrDisplacementEffect uses GrTextureEffect."
This reverts commit a111297aaf.

Reason for revert: breaking on D3D9 ANGLE Programs test because of
varying packing rules.

Original change's description:
> GrDisplacementEffect uses GrTextureEffect.
> 
> Bug: skia:10139
> 
> Change-Id: I105eeed9d8c9eda8f04828f5a084d6d7be0a6bbe
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283781
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I073b48b9d2dfb75f0281035add97cb172c0ee84c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10139
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284046
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-16 19:17:23 +00:00
Mike Reed
b6af407d67 change Overdraw colorfilter to be pure sksl
About same speed on CPU as pipeline-callback

Change-Id: If8769bebb3c51b5ea61fc34d76dde0cfc16b8473
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283871
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-16 19:15:01 +00:00
Brian Salomon
a111297aaf GrDisplacementEffect uses GrTextureEffect.
Bug: skia:10139

Change-Id: I105eeed9d8c9eda8f04828f5a084d6d7be0a6bbe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283781
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-16 18:19:21 +00:00
Michael Ludwig
f3f08af010 Rename GrShape to GrStyledShape
Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-16 18:05:51 +00:00
Michael Ludwig
0dca280047 Respect wrap mode when decimating for blur
It used to be the case that bilerp wasn't supported for shader-based
repeats and mirrors, but that is no longer the case. If we switched
to ClampToBorder in those cases, we could introduce transparent black
into the decimated image that would then infect the final blur.

Bug: skia:10145
Change-Id: Ie273b4d64f082be3ddbdbf54acf201ff1fdfa133
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283940
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-16 17:21:41 +00:00
Mike Klein
8390f2ead6 lots more refactoring
Rename YmmOperand to Operand, focusing on that side of things for
now.  And delete unused GP64Operand... might not need to return.

Big refactor around W and L bits and the helper op() functions.
Lots more is now funneled through a single core op() function.

Support Xmm and GP64 (direct moves) as Operands too.

As a rule of thumb I measured my progress by counting vex() calls.
Ideally we call it only in that centralized op().

I think I got as close as we can get, with only vgatherdps calling vex()
itself.  Given its weird encoding, there's no good way to work
vgatherdps into the abstraction.  It's close to Mem{base,0,index,scale},
but the index is a Ymm register, and there isn't any corresponding
special cases for it like there is normally for rsp in SIB.

Change-Id: I48e4583293e1df386a18d37ad54197016ce13251
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283806
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-04-16 16:55:32 +00:00
Greg Daniel
49f920e2aa Remove use of GrVkCaps from SkSLProgram settings.
Other backends want to compile into spirv but don't have a GrVkCaps. So
this removes the need and just passes in the little bit of info that
was gotten off the caps.

Change-Id: I7496ee1b8a09d51339204543d807ea8d75a5f8e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283938
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-16 15:38:39 +00:00
Brian Salomon
f3178a5a60 Remove redundant before/after child proc mangling calls.
writeProcessorFunction() is already making these calls, no need
for GrGLSLFragmentProcessor to also make them. Makes the names
of child proc functions slightly easier to parse for humans.

Also makes them and one other function private to
GrGLSLFPFragmentProcessor.

Devirtualizes fucntion writeProcessorFunction (no overloads)

Change-Id: I47b416c7aa29f6dd2739151a586dcd4c887f997f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283944
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-16 15:34:50 +00:00
Brian Salomon
d903fcf40b GrLightingEffect uses GrTextureEffect
Bug: skia:10139

Change-Id: I30897840c8d9ed3eae7dcf1214cef61ada11ab3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283784
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-16 14:47:00 +00:00
Mike Reed
938b4532b4 Revert "transition matrix44 to opt-in only"
This reverts commit 0f1f87d7bd.

Reason for revert: google3 and flutter also need the guard

Original change's description:
> transition matrix44 to opt-in only
> 
> In service of https://chromium-review.googlesource.com/c/chromium/src/+/2067862/
> 
> Change-Id: Ib6fd24c16c295fb4211dc295268af1e6f7f3fc45
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283661
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I7c8cf2bc67aa267d442d0ca663e8378aa8feb409
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283896
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-16 10:01:29 +00:00
Brian Salomon
694ec49ed0 GrMatrixConvolutionEffect uses GrTextureEffect
Bug: skia:10139

Change-Id: Ib91bb3b30ba080da389a6b3c6907656f57ae44fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283497
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-15 23:12:47 +00:00
Mike Klein
edc2dacb3a convert load_store / stack_load_store to new style
This replaces most vmovups variants with two: load to register from
flexible operand, or store from register to flexible operand.

And upgrade the zero-extending loads too to finish off load_store().

More to come in small steps.

Change-Id: I80645f264ee91662260046c8e0a45ba6d1bf98c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283753
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-15 22:54:46 +00:00
Michael Ludwig
b15cc56858 Revert "Refactor GL and Metal FinishCallback into a helper object."
This reverts commit b641ddbba0.

Reason for revert: likely breaking command buffer bots

Original change's description:
> Refactor GL and Metal FinishCallback into a helper object.
> 
> Change-Id: I52ede0363016459976e453ef71cafbcc6775f22e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283496
> Commit-Queue: Stephen White <senorblanco@chromium.org>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,senorblanco@chromium.org

Change-Id: Ifc766e065b6a19cb263c4a3d94f4bbe88c4bce16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283782
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-15 21:54:58 +00:00
Michael Ludwig
9e1e913c81 Add rect subtraction utility function+tests
This operation came when updating aggregate inner and outer bounds
for Ganesh' new clip stack (particularly when accounting for the effect
of a difference operation). This geometric operation is theoretically
more general purpose so I moved it out to SkRectPriv.

Change-Id: Ibd76f9b95efc1790ecda1038779c124155031d8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283756
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-15 21:44:36 +00:00