Commit Graph

52838 Commits

Author SHA1 Message Date
John Stiles
a60fb178b5 Add SPIR-V support for casts to boolean scalar.
Change-Id: Icd8982d604881effee31cc1392e2717cb112d06d
Bug: skia:11172
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353629
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>
2021-01-14 18:35:25 +00:00
Brian Osman
890b2b406a Disallow switch statements in runtime effects
Bug: skia:10680
Change-Id: Ic77f7355866363ef476a93d8da180cf53207fa6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353707
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-14 17:45:16 +00:00
Brian Osman
01f322cce4 Move all runtime effect error tests to runtime_errors
Also renamed Discard to IllegalStatements, and added testing of while
and do loops.

Change-Id: Ibacf69131267a0436808e2e022ad126704af16ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353706
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-14 17:40:54 +00:00
Mike Klein
aebcf73404 always init function fReturnValue
It's not sound to pass undefined (skvm::NA) values into select(),
but this is working today because the F32a argument is 'fixing' it.

The first time through this snippet updating fReturn value,

    int i = 0;
    for (skvm::Val& slot : currentFunction().fReturnValue) {
        slot = select(returnsHere, f32(val[i]), f32(slot)).id;
        i++;
    }

the call to f32(slot) creates an F32{builder, NA}.  We pass that to
select() and that argument's F32a(F32) constructor, resulting in
F32a{builder, NA, 0.0f}.  Then when we need that as an F32, we resolve
it as splat(0.0f) because the F32a's id field is NA.

In short, best to remove F32a. :)

Added some SkASSERTs that would have caught this.

Change-Id: I67324cf20ad39ca555e69b9c407f379d14046043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353838
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-14 17:22:04 +00:00
Mike Klein
a517cfc3f4 slightly tweak bool->int
I'm looking to phase out I32a/F32a, and rewriting this expression to
avoid select() makes it easier, making these types unused except in
SkVM.{h,cpp}.

There's no particular reason beyond making that refactor easier to do
this: SkVM can convert select(cond, splat(1), splat(0)) into cond & 1
itself, and once I'm done with removing I32a/F32a, if we prefer select
we should be able to rewrite this back as

    dst[i] = skvm::select(i32(src[i]), 1, 0);

Change-Id: I562a112e54fdc2578802db02f6754c64a12798cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353837
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-14 17:14:33 +00:00
John Stiles
e7e68efd9f Add unit test for int/float mismatch error detection.
The "disallowed" tests are largely allowed in the current code, but all
fail properly in the followup CL.

Change-Id: I8e03570165480b60db9701ac1a782e1124ded56b
Bug: skia:11164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353617
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-14 16:56:53 +00:00
John Stiles
48c2884c70 Add SPIR-V support for boolean vector typecasts.
Previously, `writeVectorConstructor` did not consider boolean types at
all when converting scalars to a different type. Now, this code reuses
the existing logic from `castScalarTo(Float|SignedInt|UnsignedInt)`
which supports Booleans. Added `castScalarToBoolean` to cover going in
the opposite direction.

Change-Id: I5479ab181b9b721db7fbff0bdc01718ce8f9f9b9
Bug: skia:11171
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353625
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-14 16:50:03 +00:00
Mike Klein
b296d926b0 macro hygiene in SkRP_opts.h
Change-Id: I4eda7ffb010f236b39750da6134fb8db6fc26380
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353836
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-14 16:17:03 +00:00
John Stiles
e318355a67 Add unit test for scalar conversion constructors.
This revealed a gap in our SPIR-V scalar constructor support;
typecasting a number to bool would lead to an ABORT.

Change-Id: Idac6d7ba34adfd214ed3cad8139e22d7170456f0
Bug: skia:11172
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353628
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-14 15:53:03 +00:00
Brian Osman
6c7910e680 Use isNumber() rather than isFloat() || isInteger()
Change-Id: Ibb9dca7b8e04485924f6a7d8dd4b17df90d5f320
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353779
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-14 15:48:23 +00:00
Tyler Denniston
8f78d55284 Reland "[svg] Perform colorspace conversions for filter effects"
This reverts commit 36acb7b10c.

