Commit Graph

52154 Commits

Author SHA1 Message Date
Ben Wagner
416fe32ce1 Ensure variable font from data created at default.
If font data is used to create an SkTypeface and the font data describes
a variable font and no variation parameters are specified, the
SkTypeface created should have the default values for all axes. This is
particularaly interesting with DirectWrite since it makes this not
straight forward.

Bug: skia:10929
Cq-Include-Trybots: luci.skia.skia.primary:Test-Win10-Clang-NUC5i7RYH-CPU-AVX2-x86_64-Debug-All-NativeFonts
Change-Id: I4620deebf52142bbdffa1a283343b503cd1e6981
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338604
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-12-01 00:30:22 +00:00
Tyler Denniston
4c6f57a23e [svg] Use new code path for rest of presentation attrs
This is another necessary step in order to remove kInherit from all of
the base SVG type enums.

Change-Id: I2185e744f7b27369f7bad36591f896d3a9982b42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335817
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-11-30 21:27:04 +00:00
Brian Salomon
70fe17e12f Remove GrRenderTargetContextPriv and GrSurfaceContextPriv
I think this is vestigial from some time in the past where RTC was
public.

Also just expose the methods that add ops rather than have so many
friends + testingOnly versions.

Change-Id: I60d9fdff23b2d67039a7b37815da7ff9e73d8999
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339158
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-30 20:13:25 +00:00
Mike Reed
6affa2c2e3 move SkMipmapBuilder to private
Change-Id: I77f57b175984a5e373fae951a270a883e7e4c5d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339216
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-30 20:13:15 +00:00
John Stiles
5b589fd273 Add test for returning arrays from functions.
Just filling in a gap in our tests. The output is a little strange as it
exposes a missed opportunity to constant-fold array accesses, but it
seems fine otherwise.

Change-Id: I6df13e0f9a49455015ceb47d7802bb5e1bbdaa1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339217
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-30 19:38:05 +00:00
John Stiles
d7cc093f1f Fix ASAN error when inlining array constructor expressions.
Constructors such as `float[2](0, 0)` add a type to the symbol table;
this type needs to be copied into the new symbol table if the
constructor is cloned by the inliner.

Change-Id: Ifa8d2dec87103c6223ce493e2201a904c14c2137
Bug: oss-fuzz:28050
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339168
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-30 18:37:05 +00:00
John Stiles
74ff1d668f Fix ASAN error when inlining multi-dimensional arrays.
We had special-case logic for copying array types from one symbol table
to another while inlining, but it only considered single-dimensional
array types. Each added dimension in an array has its own type, and
each type needs to be copied.

This bug could be triggered by compiling shared/Functions.sksl with
ASAN enabled.

Change-Id: Ib99d1e3f44b5530c271a97f374ee1d6d5ecf295c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339167
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-30 18:18:45 +00:00
Robert Phillips
c4fbc8d6cf Stop overflow of windows rects in GrClipStack
Bug: skia:10989
Change-Id: I512ccbd3d95178756ae436f7c67ed53d46105ae7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339165
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-30 18:12:24 +00:00
John Stiles
fd41d878b1 Fix SPIR-V and Metal support for enum types.
SPIR-V previously didn't know what to think when it encountered a Type
with a typeKind of kEnum, and would abort. These are now treated as
32-bit signed integers.

Metal previously emitted the SkSL enum typename, which is meaningless to
Metal since we do not emit the enum itself anywhere. Metal now emits
"int" for an enum-typed variable.

(GLSL already correctly emits "int" for enum types.)

Change-Id: I05975a2a399f9c4a22c00c90be0dccacd99d793b
Bug: skia:11003
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338856
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-11-30 18:05:48 +00:00
John Stiles
21f5f450a4 Fix SPIR-V compilation error with arrays of samplers.
This CL addresses the root cause of the fuzzer issue, by checking for
LayoutIsSupported before getting the MemoryLayout of a type. However,
this array ought to be detected as an error everywhere, as samplers are
opaque types; at present, this code compiles without error in GLSL and
Metal. This is an issue for followup CLs.

