Commit Graph

60560 Commits

Author SHA1 Message Date
skia-autoroll
beefc9c5d2 Roll vulkan-deps from 0ff867fa3164 to 520daea585de (6 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/0ff867fa3164..520daea585de

Also rolling transitive DEPS:
  https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Cross from 940efca099af to d0c8dc304503

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

To file a bug in skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn;skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE
Bug: None
Tbr: lovisolo@google.com
Change-Id: I9a8ff0d90f507312d4ec1a8a60ff3eb4784fcc68
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540371
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-13 21:18:16 +00:00
Robert Phillips
5bde3f4b2f Add kSkBlendModeCount
I keep bumping into the need for this

Change-Id: I69384f7d590c163fd6244bdc64cc5e48450fecd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540171
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-13 18:56:38 +00:00
Herb Derby
c5bb10cd48 Verify pinned state in glyphVector and deserialization
Change-Id: I283f421183f747e7225eaf96c9c5e4217b6f5dc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540036
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-05-13 18:32:19 +00:00
John Stiles
018b243aa4 Eliminate empty statements/nops in dehydrated modules.
This doesn't improve the quality of final code, so we can skip this pass
during normal program compilation, but there's no excuse for leaving
Nops in a dehydrated module that we always load into memory at startup.

Change-Id: I7ff94f2713cff658799c469a46b526544dfc318c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540040
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-05-13 17:31:59 +00:00
Brian Osman
69fecd6c2d Add SkCapabilities object
This describes the capabilities of a particular Skia rendering context
(GPU context, or the CPU backend). At the moment, it only contains the
supported SkSL version (with a new enum added to specify the current
value as "100" and a new ES3 value as "300".

SkCapabilities can not be retrieved from an SkCanvas - the client must
have a concrete way of knowing what their destination device that will
do the actual rendering is (GrCaps or SkSurface).

This CL doesn't make use of the SkCapabilities yet, that's coming in
follow-up CLs that alter the SkSL compiler and SkRuntimeEffect API.

Bug: skia:11209
Change-Id: I4e9fd21ff7ffd79f1926c5c2eb34e10b3af4bc9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/537876
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2022-05-13 16:31:20 +00:00
John Stiles
f6e31bf1dc Add const modifier to initialPreLocal identity matrix.
This makes expressions with `initialPreLocal` eligible for constant
folding. In practice, this doesn't do much today because matrix constant
folding doesn't support no-op-arithmetic elimination, but in a followup,
we could easily simplify `initialPreLocal * foo` --> `foo` when it's the
identity matrix.

Change-Id: I4c6faf2aa550b6b9776dd8a5da9ea5ec06cd8330
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540316
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-05-13 15:30:30 +00:00
Michael Ludwig
f4b4420410 Consolidate tessellation tolerance tracking into helper class
Moving it into the helper class serves a few purposes:
1. Consolidate the more complicated stroke vertex count calculations so
   that they can be reused between graphite and ganesh more easily.
2. Gives us an object that the PatchWriter can pass to its
   PatchAllocators that is itself not a template, so the allocators can
   be easily reused across different PatchWriter configurations.
3. Gives us a good place to start experimenting with tighter tolerance
   tracking (particularly around internal rotation and join rotation).

Bug: skia:13056, skia:13012
Change-Id: I6086d459a21ac7ab8e833a988cc7c403983c3dd2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/537083
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2022-05-13 15:23:25 +00:00
John Stiles
11f2740463 Remove [[maybe_unused]] workaround in MetalCodeGen.
This effectively rolls back http://review.skia.org/538045.

Change-Id: I9c457a6c9c9ba98d4c2e3a6af03c5dd80c76beb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540082
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-13 14:47:23 +00:00
John Stiles
a91ee035ed Eliminate unreachable code in dehydrated modules.
At present this has no effect. There isn't any dead path in the built-in
code (as you would hope) and we don't do any sufficiently-interesting
transformations that might cause unreachable code to appear.

Change-Id: I6798ae21f8721cf9f6f61ecb1765c8d8df7a9d0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540039
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-05-13 14:45:41 +00:00
Eric Boren
860c40fee5 Update Skia milestone to 104
Change-Id: Iafd9cf15ac3c42bda7fa6b6857a82dc2eae6d234
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540296
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2022-05-13 14:21:17 +00:00
John Stiles
ed2e8ab44a Eliminate dead local variables from dehydrated code.
This should address the root cause of http://review.skia.org/538045.

We currently don't eliminate unreferenced names from the symbol table,
although that'd be free money if we wanted to do it.

Change-Id: I712e23e6a4f3cb48c2b5ae68f042e13031d5f632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540038
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-05-13 14:00:52 +00:00
Leon Scroggins III
1e43dce386 Android: Turn on select Skia tracepoints
In b/224677119, we found that turning on *all* of Skia tracing caused
regressions. We are separately turning it off, but we do find some value
in select tracepoints. Add back in the ones we care about. The remaining
tracepoints can still be turned on manually with the sysprop.

All of these tracepoints are already traced on other platforms (e.g.
Chrome, Flutter). Convert them to TRACE_EVENT0_ALWAYS, introduced in
I13fd77445e0d2a05e46b75629b37bab5f571b02e. (A better long term solution
will be to use categories, as tracked in b/232405757.)

For GrOps, we had an Android-specific tracepoint, added in
I18ac03676da058ba4af5bd6a0c375b3f17c3c399, as well as separate
TRACE_EVENT0 tracepoints with basically the same timing and label.
Remove the Android-specific version, and make the other one
TRACE_EVENT0_ALWAYS. This removes redundant child-parent pairs.

Bug: b/231627558
Bug: b/224677119
Bug: b/232226246
Test: perfetto
Change-Id: I03ce62062a0bde723d3b6ac026bd978b249ad9a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540156
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-13 13:18:54 +00:00
skia-autoroll
1a08f22a72 Roll vulkan-deps from edbeecb39d80 to 0ff867fa3164 (1 revision)
https://chromium.googlesource.com/vulkan-deps.git/+log/edbeecb39d80..0ff867fa3164

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

To file a bug in skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn;skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE
Bug: None
Tbr: lovisolo@google.com
Change-Id: I75b510f8821d2ffe189f3c6cdb496fb1efcb8905
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540240
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-13 08:34:45 +00:00
skia-autoroll
2816ce0dea Roll ANGLE from 1d8227dab6f1 to 8bb7c35c2159 (12 revisions)
1d8227dab6..8bb7c35c21

2022-05-12 abdolrashidi@google.com Vulkan: Flush texture updates more often
2022-05-12 jmadill@chromium.org Update docs for SwANGLE triage process.
2022-05-12 lubosz.sarnecki@collabora.com Tests: Add Black Desert Mobile trace.
2022-05-12 jmadill@chromium.org Add extension for read-only DS feedback loops.
2022-05-12 cnorthrop@google.com Tests: Skip pubg_mobile_skydive on Nvidia
2022-05-12 jmadill@chromium.org Remove angle_util from restricted traces.
2022-05-12 jmadill@chromium.org Test Runner: Accept Chromium bot mode flag.
2022-05-12 syoussefi@chromium.org Vulkan: Tag dynamic dirty bits with DYNAMIC
2022-05-12 syoussefi@chromium.org Vulkan: Dynamic state for stencil reference
2022-05-12 min.zhang@arm.com Vulkan: Optimize the vkImage layout when used as GL_image
2022-05-12 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from e0a1188d7652 to f1c2c0b07281 (2 revisions)
2022-05-12 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 693c7419bd5c to 65b23f3c9e05 (580 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 lovisolo@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/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: lovisolo@google.com
Test: Test: angle_perftests --gtest_filter="*black_desert_mobile*"
Test: Test: angle_perftests --gtest_filter="*pubg_mobile_skydive*"
Change-Id: I65c2db048401d7a2fe5cefc32814208a1a076e8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540237
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-13 05:52:49 +00:00
skia-autoroll
a562c49017 Roll Dawn from 6400e3bfc0cd to ab9757036bd6 (13 revisions)
https://dawn.googlesource.com/dawn.git/+log/6400e3bfc0cd..ab9757036bd6

2022-05-13 jiawei.shao@intel.com tint: Implement DP4a on HLSL writer
2022-05-12 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll ANGLE from 1d8227dab6f1 to 8bb7c35c2159 (12 revisions)
2022-05-12 cwallez@chromium.org Allow writeMask==0 && format==undefined when the shader outputs the target
2022-05-12 bclayton@google.com Roll third_party/webgpu-cts/ 0a1288f5e..11f61c5f9 (10 commits)
2022-05-12 cwallez@chromium.org dawn.node: Add support for GPUTextureDescriptor.viewFormats
2022-05-12 enga@chromium.org Remove final qualifiers from WireClient/Server HandleCommands
2022-05-12 jrprice@google.com tint: Add missing source information for | and ||
2022-05-12 jrprice@google.com tint: Add implicit CF_return->{last cf} edge
2022-05-12 amaiorano@google.com Create tracking bug for certain CTS failures
2022-05-12 bclayton@google.com tint/resolver: Fix chromium-style warning treated as error
2022-05-12 bclayton@google.com tools/CTS: merge [Slow] + [Pass] -> [Slow]
2022-05-12 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from b7126bab3a19 to f1c2c0b07281 (1 revision)
2022-05-12 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll ANGLE from dd9b4afe5645 to 1d8227dab6f1 (10 revisions)

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

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: kainino@google.com
Test: Test: tint_unittests
Change-Id: I937d0043d6e910e11c316889919d1448abe44904
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540236
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-13 04:39:19 +00:00
James Godfrey-Kittle
eb48a2483d [graphite] Add conical gradient shader
This is largely a re-implementation of the logic in
src/gpu/ganesh/gradients/GrGradientShader.cpp and
src/shaders/gradients/SkTwoPointConicalGradient.cpp. For simplicity,
most everything is in the shader now, but with an eye towards moving
computations that don't use sk_FragCoord into SkKeyHelpers.cpp.

Bug: skia:13302
Change-Id: I73d2e1f6c6ac0580aa897ffff3cfa87f4ed62b11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539569
Commit-Queue: James Godfrey-Kittle <jamesgk@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2022-05-12 21:27:24 +00:00
John Stiles
dc951b64a1 Use ConstructorCompound::Make when optimizing swizzles.
Constructor::Convert is a very heavy hammer which does error-checking
and lots of logic to identify the right constructor type to use. It cuts
out a lot of redundant work to call the desired method
`ConstructorCompound::Make` directly instead.

Change-Id: Icf9e513dbce223c2b27ccd0d11dc08eea849ff39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539821
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-05-12 20:38:53 +00:00
skia-autoroll
dd427982f0 Roll vulkan-deps from 38483e7d6eef to edbeecb39d80 (2 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/38483e7d6eef..edbeecb39d80

Also rolling transitive DEPS:
  https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Tools from fe5067838521 to c5d859fbe327

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

To file a bug in skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn;skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE
Bug: None
Tbr: lovisolo@google.com
Change-Id: I2b1fb5f4e04851699c334b6ce78448a24973801d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540015
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-12 19:52:53 +00:00
Brian Osman
a6f57a80da Simplify/localize the LayoutToken hash map
Uses the initializer_list constructor to avoid generating a bunch of
insert calls, and then moves everything right into layout().

Change-Id: I09f5538e20ea6f7d3b6117020302a41e18b66295
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539822
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-05-12 18:45:17 +00:00
Florin Malita
2418c88fb1 [skottie] Fix Sphere effect lighting for transparency
Colors are premultiplied, so the specular component (which is additive)
must be modulated by alpha explicitly.

Change-Id: If5f7b456b0ce518b1806e9b1e754229c3a6d0981
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539559
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2022-05-12 18:45:11 +00:00
Michael Ludwig
95a421aa1e Manual roll Dawn DEPS with updated bazel build
Change-Id: Iac6b8a0b74fe23959f5ee814f4a30a5458ccf21e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539936
Reviewed-by: John Stiles <johnstiles@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-05-12 18:27:19 +00:00
John Stiles
4567c4d429 Use sk_Caps to access shader-caps bits.
We can access shader caps bits directly from SkSL, using sk_Caps. We
don't need to pass in caps flags from fGpu->caps()->shaderCaps().
Also, you might get different caps bits depending on which
backend/device you are using, so it's a little risky to bake it into
a shared cache; SkSL can apply the right caps bits at compile time.

Change-Id: I896b3915f40fbe7f58dfe5ffb51a462b3d2096ea
Bug: skia:13302
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539572
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: James Godfrey-Kittle <jamesgk@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-05-12 18:17:32 +00:00
Leon Scroggins III
e3772d2cae Remove string copies in Skia tracing macros
ATRACE_ANDROID_FRAMEWORK_ALWAYS and TRACE_EVENT0_ALWAYS create a
SkAndroidFrameworkTraceUtilAlways, which formats the input, requiring a
string copy. Mimic the split in SkAndroidFrameworkTraceUtil, which has
two constructors; one for formatting, and one for static strings. This
allows skipping the copy when it's unnecessary.

Make TRACE_EVENT0_ALWAYS call the cheaper constructor, since it never
has formatted input. ATRACE_ANDROID_FRAMEWORK_ALWAYS has few callers;
only one of them forces an unnecessary copy.

Bug: b/224677119
Test: perfetto
Change-Id: I8e699ae1496c94e08e6f7fce3616254b1a627a7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539896
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-12 17:52:07 +00:00
John Stiles
c54e3aecfd Eliminate redundant compound constructors.
ConstructorCompound::Make() will now turn `float2(myFloat2)` into the
equivalent simpler form `myFloat2` by simply returning the inner
argument as-is. In practice, this codepath is difficult to reach because
`Constructor::Convert` will interpret the above constructor as a cast,
and ConstructorCompoundCast already had a similar optimization in place
(to eliminate same-type casts).

This CL seems large but it's mostly comments. (`is_safe_to_eliminate`
could easily be a single-line return statement if the goal were to
minimize LOC!)

Change-Id: If75d1583e5fe27f7fd903175ebbd9185c67026f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539820
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-05-12 17:36:17 +00:00
John Stiles
d4ab439f9f Pass in a position to Expression::clone overrides.
Previously, each Expression would clone itself at its existing position
and then the position would potentially be overwritten at the end. Now,
rewriting the position happens as part of the clone operation.

This seemed simpler than the previous two-step operation, and also opens
up the possibility of passing the updated position to the clone's
children (but I didn't experiment with that here.)

Change-Id: I07d0c0221fcab460d0db358d059ceecf8a0a7dc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539571
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-05-12 17:00:08 +00:00
John Stiles
0693a24477 Add special case for swizzles of compound casts.
`optimize_constructor_swizzle` already does the same transformation, but
in a far more complex way. In a followup CL, I intend to limit
`optimize_constructor_swizzle` to only operating on ConstructorCompound
objects.

Change-Id: Ieb4210a9ea9efb1a021c4b2e15ba55863000ef93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539819
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-05-12 16:27:20 +00:00
John Stiles
4030d12d16 Simplify various calls to clone().
We added a `clone(Position pos)` overload late; this CL goes back and
uses it in all the places that needed it.

Change-Id: I6924ac9a91ebbd148531dccd25218d6f497ed0d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539568
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-12 16:11:25 +00:00
John Stiles
86ba3b53ff Replace Constructor::Convert with ConstructorCompound::Make.
In cases where we know the type of constructor being made, it is much
more efficient to create it directly, instead of relying on
Constructor::Convert to deduce the type. This also helps us catch
legitimate bugs that Constructor::Convert will paper over; e.g. Convert
will happily accept mismatched types and just cast them (which was
occurring here, due to calling `scalarTypeForLiteral` in the wrong
spot).

Change-Id: I972046e14cc78708a3f1b8a4a31016d91e60a431
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539508
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-05-12 16:04:30 +00:00
John Stiles
b6ec37b222 Fix a case where ConstructorCompound::Make did not update positions.
This handy assertion found a case that we had neglected to update:
https://osscs.corp.google.com/skia/skia/+/main:src/sksl/dsl/DSLExpression.cpp;l=57-59;drc=719239cd69439fff61ba7a58e0524d40aa061e73

Change-Id: Id8ed08e2e2c40ea2d9d2a774b2660c1576a9b6c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539476
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-05-12 16:04:01 +00:00
Michael Ludwig
ead6b6486f Keep GrVertexChunkArray independent from tessellation code
In follow up changes, the PatchAllocator duck type will get a little
more involved with tessellation-specific code, so I figured it'd be good
to buffer it with this new type between GrVertexChunkBuilder (which can
be used more generally if we update ops to do so).

Bug: skia:13012
Change-Id: Ib51d7beceba98cb10678dd04b431e923518ed6d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539037
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-05-12 14:20:18 +00:00
skia-autoroll
7c892b6303 Roll vulkan-deps from 427a49d213e9 to 38483e7d6eef (9 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/427a49d213e9..38483e7d6eef

Also rolling transitive DEPS:
  https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools from f74b85853c35 to 98340ec500e9
  https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Tools from a9d2badae234 to fe5067838521

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

To file a bug in skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn;skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE
Bug: None
Tbr: lovisolo@google.com
Change-Id: I539bdf8facd84c58b056d7bc66cfb7d349513d9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539626
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-12 07:17:17 +00:00
skia-autoroll
6080d9df9e Roll ANGLE from a8ebdf2b5a8b to 1d8227dab6f1 (18 revisions)
a8ebdf2b5a..1d8227dab6

2022-05-12 syoussefi@chromium.org Vulkan: Dynamic state for stencil write mask
2022-05-12 syoussefi@chromium.org Vulkan: Dynamic state for stencil compare mask
2022-05-11 senorblanco@chromium.org Cleanup from glBlitFramebuffer() 3D texture fix.
2022-05-11 syoussefi@chromium.org Vulkan: Dynamic state for blend color
2022-05-11 syoussefi@chromium.org Vulkan: Dynamic state for depth bias
2022-05-11 senorblanco@chromium.org Use GLTexture in TextureTest for RAII goodness.
2022-05-11 syoussefi@chromium.org Vulkan: Dynamic state for line width
2022-05-11 senorblanco@chromium.org D3D11: clean up ES31 test expectations.
2022-05-11 jmadill@chromium.org Add a draw call perf test for changing a single uniform.
2022-05-11 syoussefi@chromium.org Vulkan: Fix VulkanPipelineCachePerfTest
2022-05-11 senorblanco@chromium.org D3D: minor cleanup for image load/store.
2022-05-11 syoussefi@chromium.org Vulkan: Set dynamic state after binding pipeline
2022-05-11 gert.wollny@collabora.com PerfTests: Add support for eglCreateImage and eglDestroyImage
2022-05-11 lexa.knyazev@gmail.com D3D9: Enable OES_fbo_render_mipmap
2022-05-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 27ef4a0d9701 to b768d03422ea (7 revisions)
2022-05-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from e4a6f2d74d3c to e0a1188d7652 (1 revision)
2022-05-11 gert.wollny@collabora.com util: Add calls for createImage* and destroyImage* to GLWindow
2022-05-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 46c13be19f0f to 693c7419bd5c (567 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 lovisolo@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/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: lovisolo@google.com
Change-Id: I49f5c9b795b891ba18d28efc437c00121eeb4cea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539622
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-12 06:14:52 +00:00
skia-autoroll
866f74a1ef Roll SwiftShader from e0a1188d7652 to f1c2c0b07281 (2 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/e0a1188d7652..f1c2c0b07281

2022-05-12 capn@google.com Revert rcpss/rsqrtss instrumentation to default propagation
2022-05-11 capn@google.com Fully enable MemorySanitizer instrumentation for GN builds

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 lovisolo@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in SwiftShader: https://bugs.chromium.org/p/swiftshader/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: lovisolo@google.com
Change-Id: I6f11df554f27e24262dc51b0780566386c7699d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539623
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-12 04:51:55 +00:00
Derek Sollenberger
d4aa36a9b6 Revert "create ParticleDrawable for animated Skotties"
This reverts commit ddd64d35c6.

Reason for revert: breaking the android build

Original change's description:
> create ParticleDrawable for animated Skotties
>
> Change-Id: Ieaea5e9c358604a25f0fecd7bac71a0450359653
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538042
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: Ida2bfe6359790a49a8c2b4f8a3b96d9b14da5600
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539083
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Derek Sollenberger <djsollen@google.com>
2022-05-11 23:35:08 +00:00
John Stiles
353e2c65c9 Prevent comma operator constant-folding or constant-expression-usage.
OpenGL docs specifically insist that the sequence (comma) operator
should not be treated as a constant-expression so that attempts to
declare multidimensional arrays with a comma will fail:
http://screen/vJEpAe9yNmbzZTm

(See "12.43 Sequence operator and constant expressions" in the OpenGL
ES3 documentation or read skia:13311 for details.)

In practice, we don't get much benefit from optimizing away unused
comma-expressions; it improves some synthetic tests, but realistically
this will not help Skia in any real-world scenario. The constant folder
no longer attempts this optimization, and comma-expressions are now
rejected in a constant-expression context.

Change-Id: Ic5dea6ff90e36614b548c1ce89a444e81da944ae
Bug: skia:13311
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539565
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-05-11 22:52:24 +00:00
John Stiles
e9ae96cdcd Make runtimefunctions slide much cooler.
Previously, this slide used a bunch of code to render a gray ramp. My
first impression was that the test slide was broken, but this was the
actual intent. We now use the shaders.skia.org zoomy-neurons.

Change-Id: Icd08462e30ab328b533525d74fa6064bccb76e8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539202
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-11 21:18:53 +00:00
John Stiles
b1b1a67647 Disable optimizations when viewing shaders in the 'SkSL' setting.
Most shader text displayed in SkSL mode is passed through, exactly as
written--comments and all--and is unaffected by the optimization
setting. However, runtime effects go through the pipeline stage which
can subject them to optimizations. This is unexpected in "SkSL" mode,
where the goal is to display the shader as close to the original input
as possible.

Now, when Viewer displays a runtime effect in "SkSL" mode, it will not
have optimizations applied (other than some basic stuff like constant
folding, which is currently non-negotiable in SkSL).

Change-Id: I9bd3d8f7067d7124b3fbe88e8a422212b645597a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539200
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-05-11 21:18:35 +00:00
Herb Derby
31dffc0ed7 Make the SkGlyphRunPainter clearly GPU only
This includes using SkNoPixelsDevice for the GlyphTrackingDevice
in the SkChromeRemoteGlyphCache because it is the only thing that
uses SkGlyphRunPainter outside of GPU.

Change-Id: Id22e538b2c1aa0d65433878e428c9465fe222d12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539558
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-05-11 20:29:38 +00:00
John Stiles
04a696455b Simplify identity matrix creation.
GLSL/SkSL allow creation of a uniform scale matrix by constructing a
matrix with a single scalar argument. It will be splatted across the
matrix's diagonal.

Change-Id: If3410909f8136f3f4c39f7d7208d5bd6066e4e53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539047
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-05-11 20:27:16 +00:00
skia-autoroll
415c398a14 Roll SK Tool from c91f0c000f6a to a95b1801a0a9
https://skia.googlesource.com/buildbot.git/+log/c91f0c000f6a..a95b1801a0a9

2022-05-11 borenet@google.com [autoroll] Add CHROMIUM_NO_CR Gerrit label config

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

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Tbr: lovisolo@google.com
Change-Id: Ie73ada9fa17817bd72670ad3c314984273aa339d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539223
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-11 20:04:00 +00:00
John Stiles
625baf8e5b Disable EmptyBlocksES3 test on Pixel 2XL/3.
Looks like really old drivers struggled with weird no-op blocks.

Change-Id: Ie32754a9c221eb7c20924ee27e5facca7e9701f0
Bug: skia:13309
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539561
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-05-11 19:46:59 +00:00
skia-autoroll
925a500435 Roll vulkan-deps from b768d03422ea to 427a49d213e9 (3 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/b768d03422ea..427a49d213e9

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

To file a bug in skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn;skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE
Bug: None
Tbr: lovisolo@google.com
Change-Id: Iddb7f856e66fba3437a07db8ff1d9e52ddedcaa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539220
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2022-05-11 18:38:19 +00:00
Jorge Betancourt
ddd64d35c6 create ParticleDrawable for animated Skotties
Change-Id: Ieaea5e9c358604a25f0fecd7bac71a0450359653
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538042
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-11 17:44:53 +00:00
Michael Ludwig
928683be91 Simplify CalcNumRadialSegmentsPerRadian signature
The conceptual meat of this change is that instead of taking a local-to-
device scale factor and the local stroke width, CalcNumRadialSegments
now takes the approximated device-space stroke radius. The main benefit
of this is that hairlines can be defined exactly without needing to
invert the local-to-device matrix or otherwise estimate a local-space
radius that would transform to the 1px hairline. The actual math for
regular strokes remains the same (scale factor * radius), but is moved.

In addition, this CL fixes a bug I had introduced in
https://skia-review.googlesource.com/c/skia/+/502059/
where I had not realized the CPU code operated on stroke *width* and the
GPU code operated on stroke *radius*, so updating them to use the same
equations w/o changing their inputs actually caused us to overestimate
the number of radial segments required. With this change, both the CPU
code and GPU code operate on stroke radius.

Between that bug fix and simplifying the hairline stroke radius math,
I am expecting lots of slight AA changes around stroked paths.

Lastly, I entirely removed the StrokeTolerancesBuffer, which was a class
that buffered up calculations of CalcNumRadialSegments by looking at the
entire list of paths in an op and putting them into a 4-lane SIMD
function instead. This isn't currently available for Graphite and makes
it harder to consolidate the radial segment calculations. Locally I
found no noticeable difference in the patch writing microbenchmarks
(where it would be more significant), and somehow the motionmark SKPs
were actually a touch faster. I'm hopeful that we can drop this
complexity and not take a large performance hit.

Bug: skia:13056, skia:13012
Change-Id: If16103078ebe9e4e60470445c0868deb3904f7de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/537239
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-05-11 17:44:05 +00:00
Brian Osman
30162feb61 SkLineClipper::IntersectLine - Fix out-of-bounds final result
The fuzzer found a subtle bug where our line vs. rect clipping could
produce points outside of the rect. Thanks to floating poing inaccuracy,
the first (horizontal) clip would produce a point just outside the
bounds. Then, we'd re-clip against the vertical segments - but go back
and start from the original points. Again, thanks to floating point,
we'd produce a point just outside the bounds.

The fix here is straightforward: After we've done the first clip
(reducing the magnitude of the values involved, and constraining the X
coordinates), use *that* as the new endpoints for the second clip.
Mathematically this is identical (the tmp values are new upper bounds on
the extents of the final endpoints after the first clip), but the math
is more stable this way.

Bug: chromium:1320467
Change-Id: I9c816110edb2944544243f2ad89665d5bc5c9c53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539196
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-05-11 17:18:50 +00:00
Michael Ludwig
dc09cf8104 Add new file to Dawn's bazel build
Change-Id: I2a1fedbbaabd57e4546c2a628f6d297e11f4244b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539318
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-05-11 16:24:10 +00:00
Aditya Kushwah
faa99cb931 Plumb label for atlas and store in GrDrawOpAtlas.
This CL define a const label string in GrDrawOpAtlas and have the
constructor accept it. This will help us to label atlas.

Bug: chromium:1164111
Change-Id: I6e194b9a59b940b359887736df27c1da130b1d8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539136
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-05-11 15:27:24 +00:00
Robert Phillips
e11ac02775 Remove unused flush-time OpsTask feature
This is just a cascade of changes from removing the (unused) 'flushTimeOpsTask' parameter from SurfaceDrawContext::Make.

Change-Id: Ia92dfada8df007761d9de3c16e6a9c8850c3d399
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539066
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-05-11 15:03:10 +00:00
John Stiles
efbc7ca3b9 Remove unnecessary use of ConstructorScalarCast.
This made sense when literals were spread across multiple classes
(FloatLiteral/IntLiteral/BoolLiteral). Nowadays we can just call
Literal::Make and pass the Type that we want our literal to be.

Change-Id: I54ce5fcf7bcadac4be1fe10a358b9c86c234de8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539397
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-11 14:51:25 +00:00
John Stiles
3c2997cacc Disable no-op arithmetic simplification when optimization is off.
We will continue to fold expressions like `10 + 0` or `5 * 1` or
`PI * 1` (assuming PI is a const float) because both sides are known,
but non-constant-expressions like `x + 0` (assuming x is not a constant)
or `foo *= 1` will be left as-is when the optimizer is off.

This improves the accuracy of the Viewer shader tab, because a runtime
effect expression like `color *= scale` will be preserved in the final
output when optimization is off, instead of being replaced with a Nop
when scale equals one.

Change-Id: I218b327cb0cd12654dca446dee8a5baa96f589b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539197
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-11 14:39:42 +00:00