Reason for revert: artifacts in 1010102 are expected

Original change's description:
> Revert "[svg] Perform colorspace conversions for filter effects"
>
> This reverts commit a0880eda22.
>
> Reason for revert: visual artifacts in 10-bit color depth (10-10-10-2)
>
> Original change's description:
> > [svg] Perform colorspace conversions for filter effects
> >
> > A filter effect can optionally be specified to operate in either sRGB
> > or linearRGB, according to the SVG spec:
> >
> > https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperties
> >
> > This CL adds any necessary conversion steps (SkColorFilters) while
> > constructing the filter DAG. The default filter effect color space is
> > linearRGB. We should now be passing the filters-gauss-* W3C tests.
> >
> > Specific changes:
> > - Tag filter effect results with their colorspace when storing them in
> >   the filter context map
> > - Add an SkColorFolor conversion step as necessary when resolving filter
> >   effect inputs
> >
> > Bug: skia:10841
> > Change-Id: Ide12698ea64c4d40f09df93a60718788809086fa
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353078
> > Commit-Queue: Tyler Denniston <tdenniston@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
>
> TBR=fmalita@chromium.org,tdenniston@google.com
>
> Change-Id: Id4a33c49643039cfb2d2867a1513e8ee1d7b181a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10841
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353630
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

TBR=fmalita@chromium.org,tdenniston@google.com,johnstiles@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:10841
Change-Id: Id6d9e01d9b18ebfb6f9a6cb74518ad5cd73ea00a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353777
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-01-14 15:02:23 +00:00
Heather Miller
bf562de155 Update Skia milestone to 90
Change-Id: Ib4ef9057cb623b2d8ea57c40fb6f67ac731471f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353778
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2021-01-14 14:50:08 +00:00
Derek Sollenberger
9e1cedda63 Add generic uniform setter function to SkRuntimeShaderBuilder
Change-Id: Idab539a4b39fe5ceab54948c99c0dcd6d19fd345
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352743
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-01-14 14:38:18 +00:00
Brian Osman
3d81fdcbd2 Add unit tests for for-loop unrolling
Change-Id: I350a6768ac124362b0d3e0f17e7a026265acf804
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353627
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-01-14 14:38:16 +00:00
skia-autoroll
15595ea39c Roll ANGLE from 2ed9671a0ddd to 198dc345383e (13 revisions)
2ed9671a0d..198dc34538