GLSL's actual support for arrays of samplers is interesting and probably
too nuanced for us to try to emulate:

https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Opaque_arrays

"Under GLSL version 3.30, Sampler arrays (the only opaque type 3.30
provides) can be declared, but they can only be accessed by compile-time
integral Constant Expressions. So you cannot loop over an array of
samplers, no matter what the array initializer, offset and comparison
expressions are.

Under GLSL 4.00 and above, array indices leading to an opaque value can
be accessed by non-compile-time constants, but these index values must
be dynamically uniform. The value of those indices must be the same
value, in the same execution order, regardless of any non-uniform
parameter values, for all shader invocations in the invocation group."

Change-Id: Ib382f5c3b563f996b3c8f1eb6b021b6d31fa9ce7
Bug: oss-fuzz:28107
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339159
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-30 17:28:14 +00:00
John Stiles
dc75a97b80 Add global struct definitions to SkSL.
Previously, GLSL and Metal code generators would emit a struct wherever
the type was first used in the code, regardless of where it was
originally defined or what scope the type needs to live in. This CL adds
a ProgramElement for struct definitions, so that structs will now appear
at the top-level as they were originally defined. In the case of Metal,
some special handling is also needed to handle the Globals struct
properly.

Not yet fully supported:
- No special handling for structs declared inside functions yet
- No support for structs in separate scopes with overlapping names
The severity of the remaining issues depends mostly on whether we want
to support structs inside functions in Runtime Effects.

Change-Id: Ia95d4529506cb3fa6da63f5cb548199a93e1c0c5
Bug: skia:10922, skia:10923, skia:10925, skia:10926
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338600
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-30 15:26:14 +00:00
John Stiles
ade695ea4a Add unit test for function dead-stripping.
This test verifies that dead-stripping works on both built-in and user
functions, if their function call is optimized away.

Change-Id: I3125a34640c69de43c383343cd00d97e5a32ac60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338836
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-30 15:16:44 +00:00
John Stiles
712fd6bbb9 Add support for enums in Metal code generator.
Enums are an SkSL-only concept--when we output code, we emit plain
IntLiterals--so the fix is simply to ignore the Enum program element
when we encounter it. This is what GLSLCodeGen does as well.

Also added a unit test to confirm that enums work normally, and that
enums are subject to optimization and static-comparison checks just as
ints would be.

Change-Id: Ic4f8da7a27983add9eb41b936d46f6638d22bd4b
Bug: skia:11003
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338800
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-30 15:14:34 +00:00
John Stiles
ba067aa72b Migrate dedicated SPIR-V tests to golden outputs.
There were a surprisingly small number of dedicated SPIR-V tests.
SkSLSPIRVBadOffset was the only test that didn't already exist in the
golden outputs, although it actually contained two tests.

The SPIRVTest.cpp file has been converted to SPIRVTestbed.cpp, which can
be used for local debugging of SPIR-V issues via dm (like GLSLTestbed
and MetalTestbed).

Change-Id: I978d8a7cf5735af7f537113d2b9411ce42cfcf88
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338756
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-11-30 15:05:54 +00:00
John Stiles
d6449e9291 Remove ^^ operator from Metal codegen.
^^ is not an operator in Metal. != can be used for the same purpose.

Change-Id: If75b000076ebe0aa81d0ab354a8ae33e6ed52101
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339156
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-11-30 14:57:54 +00:00
Mike Reed
a35fcd6881 Don't force linear when extracting miplevel
Sorta introduced here: https://skia-review.googlesource.com/c/skia/+/338318

When we switched the controller from filter-quality to sampling, we
'continued' the old behavior of forcing bilerp when sampling a miplevel.
This matched the old enum, but the new code should respect whatever
fFilter the client has set.

Change-Id: I44bac879c1d3c880d8dbfac241e8511397de6641
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339117
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-30 14:48:03 +00:00
Robert Phillips
ca92424e21 Remove SkBaseDevice::flush (take 2)
Another small step in removing SkCanvas::flush

Change-Id: I6f3bec367e582754b8463b7bfe6a2542436ca829
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335647
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-30 14:13:03 +00:00
skia-autoroll
77b68e8599 Roll Dawn from 4814bdbdeae4 to d8bb0bb7c735 (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/4814bdbdeae4..d8bb0bb7c735

2020-11-28 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 456aad3bced0 to aa212ee81f71 (6 revisions)
2020-11-27 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 4e91325bf0c4 to 456aad3bced0 (16 revisions)
2020-11-27 cwallez@chromium.org Roll spirv-headers right before the ray tracing breakage.
2020-11-27 cwallez@chromium.org Roll vulkan-headers right before the ray tracing breakage.

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 enga@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: enga@google.com
Change-Id: Ief83ac18d0b2952098975ed8dde8a8f6decb8975
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339080
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-30 05:15:52 +00:00
skia-autoroll
9e8f092e89 Roll ANGLE from fcb6b5a5c55e to 59aa1ef1975a (5 revisions)
fcb6b5a5c5..59aa1ef197

2020-11-27 ynovikov@chromium.org Suppress TextureSampleShadingTest.Basic on Vulkan AMD
2020-11-27 syoussefi@chromium.org Vulkan: Remove vk:: inside namespace vk
2020-11-27 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 43bb60e1fa11 to 9dff6a3bb595 (1 revision)
2020-11-27 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from 1835944edcfa to 8756b1cb930a (1 revision)
2020-11-27 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 730f0fe9e50a to 553b5bcd72c7 (214 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 westont@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: westont@google.com
Change-Id: I6d0fdb15b1ed2f110b98a038c03638f32d17fac4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339079
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-30 04:52:12 +00:00
skia-recreate-skps
9682673286 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: I687da6ceb8b7e61b1bd5cfb24cc1a777ab2657ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339096
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-11-29 06:32:41 +00:00
skia-autoroll
3f522b2688 Roll ANGLE from 5850c748b480 to fcb6b5a5c55e (8 revisions)
5850c748b4..fcb6b5a5c5

2020-11-26 syoussefi@chromium.org Vulkan: Fix precision transformation for geometry shaders
2020-11-26 syoussefi@chromium.org Vulkan: Implement multisampled incomplete textures
2020-11-26 jmadill@chromium.org More cleanups to run_code_generation.
2020-11-26 syoussefi@chromium.org Vulkan: Experimentally enable geometry shaders
2020-11-26 aleino@nvidia.com Vulkan: Work around Nvidia depth clamping bug
2020-11-26 syoussefi@chromium.org Vulkan: Move SPIR-V generators to base transformer class
2020-11-26 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from fc78e93ce895 to 1835944edcfa (9 revisions)
2020-11-26 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 4b04564d4cb2 to 730f0fe9e50a (373 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 michaelludwig@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: michaelludwig@google.com
Change-Id: I098ba4466a3aa30d55441f0ca692394082ce970a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338997
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-27 05:00:49 +00:00
skia-autoroll
32422be454 Roll SwiftShader from 43bb60e1fa11 to 9dff6a3bb595 (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/43bb60e1fa11..9dff6a3bb595

2020-11-26 rharrison@chromium.org Roll SPIRV-Headers and SPIRV-Tools

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 michaelludwig@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: michaelludwig@google.com
Change-Id: I2c5bb3ca35547c02a15982b8bd32d11175592b9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338996
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-27 04:46:09 +00:00
skia-autoroll
f7013186ac Roll Dawn from 9175f00eec91 to 4814bdbdeae4 (24 revisions)
https://dawn.googlesource.com/dawn.git/+log/9175f00eec91..4814bdbdeae4

2020-11-26 cwallez@chromium.org Port most of the samples to WGSL
2020-11-26 enga@chromium.org Update RenderPassTests to use WGSL
2020-11-26 enga@chromium.org Update RenderBundleTests to use WGSL
2020-11-26 enga@chromium.org Update IndexFormatTests to use WGSL
2020-11-26 cwallez@chromium.org Port BindGroupValidationTests to WGSL
2020-11-26 cwallez@chromium.org Port GetBindGroupLayoutValidationTests to WGSL
2020-11-26 enga@chromium.org Update DestroyTests to use WGSL
2020-11-26 enga@chromium.org Update SamplerTests to use WGSL
2020-11-26 cwallez@chromium.org Partially port StorageTextureValidationTests to WGSL
2020-11-26 cwallez@chromium.org Port RenderPipelineValidationTests to WGSL
2020-11-26 cwallez@chromium.org Port VertexBufferValidationTests to WGSL
2020-11-26 enga@chromium.org Update DeviceLostTests to use WGSL
2020-11-26 enga@chromium.org Update TextureSubresourceTests to use WGSL
2020-11-26 enga@chromium.org Update IOSurfaceWrappingTests to use WGSL
2020-11-26 enga@chromium.org Update Draw(Indexed)?(Indirect)?Tests to use WGSL
2020-11-26 cwallez@chromium.org Port ComputeIndirectValidationTests to WGSL
2020-11-26 cwallez@chromium.org Port ResourceUsageTrackingTests to WGSL
2020-11-26 enga@chromium.org Update SwapChainValidationTests to use WGSL
2020-11-26 cwallez@chromium.org Port VertexStateValidationTests to WGSL
2020-11-26 cwallez@chromium.org Port DrawIndirectValidationTests to WGSL
2020-11-26 cwallez@chromium.org Port ShaderModuleValidationTests to WGSL
2020-11-26 cwallez@chromium.org Port UnsafeAPIValidationTests to WGSL
2020-11-26 cwallez@chromium.org Port IndexBufferValidationTests to WGSL
2020-11-26 cwallez@chromium.org Port RenderBundleValidationTests to WGSL

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 enga@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: enga@google.com
Change-Id: I9a753bf58901f2fa87c90bdcaaba4d5cc6a26e18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338998
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-27 04:39:49 +00:00
Mike Reed
103078751e restore identity check
Needed to pass assumptions in cc_unittests.

Bug: skia:11004
Change-Id: Ie70ab06908c24f88a72c6a0e07033e1be4f6a7cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338936
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-27 02:56:49 +00:00
skia-autoroll
48a99420a2 Roll ANGLE from 130597e10299 to 5850c748b480 (15 revisions)
130597e102..5850c748b4

2020-11-26 syoussefi@chromium.org Vulkan: Emulated RGB copies in compute
2020-11-26 syoussefi@chromium.org Add a sample shading test to verify FS invocation per sample
2020-11-26 syoussefi@chromium.org Vulkan: Pass in emulated alpha value to ConvertVertex
2020-11-25 syoussefi@chromium.org Vulkan: Enable OES_shader_multisample_interpolation
2020-11-25 syoussefi@chromium.org Fix RedGreenGradient to not output 0 for half the image
2020-11-25 geofflang@google.com Add test coverage of sampling YUV AHBs without API 29.
2020-11-25 geofflang@google.com GL: Treat RGBA+HALF_FLOAT IOSurfaces as sized formats.
2020-11-25 jmadill@chromium.org EGL: Auto-generate Windows .def file.
2020-11-25 jmadill@chromium.org EGL: Auto-generate "libEGL" export cpp file.
2020-11-25 jmadill@chromium.org Skip Occlusion query tests on Metal.
2020-11-25 jmadill@chromium.org Fix auto-generated export file comment.
2020-11-25 jmadill@chromium.org EGL: Auto-generate entry point headers.
2020-11-25 xinghua.cao@intel.com D3D: Fix wrong visit mode
2020-11-25 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from 31f74e1a4605 to fc78e93ce895 (10 revisions)
2020-11-25 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 013c962f863f to 4b04564d4cb2 (410 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 michaelludwig@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: michaelludwig@google.com
Change-Id: I56ff5c45dd4d11e62611dbf5aee586812e4a603b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338743
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-26 04:57:48 +00:00
skia-autoroll
61a3933774 Roll Dawn from 33f29ea9b251 to 9175f00eec91 (8 revisions)
https://dawn.googlesource.com/dawn.git/+log/33f29ea9b251..9175f00eec91

2020-11-26 enga@chromium.org Update WGSL vertex_idx i32 -> u32
2020-11-25 enga@chromium.org Unify WGSL syntax to put stage decoration on same line
2020-11-25 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 12ed862c7ef2 to 4e91325bf0c4 (3 revisions)
2020-11-25 senorblanco@chromium.org Enable testing on GLES backend.
2020-11-25 cwallez@chromium.org dawn_native: Make CreateView's descriptor default to nullptr
2020-11-25 cwallez@chromium.org Improve the dynamic binding OOB error message when binding.size is defaulted.
2020-11-25 cwallez@chromium.org Remove deprecated BindGroupLayout options.
2020-11-25 cwallez@chromium.org Remove deprecated SetIndexBuffer (without format).

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 enga@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: enga@google.com
Change-Id: I5282448f61147f3f8c1d9abca68119b7ca16cb15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338744
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-26 04:39:08 +00:00
Mike Reed
604e4c2801 move local function inside build-flag
Change-Id: Ibcedd542bf607f8a14ba71db7778da9783cc1772
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338797
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-26 02:16:32 +00:00
Mike Reed
39b4c86fe9 Use sampling inside legacy bitmapprocstate
Goal is to isolate where we look at the quality enum to the fewest
number of places (e.g. single place in doStages) -- to make it clearer
how we'll be able to eliminate it going forward.

Change-Id: If60df3ac14692d0841a23665ce1baa69a55ac041
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338318
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-26 01:51:17 +00:00
Mike Klein
8d78da910e more arm64 ops
- easy: ceil, floor, sqrt
  - index is our first arm64 instruction to need a temporary,
    but other than that is pretty simple, just N - iota as usual.

With Op::index now supported, `viewer  --slide GM_runtime_shader`
frame time drops from ~1ms to ~0.24ms.

I accidentally swapped in a float-subtract for an int-subtract and
everything worked fine.  o_O

Change-Id: I44c51506a6a9014b398d6943bb0e3712e4e52445
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338661
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-25 22:49:07 +00:00
Mike Reed
420a9ba7b5 Switch to m44 for the rest of canvas virtuals
Guard flag has been added to clients

Change-Id: Ib61a48781f5dbd52279c8f4257ba3e22fb2704e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338596
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-25 21:50:37 +00:00
Mike Klein
8b16beeaf4 remove SkVM uniform8/16
Uniforms in practice are always pointers or 32-bit ints or floats, so
these are essentially dead code. The change to SkVMBlitter.cpp is the
only interesting change, and I think it makes more sense now than
before.  The program will need float coverage in the end, so might as
well feed it one directly.

Change-Id: I7f1e77731cf10ccc35595012a6df4f9e54a0dad8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338631
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-25 21:44:47 +00:00
Mike Klein
8212fa5f84 remove SkVM Q14 support
Now that I've been reminded that half-float compute is real and no
longer just a dream, Q14 kind of pales in comparison, and just gets in
my way when working on SkVM.

As usual I've left in assembler support and unit tests for those
instructions.  The instructions are all pretty easy to keep working and
tested and don't get in the way, unlike the real "let's do Q14" stuff.

None of this Q14 code was hooked up to anything but unit tests, so no
capability lost here, and no diffs.  As always, it'll be easy to restore
should we ever want to by looking at this CL.

Change-Id: Ia42a96652b381267a7c3ec563b5978efcfc717a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338630
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-25 21:08:17 +00:00
Mike Klein
b76f884220 clean up unused SkVM debug features
I'm not using any of these, so nice to move them aside.

Change-Id: Id43c1606c2f9e6bba0d8f6bd7d2f8f5e02d5b762
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338629
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-25 21:06:47 +00:00
Michael Ludwig
f2efb80bc3 Clamp really big recording bounds to safe ints
Bug: skia:10997
Change-Id: Ic6da0cbe6dd68009d888bc3174de913852559de7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338598
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-25 20:07:57 +00:00
Michael Ludwig
a2c40206c6 Preserve dithering for SkImageFilters::Shader
Migrating chromium code to use SkImageFilters::Shader over
SkPaintImageFilter requires dithering to be preserved for its gradient
fills.

I debated always forcing it to true, but dithering was never turned on
for the turbulence filter and it's not necessary for const color shaders
Given that, I opted to just make it a parameter to the filter factory,
which seems okay since we're unlikely to embed dithering into SkShader
itself, it's a shading-related parameter of SkPaint, and if we migrate
to always dithering, then we can remove it.

Bug: skia:9310
Change-Id: I86f14969e2446f3a84e71e687cb263bcd44cf9d9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338156
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-25 19:41:37 +00:00
John Stiles
dd7783f4ce Remove accidentally-commited conflict markers.
Change-Id: Ifc1f0921d983ee09d7bc2632aeca41689f1bf0c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338603
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-25 19:36:21 +00:00
John Stiles
0ad233f7e7 Add early-outs to buildCandidateList.
Conceptually these should be no-ops, but hopefully could improve
performance slightly when compiling very simple programs.

Change-Id: I87f560fa6af817e7cf39fa920d04fe62d40ca79b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338599
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-11-25 19:19:37 +00:00
Brian Osman
452369182f IWYU fix for sk_app/Window.h
Bug: skia:10991
Change-Id: Ie33a37109feba31acf675fc3a7739dcfc2c38668
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338601
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-25 19:03:37 +00:00
Michael Ludwig
51b74afb84 Reland "Move conservative bounds tracking from SkCanvas to SkNoPixelsDevice"
This reverts commit 8636e13c2d.

Reason for revert: recording canvases with really big float bounds could
produce a non-empty integer rect bounds that became empty after mapping
it to (0,0,w,h) for the device. This meant resetForNextPictures logic of
updating QR bounds directly from the input bounds allowed state to become
inconsistent with computeDevClipBounds().

PS1->PS4 shows the 1-liner to just compute bounds from the device. This
means that, for now, we preserve the behavior of setting the QR bounds to
be actually empty. skbug.com/10997 is added to fix the underlying issue
with recorders and excessively large float bounds. If that change landed
first, I'd be able to reland this w/o any modifications, but have decided
that it's better to have all locations that modify fQuickRejectBounds use
the exact same expression.

Original change's description:
> Revert "Move conservative bounds tracking from SkCanvas to SkNoPixelsDevice"
>
> This reverts commit 11a394759a.
>
> Reason for revert: assert during google3 tests.
>
> Original change's description:
> > Move conservative bounds tracking from SkCanvas to SkNoPixelsDevice
> >
> > Change-Id: I56670b4a4159e21eaa1a58a9a3ee439298d5aa8e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335863
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=mtklein@google.com,bsalomon@google.com,reed@google.com,michaelludwig@google.com
>
> Change-Id: I7c3a8797460113d9a8ef18d82bbbd64aba2f439c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338316
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: I1b33e128b4fb4e06b8c7a6ee9b9dcc67202674d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338322
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-11-25 17:29:47 +00:00
Jim Van Verth
ecc9108d87 Hide binaryArchive use in Viewer behind a flag.
Still needs more testing before we can enable this all the time.

Bug: skia:10804
Change-Id: I6d8416fa072054d2f44e337641ed5d8379e81559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337216
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-11-25 17:27:47 +00:00
Nathaniel Nifong
aa4e59eba8 update buildbot repo
Ran the following commands
from $SKIA_ROOT
go get go.skia.org/infra@e5c4a9cfc4
make -C infra/bots train

Change-Id: Id00ebbe564edfe9024e3291ff0726e92bc05965f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338217
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-11-25 17:07:32 +00:00
John Stiles
4a7dc4648a Add support for boolean ^^ operator in SPIR-V.
From the perspective of a SPIR-V opcode stream, ^^ is equivalent to !=,
so TK_LOGICALXOR can share the existing logic with TK_NEQ. (There are
differences in precedence and in supported types, but those were shaken
out at the IR-gen/compilation stages.)

Change-Id: I541a5ecfa603a07b256132fd1522f91941de6b20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338351
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-25 17:04:07 +00:00
John Stiles
318da83bdb Disallow unary minus on boolean vectors.
Previously, we allowed unary minus on numbers and vectors (of any type).
Now, we allow them on numbers and vectors of numbers.

Also updated the Boolean arithmetic error test to cover scalars as well
as vectors.

Change-Id: Ie74d1f3bfc1e9353e04c6f8e468fa20e0cbba16f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338396
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-25 17:02:27 +00:00
Mike Klein
6e5079a280 minor hash_fn() followups
- remove an odd space
  - "rounds" is fine, but "bits" is more precise
  - after fixing a typo, four parallel hashes no
    longer was any faster (or slower) than three,
    so I consider that TODO now done

Change-Id: I7fff29640c1238229418bd8385b3b3aeae4ad68f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338621
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-11-25 16:22:47 +00:00
John Stiles
56b1b80795 Detect invalid boolean binary expressions.
GLSL does not allow most binary operations on bvec types; we can now
detect these and properly flag them as errors.

Note that `determine_binary_type` was also refactored. It originally
started with an enormous omni-switch over every possible Token type,
used to set various bools describing the type of binary expression at
hand. Instead of one big switch, this has been refactored into several
small switches in standalone functions that simply switch on the op and
immediately return true or false. Conceptually this seems like more
work (checking the op multiple times), but these tiny switches actually
boil down to little branchless shift-and-mask functions, so in practice
they should be quite efficient compared to the original omni-switch.

Change-Id: I81b473d98c65da1edd136f35fc8f656261f8930d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338346
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-25 16:04:37 +00:00
Brian Osman
79719263ae Reland "Move GL's SkSL::Compiler to the GPU (like all other backends)"
This is a reland of cddfce2c24

Original change's description:
> Move GL's SkSL::Compiler to the GPU (like all other backends)
>
> This was the only backend that didn't store the compiler on the GrGpu,
> and also the only one that did lazy-instantiation. Trying to standardize
> this code a bit.
>
> Change-Id: Ibdd1bcc2dc9c3756b46a4c6f0543b5bb20fe135d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337716
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: I28cd2b20a86ca2cc34460cd494feff5b599f65bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338597
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-25 15:58:07 +00:00
Julia Lavrova
611b2a6a0d Heuristic for filtering out too big editing text cases
Bug: skia:10487

Change-Id: Ie13db40ceee6edfcc1cfb28a131ff2cfa02038fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335664
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-25 15:54:27 +00:00
John Stiles
9aeed131a3 Code cleanup: Add isScalar/isVector/isMatrix helpers to Type.
These checks are made very frequently; it significantly eases
readability to have dedicated accessor methods, versus the verbose
`x.typeKind() == Type::TypeKind::kFoobar`.

Change-Id: I812b95f871cee436ccd3a5982c404f83563d44e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338317
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-25 15:17:17 +00:00
John Stiles
d8ca6b608e Replace SPIR-V assertion with mixed-types error message.
This is very unlikely to occur in real-world code, as it's somewhat
nonsense to use the comma operator in this way. However, it's better to
fail cleanly than to assert.

Change-Id: I76481cd8a993cb1a798ee16956400a512efd4c15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337636
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-25 15:13:27 +00:00
Mike Klein
3e2e7b28b6 replace SkOpts::hash_fn
This new version always delivers the same results,
and I think can be simplified like this without
spoiling any of the bulk speed.

Change-Id: I20e42e58418e658278bb5db9472c39722b33160a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338339
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-11-25 14:55:27 +00:00