2021-01-13 sunnyps@chromium.org Support importing NV12/P010/P016 D3D textures as EGLImage
2021-01-13 ynovikov@chromium.org Don't build angle_end2end_tests_mac_sources on iOS
2021-01-13 m.maiya@samsung.com Allow attributes and uniforms to have the same name
2021-01-13 jmadill@chromium.org infra: Fix win-trace-rel bot typo.
2021-01-13 jmadill@chromium.org Program: Support multiple varying packings.
2021-01-13 cnorthrop@google.com Capture/Replay: Add DrawBuffer state to MEC
2021-01-13 jmadill@chromium.org Test Runner: Add a slow tests list.
2021-01-13 jmadill@chromium.org Remove Sleep() from PrimitivesWrittenAndGenerated test.
2021-01-13 jmadill@chromium.org infra: Fixes for config.
2021-01-13 jwata@google.com Use CAS in scripts/trigger.py
2021-01-13 jmadill@chromium.org Add configuration for trace test bots.
2021-01-13 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from e59ae1af7571 to 50bcbaad4cbf (7 revisions)
2021-01-13 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 2a7e78c75a37 to 451c64aaec04 (494 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 ethannicholas@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: ethannicholas@google.com
Test: Test: Aztec Ruins MECTest: Test: D3DTextureYUVTest*
Change-Id: Idca93e7ccb4bbbc7d356b704db2d0c0fe15d252b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353716
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-14 05:12:55 +00:00
skia-autoroll
10c3c43373 Roll Chromium from 8aca3b4d64f2 to 2930e73f7b89 (505 revisions)
8aca3b4d64..2930e73f7b

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 ethannicholas@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: ethannicholas@google.com
Change-Id: I3d4eee47d9e6952becb7f7ba116318a1c04e7ef1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353717
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-14 04:59:15 +00:00
skia-autoroll
f5425e54ba Roll SwiftShader from 3549479dc4cc to 5255c465bbba (6 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/3549479dc4cc..5255c465bbba

2021-01-14 swiftshader.regress@gmail.com Regres: Update test lists @ 2cc34907
2021-01-13 amaiorano@google.com VulkanBenchmarks: add texture sampling to Triangle benchmarks
2021-01-13 amaiorano@google.com Implement VK_EXT_headless_surface
2021-01-13 natsu@google.com Update AHB default YUV dataspace to YCBCR_601
2021-01-13 capn@google.com VulkanBenchmarks: refactor into Image class
2021-01-13 capn@google.com Fix back-face culling for vertices near w=0

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 ethannicholas@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: ethannicholas@google.com
Change-Id: I6889acc69a2d9464fac7bc62db4b6755440be897
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353512
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-14 04:51:15 +00:00
skia-autoroll
f435ada424 Roll Dawn from 424fd828893e to 6f833b7f78c9 (17 revisions)
https://dawn.googlesource.com/dawn.git/+log/424fd828893e..6f833b7f78c9

2021-01-14 hao.x.li@intel.com Add internal compute pipeline in ResolveQuerySet for Timestamp Query
2021-01-14 enga@chromium.org dawn_wire: Skip device inject error if the client drops the device
2021-01-13 bclayton@google.com ShaderModule: Include extra information in shader errors
2021-01-13 bajones@chromium.org Enabled BindGroupLayout deprecation warning and fixed tests it broke.
2021-01-13 enga@chromium.org Ensure all wire child objects are destroyed before their device
2021-01-13 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 395ec2c4aed8 to 313ae9e87f37 (1 revision)
2021-01-13 bclayton@google.com [wgsl]: s/texture_sampled_/texture_
2021-01-13 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 57166264e01f to 395ec2c4aed8 (2 revisions)
2021-01-13 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 1c200cffd051 to 57166264e01f (4 revisions)
2021-01-13 enga@chromium.org Remove special-casing of device reference/release in the wire
2021-01-13 enga@chromium.org dawn_wire: Make all objects owned by the client
2021-01-13 enga@chromium.org Make the Device ref the Instance
2021-01-13 enga@chromium.org Don't forward device lost errors to the uncaptured error callback
2021-01-13 cwoffenden@gmail.com Further fixes to build with with VS2019 (end2end tests)
2021-01-13 cwallez@chromium.org D3D12: Use Texture::Create pattern for swapchain textures
2021-01-13 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 987376cd21a8 to 1c200cffd051 (13 revisions)
2021-01-13 marksibly@gmail.com Reset scissor reset before presenting in opengl

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from 987376cd21a8 to 313ae9e87f37

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 dsinclair@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: dsinclair@google.com
Change-Id: Ica0c27e81068097e298ada27714402ea3fee48f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353511
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-14 04:35:15 +00:00
John Stiles
af9b58e287 Fix fragment processors and unit tests which mix ints and floats.
These need to change because type coercion in SkSL is about to become
more strict in a followup CL; we are disallowing expressions that mix
ints and floats without a cast.

Change-Id: Iff5e2820806b9419afdfcbf25d4a7f96f2eeeccb
Bug: skia:11164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353416
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-14 00:24:45 +00:00
John Stiles
d9d5271b6b Factor out SPIR-V typecasting helper functions.
The test diffs look scary, but the only actual change is a minor
renumbering of IDs. The actual logic is the same.

Change-Id: I5ecc26c8581a4c01834932ff0291deba7d9e4618
Bug: skia:11171
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353622
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-14 00:00:15 +00:00
John Stiles
36acb7b10c Revert "[svg] Perform colorspace conversions for filter effects"
This reverts commit a0880eda22.

Reason for revert: visual artifacts in 10-bit color depth (10-10-10-2)

Original change's description:
> [svg] Perform colorspace conversions for filter effects
>
> A filter effect can optionally be specified to operate in either sRGB
> or linearRGB, according to the SVG spec:
>
> https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperties
>
> This CL adds any necessary conversion steps (SkColorFilters) while
> constructing the filter DAG. The default filter effect color space is
> linearRGB. We should now be passing the filters-gauss-* W3C tests.
>
> Specific changes:
> - Tag filter effect results with their colorspace when storing them in
>   the filter context map
> - Add an SkColorFolor conversion step as necessary when resolving filter
>   effect inputs
>
> Bug: skia:10841
> Change-Id: Ide12698ea64c4d40f09df93a60718788809086fa
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353078
> Commit-Queue: Tyler Denniston <tdenniston@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

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

Change-Id: Id4a33c49643039cfb2d2867a1513e8ee1d7b181a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10841
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353630
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-01-13 22:57:16 +00:00
Brian Osman
9333c8750d Support ES2-compliant for loops in SkSL-to-SkVM
Such loops must be unrollable, so that's what we do.

Bug: skia:11094
Change-Id: I1b34917b6f2d015ae7867415d0120a5df0ffd618
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353619
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-01-13 22:39:45 +00:00
Tyler Denniston
a0880eda22 [svg] Perform colorspace conversions for filter effects
A filter effect can optionally be specified to operate in either sRGB
or linearRGB, according to the SVG spec:

https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperties

This CL adds any necessary conversion steps (SkColorFilters) while
constructing the filter DAG. The default filter effect color space is
linearRGB. We should now be passing the filters-gauss-* W3C tests.

Specific changes:
- Tag filter effect results with their colorspace when storing them in
  the filter context map
- Add an SkColorFolor conversion step as necessary when resolving filter
  effect inputs

Bug: skia:10841
Change-Id: Ide12698ea64c4d40f09df93a60718788809086fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353078
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-01-13 22:15:26 +00:00
Brian Salomon
0857bef61b Reland "Push SkYUVAInfo into GrYUVToRGBEffect."
This is a reland of b60255033d

Original change's description:
> Push SkYUVAInfo into GrYUVToRGBEffect.
>
> Wrap up SkYUVAInfo and proxies into new type GrYUVATextureProxies.
>
> Bug: skia:10632
> Change-Id: Ic907d78a1a40af3c8ef838021749839c422d62dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353042
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

Bug: skia:10632
Change-Id: I1878609153e3fc763620cb71a85d3b012f915155
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353621
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-01-13 22:08:44 +00:00
Brian Osman
77ba8103d3 In runtime effects, verify that loops conform to ES2 rules
Bug: skia:11094
Change-Id: I68a08e79d29579901b74daca3c22f5112fbb3c8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353356
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-01-13 21:49:44 +00:00
Mike Klein
e7541d9b08 make SkShaderBase::onProgram pure virtual
This makes it easier to see which shaders do not have an SkVM
implementation (tricolor for drawVertices, perlin noise) and lets us
reserve the default onProgram() for other uses, like mutually recursive
F32/Half onProgram(), just as we've done previously for color filters.

I've marked both tricolor and perlin noise as "TODO?" rather than just a
simple "TODO", mostly because they're both intriguing to handle in other
ways, perhaps in externalizable SkSL.

Change-Id: I6ccd14a85dee1519b10d53ecbfc1074916954eca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353319
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-13 21:25:14 +00:00
Chris Dalton
57115c0f20 Use tolerance==0 to flatten curves in GrTriangulator
Bug: skia:10419
Change-Id: I6e331a10622a4e2d17442910f9ed6b3af92614e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353337
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-13 20:36:04 +00:00
Kevin Lubick
cbaea295f5 [canvaskit] Expose getShadowLocalBounds
Bug: skia:11146
Change-Id: Ib08a96c8d0ca0f4ca2b489b3793e45f642cb231f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353034
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-01-13 20:24:26 +00:00
Brian Salomon
0e4a29af9d Revert "Push SkYUVAInfo into GrYUVToRGBEffect."
This reverts commit b60255033d.

Reason for revert: GM needs fix for abandoned context 

Original change's description:
> Push SkYUVAInfo into GrYUVToRGBEffect.
>
> Wrap up SkYUVAInfo and proxies into new type GrYUVATextureProxies.
>
> Bug: skia:10632
> Change-Id: Ic907d78a1a40af3c8ef838021749839c422d62dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353042
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: Ia5a1121ed388ad04ef86121a3f7905772316a200
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353618
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
2021-01-13 20:15:16 +00:00
John Stiles
a65441b3c4 Update tests which mix int and float types without casts.
These need to change because type coercion in SkSL is about to become
more strict in a followup CL; we are disallowing expressions that mix
ints and floats without a cast.

Change-Id: I0f6c3cba53fb67078f447345338262c153236c51
Bug: skia:11164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353102
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-13 19:47:13 +00:00
John Stiles
d5e59b6024 Allow type-fluid GLSL-style vec2(int, bool) ctors in SkSL.
Note that GLSL accepts these sorts of constructors natively, but Metal
and SPIR-V do not. In the generated IR we actually add a cast for
subexpressions where the type does not match. These casts can be seen in
the final output for both GLSL (where they are no-ops) and Metal/SPIR-V
(where they are essential).

This change exposed some missing SPIR-V functionality (vector casts do
not support bool types). This can be fixed up in a followup CL; these
casts were previously disallowed by SkSL entirely, so there won't be any
of them in existing code.

Change-Id: I54ae922e91b38bed032537496428747a081dc774
Bug: skia:11164, skia:11171
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353576
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-13 19:45:14 +00:00
Mike Reed
6dbeac51b4 Begin to hide drawBitmap
... now that bitmap
- converts to image with just bitmap.asImage()
- canvas *always* converts bitmaps to images before they are drawn

Bug: skia:10037
Change-Id: I24292f62e0fd072b3b810d974d0fe5c6d9b9a68d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353582
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-13 19:40:45 +00:00
Brian Salomon
b60255033d Push SkYUVAInfo into GrYUVToRGBEffect.
Wrap up SkYUVAInfo and proxies into new type GrYUVATextureProxies.

Bug: skia:10632
Change-Id: Ic907d78a1a40af3c8ef838021749839c422d62dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353042
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-01-13 19:32:45 +00:00
John Stiles
3c1917983b Update VectorConstructor unit test with mixed-type ctors.
GLSL allows mixed types inside a vector constructor, but SkSL currently
doesn't handle it well; some cases don't compile, and others generate
bad code. This will be fixed in a followup CL.

Change-Id: Ia98b498f320b8fa91595404730f6cdc836615140
Bug: skia:11164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353577
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>
2021-01-13 19:09:16 +00:00
Jason Simmons
d8e9436a78 Cache ICU break iterators in SkUnicode_icu
Gate this behind an ifdef that can be disabled in environments where
the ICU ubrk_safeClone API is not available.

Change-Id: Ia1a3f677271622f2b7ae478b4d1ce76c74eed057
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352876
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2021-01-13 18:35:24 +00:00
Ethan Nicholas
67a0a8a787 Fixed error reporting on invalid SkSL assignments
Change-Id: I9859081a14b110731f943e09fdd94dc10e0c9dfc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353580
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-01-13 18:34:44 +00:00
John Stiles
56a9105ac9 Reland "Scrub memory released from a GrMemoryPool in debug mode."
This is a reland of c0315a72d9

Original change's description:
> Scrub memory released from a GrMemoryPool in debug mode.
>
> In debug mode, we now overwrite released memory with 0xDD. This is
> intended to make use-after-free errors easier to catch while debugging.
>
> Change-Id: I04a4c5abcfef5f3f604a2430da15a8b5125239af
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352956
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Change-Id: Id79cadb196868b467fb6d9107eb313bdc147b4f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353419
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-13 18:27:54 +00:00
Tyler Denniston
7bb85dbb5e [svg] Add plumbing for color-interpolation-filters property
The default colorspace for filter effects is linear RGB, as specified in
https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperties.
Currently we perform all filtering in the destination colorspace. This
CL adds the new presentation attribute with the default setting
(according to the spec) of linear RGB.

This CL does not actually implement any colorspace transformations for
filters.

Bug: skia:10841
Change-Id: Id778ad3fa5cb6e0aed756584a50880edd9d82e2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352738
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-01-13 18:07:14 +00:00
Mike Klein
bd747cb1e7 support 7 args in skvm::Program::eval()
On x86_64 we cap out at 6 arguments for JITing, but on arm64 we support
up to 7.  This change avoids the assert when running SkSLInterpreter
unit tests that do hit 7 arguments.

Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-Pixel-CPU-Snapdragon821-arm64-Debug-All-Android,Test-Android-Clang-Pixel-CPU-Snapdragon821-arm64-Debug-All-Android_ASAN
Change-Id: I17383679fb9bce2e4ce052bcac3c694e5af77124
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353537
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-13 17:24:44 +00:00
Florin Malita
836c2ca6a1 [svg] Initial mask plumbing
Introduce SkSVGMask and plumb related attributes.

Also consolidate the clip/mask/filter property types - they all support
the same values: <funciri>|none|inherit.

Bug: skia:10842
Change-Id: If45a75cccc19b84d6547237336fe5d562a85d594
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353436
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-13 17:23:24 +00:00
Ethan Nicholas
92969f2656 SkSL DSL operator overloading
This adds basic operator overloading (everything but array indexing) and
related tests to the SkSL DSL.

Change-Id: Ic9fdc9a02a5496e2706d18fb435d838b4ee53ad7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353103
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-13 16:18:14 +00:00
John Stiles
1242b3fb29 Add guard-rails to Constructor constant-value fetchers.
Previously, we blindly trusted that the scalars inside a compile-time-
constant vector Constructor would be of matching type. (e.g. the scalars
inside a half3 constructor would always be of type half) This *should*
be true if we've done all our type-checking homework correctly, but we
would ABORT if anything went wrong. Now, we are less trusting and will
actually verify types and do the right thing if the scalar inside turns
out to be an int somehow. In practice, there's no real downside to
doing the conservative type-checks.

Change-Id: If0a255eb96a0ccfec7d0a261caad542cae93d078
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353556
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>
2021-01-13 15:53:54 +00:00
John Stiles
059bea1380 Simplify IRGenerator::coerce.
I started unpacking the mechanics of type coercion, and realized that
the second half of the function was looking up the Symbol for a Type
based on its name (Types are already Symbols), converting that Symbol
back into a Type (we started with a Type anyway), wrapping that Type
in a TypeReference, then calling that TypeReference (which always
calls convertConstructor).

This CL cuts out the middle steps and simply calls convertConstructor
directly. A test was added to confirm that an earlier error encountered
on the CQ is no longer occurring.

Change-Id: I76aae455a301afe4e67ef989d9dfe11f47ed36ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353105
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-01-13 15:43:44 +00:00
Brian Salomon
7f296c421e Revert "Reland "asyncRescaleAndRead supports unpremul results on GPU""
This reverts commit 0d7de6bc9a.

Reason for revert:  new test failing on pixels

Original change's description:
> Reland "asyncRescaleAndRead supports unpremul results on GPU"
>
> This is a reland of 70fa84a9bf
>
> Bug: skia:11019
>
> Original change's description:
> > asyncRescaleAndRead supports unpremul results on GPU
> >
> > GrSurfaceContext::rescale uses GrSurfaceFillContext instead of
> > GrSurfaceDrawContext.
> > Change-Id: I9c2d647d8f221c129ec4485a4ed936202aee6362
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351923
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Cq-Include-Trybots: luci.chromium.try:android-marshmallow-arm64-rel
> Change-Id: I7b696c37edea8f755ec03431d026ea78556e5844
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353099
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I20523adc2a94185be4802c3802c23531e6e7546f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11019
Cq-Include-Trybots: luci.chromium.try:android-marshmallow-arm64-rel
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353557
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-01-13 14:57:13 +00:00
Florin Malita
fc0ea0a4a5 [svg] TextPath support
- introduce SkSVGTextPath and update the text render logic to
    instantiate new SkSVGTextContexts in onRenderText() overrides
    instead of renderText() root -- this is to observe spec semantics
    [1] requiring <text> and <textPath> to always start a new chunk,
    regardless of their relative nesting.
  - expand SkSVGTextContext to also store PathData when used in the
    scope of a textPath
  - PathData caches SkContourMeasures, for path position lookup
  - update flushChunk() to apply path glyph adjustments [2]:

    * the horizontal glyph position (including relative offset dx),
      adjusted for the glyph center yields a path offset
    * if the offset is outside the path range, the glyph is skipped
    * otherwise the position is determined based on the path matrix
      at the computed offset

   - to support the logic above, the chunk starting position is no
     longer used as a global blob offset but instead is folded into
     individual glyph RSXforms (and the blob always draws at {0,0})

[1] https://www.w3.org/TR/SVG11/text.html#TextLayout
[2] https://www.w3.org/TR/SVG11/text.html#TextpathLayoutRules

Bug: skia:10840
Change-Id: I462eada7c086646afdc1bc84f08ec2368613f1c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/349397
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-13 14:37:39 +00:00
Mike Reed
3a61906e94 Allow chrome to be nearest until it can rebaseline
No changes expected -- only if chrome decides to opt into nearest

Change-Id: Ie493b6c814f3e1e603a116e59a777e5f6b16b370
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353358
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-13 14:23:39 +00:00
John Stiles
7ce175117f Split apart SkRuntimeInvalid tests into multiple functions.
This will help us narrow down the failing test from
http://review.skia.org/353097

Change-Id: Ida3bbecb09c278913cfb302ba7e7766f1a2cbcb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353418
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-13 14:11:42 +00:00
Brian Salomon
0d7de6bc9a Reland "asyncRescaleAndRead supports unpremul results on GPU"
This is a reland of 70fa84a9bf

Bug: skia:11019

Original change's description:
> asyncRescaleAndRead supports unpremul results on GPU
>
> GrSurfaceContext::rescale uses GrSurfaceFillContext instead of
> GrSurfaceDrawContext.
> Change-Id: I9c2d647d8f221c129ec4485a4ed936202aee6362
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351923
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Cq-Include-Trybots: luci.chromium.try:android-marshmallow-arm64-rel
Change-Id: I7b696c37edea8f755ec03431d026ea78556e5844
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353099
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-01-13 13:48:09 +00:00
skia-autoroll
be2a8614c5 Roll Chromium from b9b9a8a5022a to 8aca3b4d64f2 (503 revisions)
b9b9a8a502..8aca3b4d64

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 ethannicholas@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: ethannicholas@google.com
Change-Id: If03af0114469192dd392ff8bdab2420ed50f8908
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353458
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-13 05:37:19 +00:00
skia-autoroll
cc3e936e6e Roll ANGLE from 5b8dec52b68f to 2ed9671a0ddd (8 revisions)
5b8dec52b6..2ed9671a0d

2021-01-12 cnorthrop@google.com State: Provide reference to image unit binding vector
2021-01-12 jmadill@chromium.org Vulkan: Add YUV G8_B8_R8_3PLANE_420_UNORM format.
2021-01-12 cnorthrop@google.com Allow GL_OES_shader_image_atomic when non-conformant
2021-01-12 jmadill@chromium.org Vulkan: Index mandatory support table by ANGLE format.
2021-01-12 syoussefi@chromium.org Vulkan: Increment buffer view serials only when used
2021-01-12 syoussefi@chromium.org Vulkan: Notify ContextVk when UtilsVk binds compute pipelines
2021-01-12 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 348ba200aa29 to 3549479dc4cc (3 revisions)
2021-01-12 jonahr@google.com GL: Clean up Display code related to multithreading

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 ethannicholas@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: ethannicholas@google.com
Test: Test: Aztec Ruins MECTest: Test: Fortnite on ANGLE
Change-Id: If50aae6eaf50ad6f9f2619d03fb7007b882e7b20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353457
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-13 04:45:59 +00:00