Commit Graph

52131 Commits

Author SHA1 Message Date
Greg Daniel
1cf4bc796c Remove unused parameter in vk bindDescriptorSets.
Change-Id: Ie377fcdca09023b71d1b8cce89db1d9f574df3be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338044
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-24 16:16:15 +00:00
Mike Klein
dbc19ea84e implement a whole slew of arm64 ops
This adds assembler support for a bunch of ARM instructions and uses
them to implement a bunch of SkVM ops.  No diffs.

movs() seems strictly more useful than fmovs(), so I've replaced it.

Change-Id: Ied38a44461653598269421b0b56bef4eb19bb1e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335918
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-11-24 16:02:56 +00:00
John Stiles
4dfa977430 Add 'isBoolean' method to SkSL::Type.
We have built-in methods for determining whether a type is an int,
float, signed, unsigned, matrix, vector, etc. For some reason, however,
the lowly boolean never received similar treatment. Now, booleans are a
first-class citizen and can be identified by calling `isBoolean` instead
of doing a string compare or looking at the Context type pointers.

(I did do a quick search to make sure that kNonnumeric wasn't used
anywhere else to check for Boolean-ness.)

Change-Id: I35c0e3c7530c13e2c4e307a70272d298ce6b44bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338042
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-24 15:57:46 +00:00
John Stiles
feada47df6 Reland "Simplify _blend_set_color_saturation, removing an instruction."
This reverts commit e81fb87bb4.

Reason for revert: checking results with less-aggressive inliner

Original change's description:
> Revert "Simplify _blend_set_color_saturation, removing an instruction."
>
> This reverts commit ed289e777c.
>
> Reason for revert: causing strange artifacts, only on Adreno
>
> Original change's description:
> > Simplify _blend_set_color_saturation, removing an instruction.
> >
> > This tightens up our intrinsics slightly; after inlining, it eliminates
> > one scratch variable. (We no longer need to copy `sda` into `hueColor`
> > as hueColor is now unchanged.)
> >
> > Change-Id: Iece5ba2fe11cde54481704a1787114a2c2a66d9b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336599
> > 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>
>
> TBR=brianosman@google.com,johnstiles@google.com
>
> Change-Id: Ica506467b0a4e03d0cbe482034acfa2d9f8d2c16
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337560
> Reviewed-by: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,johnstiles@google.com

Change-Id: Ia93263f3269c057e7eaa69ca2b05e783d18c0199
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337944
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-11-24 15:35:05 +00:00
Mike Reed
2aa3b8dee4 fix test to use new api
Change-Id: I58360468b4d913b7cd2c285193060a0224a90356
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338038
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-24 14:58:25 +00:00
Brian Osman
68ac3b9ec3 Revert "Move GL's SkSL::Compiler to the GPU (like all other backends)"
This reverts commit cddfce2c24.

Reason for revert: Failing Flutter unit tests with *certain* test orderings.

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>

TBR=brianosman@google.com,michaelludwig@google.com,johnstiles@google.com

Change-Id: I043ad395472fe20addcc59784aefe9061dae02ba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338039
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-24 14:19:37 +00:00
skia-autoroll
3df719619f Roll Dawn from 546a7c98c897 to 03badec5d73a (3 revisions)
https://dawn.googlesource.com/dawn.git/+log/546a7c98c897..03badec5d73a

2020-11-23 senorblanco@chromium.org Refactor OpenGLVersion out of OpenGLFunctions.
2020-11-23 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 4c13659a2a39 to 6cd6f7462c49 (1 revision)
2020-11-23 cwallez@chromium.org Metal: Prevent data race on mLastSubmittedCommands

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: I670eea593572b1e63f47a4044f91af2a8264bf31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338017
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-24 04:54:23 +00:00
skia-autoroll
7078f08a6d Roll ANGLE from ebf890fcf9f3 to 1b413197a6d7 (13 revisions)
ebf890fcf9..1b413197a6

2020-11-24 jmadill@chromium.org generate_entry_points.py clean-ups.
2020-11-24 jmadill@chromium.org EGL: Add const to several methods.
2020-11-24 jmadill@chromium.org Use hard-coded year in generate_entry_points.
2020-11-24 jmadill@chromium.org EGL: Remove egl::Error from validation code.
2020-11-24 jmadill@chromium.org EGL: Expose device query as a client extension.
2020-11-23 cclao@google.com Vulkan: Re-enable the tests that was disabled due to specConst
2020-11-23 jmadill@chromium.org Vulkan: Enable floating point end2end tests.
2020-11-23 m.maiya@samsung.com Vulkan: Fix incorrect exposure of sRGB extensions
2020-11-23 jmadill@chromium.org Suppress WebGL Mac end2end failures.
2020-11-23 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from ec5cd38a0ca6 to 0ec6b066bfbc (2 revisions)
2020-11-23 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from de9e649438ed to 6d612051c083 (4 revisions)
2020-11-23 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from bfc1b42ff141 to a41860e83258 (83 revisions)
2020-11-23 ynovikov@chromium.org Skip tests failing on Linux AMD RX 5500 XT

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 adlai@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: adlai@google.com
Change-Id: Ib7b78316402d0236d6ee906d6bf0c36154875141
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337950
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-24 04:53:44 +00:00
skia-autoroll
af88a65f4a Roll SwiftShader from 6d612051c083 to 43bb60e1fa11 (6 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/6d612051c083..43bb60e1fa11

2020-11-23 amaiorano@google.com Run ReactorUnitTests.LargeStack on non-Windows targets
2020-11-23 amaiorano@google.com Workaround for ReactorUnitTests.LargeStack taking too long on LLVM
2020-11-23 amaiorano@google.com CMake: set REACTOR_DEFAULT_OPT_LEVEL to "" by default
2020-11-23 amaiorano@google.com Add "fmod" external symbol to LLVM backend
2020-11-23 capn@google.com Limit the recursion depth of llvm::SelectionDAG::isSplatValue()
2020-11-23 srisser@google.com Add OpCopyLogical

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 adlai@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: adlai@google.com
Change-Id: Icb720972296534006d9717b5a62e5dcdaa6690b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337949
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-24 04:41:54 +00:00
Chris Dalton
4c1fb1c27a Return the contour's final point from SkPath::RangeIter in kClose
This point is located at fPoints[-1]. We might as well provide it
since it's free, and the stroke iterators for indirect tessellation
will be able to use it.

Bug: skia:10419
Change-Id: If0161a18a9a5a0f3b118a99d7c090d79d424f9db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337637
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-11-24 03:24:43 +00:00
Mike Reed
65fb101861 Reland "Always tweak matrix for consistent opt"
This reverts commit 0a07e9bd86.

Reason for revert: didnt' seem to help g3

Original change's description:
> Revert "Always tweak matrix for consistent opt"
>
> This reverts commit 26e1073885.
>
> Reason for revert: breaking google3?
>
> Original change's description:
> > Always tweak matrix for consistent opt
> >
> > Change-Id: Id16d4c4831724571dc0b1bd5d99e8a93b2a88ea9
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337724
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=mtklein@google.com,reed@google.com
>
> Change-Id: I6200dc3478863e50d4995da952e5c35686efc42a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337939
> Reviewed-by: Mike Reed <reed@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: I52e97d0f5b6f5fa2c264541e9014de692fe436db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337941
Reviewed-by: Mike Reed <reed@google.com>
2020-11-24 01:58:14 +00:00
Mike Reed
0a07e9bd86 Revert "Always tweak matrix for consistent opt"
This reverts commit 26e1073885.

Reason for revert: breaking google3?

Original change's description:
> Always tweak matrix for consistent opt
>
> Change-Id: Id16d4c4831724571dc0b1bd5d99e8a93b2a88ea9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337724
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I6200dc3478863e50d4995da952e5c35686efc42a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337939
Reviewed-by: Mike Reed <reed@google.com>
2020-11-24 01:23:51 +00:00
Mike Reed
ce0c876ce2 hide legacy scalePixels and makeShader
Change-Id: Idae1e44aa0417adb943fd20112fb4f1fa81167f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337719
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-24 00:41:33 +00:00
Mike Reed
26e1073885 Always tweak matrix for consistent opt
Change-Id: Id16d4c4831724571dc0b1bd5d99e8a93b2a88ea9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337724
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-24 00:15:23 +00:00
Chris Dalton
d461f6eb22 Add support for strided loads to GrVx
Bug: skia:10419
Change-Id: I050d8ed49e3a2a6d12b889961e8886f671e2d170
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337561
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-11-23 22:50:33 +00:00
Mike Klein
cd74dea856 macro hygiene in SkVx.h
These macros are not meant to leak out of the file.

Change-Id: I7e24f65a3053785410c7fac760fd3af46c5c1f1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337739
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-11-23 22:49:33 +00:00
John Stiles
9b9415e0f1 Avoid inlining functions that are called repeatedly.
Previously, we'd gauge suitability for inlining by counting the nodes in
a function; past a certain limit, the function was considered "too big."

Now, we also incorporate the number of times that function is called.
So if a function is called three times, and its size is 20 nodes, it
would be considered to have an inlining cost of 60 (3 * 20) instead of
20.

This should tamp down the aggressive nature of the inliner in cases like
gaussian convolution or complicated blends, and will hopefully satisfy
Pinpoint.

No change visible in Nanobench (which doesn't test any of these sorts of
patterns, but certainly inlines things): http://screen/AwD5hkgkEfjVx4g

Change-Id: Ie5e32898245ac854adb9ddd52d87001df6a67125
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337676
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-23 21:51:43 +00:00
John Stiles
f5c1d04ab2 Flatten out constructors nested inside constructors.
- float4(float2(1, 2), 3, 4)   -->  float4(1, 2, 3, 4)
- half3(z, half2(fn(x), y*2))  -->  half3(z, fn(x), y*2)

Single-argument constructors will be ignored by this optimization; these
might be casts or splats.

This had an unexpected side benefit of simplifying some Metal output,
as we need to output fewer Metal matrix construction helper functions
when matrices use more simple scalars for construction.

Change-Id: I0a161db060c107e35247901619291bf83801cb11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337400
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-23 21:29:53 +00:00
John Stiles
92072a398d Fix SPIR-V golden output file extensions.
Previously, every output was labeled ".asm.frag" regardless of the
actual type.

Change-Id: Icf3a56bb04d88cc0443f12c2dfb99c66ee00dff0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337717
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-23 21:15:13 +00:00
Brian Osman
cddfce2c24 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>
2020-11-23 20:56:13 +00:00
Mike Reed
3d58d5aa66 Incremental removal of internal dependence on SkFilterQuality
Next CL: BitmapController to use sampling instead of quality

Bug: skia:7650
Change-Id: Ibd049cafdb967a039fee2ec3591d940931ccb059
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337406
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-23 20:48:56 +00:00
John Stiles
931da26522 Add unit test demonstrating output from Gaussian blur.
Change-Id: I1be21b428939d17bbf3a9347a64db56c7cd69eb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337638
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-23 20:46:54 +00:00
Mike Reed
95b5fb9213 Revert "Share code handling legacy SkFilterQuality"
This reverts commit 9a8cbe52e1.

Reason for revert: forgot to retain the ganesh-diff of performing trilerp for kMedium

Original change's description:
> Share code handling legacy SkFilterQuality
>
> Change-Id: Idfd3b96896d7fa2cdcf9127b4d30e2fc29bcab79
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337436
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I1e126be4c81fa3cfd21ead6734a530eb9509c3d7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337639
Reviewed-by: Mike Reed <reed@google.com>
2020-11-23 19:52:13 +00:00
Michael Ludwig
f9334e918f Reland "Simplify layer bounds syncing and no-device error handling in SkCanvas::internalSaveLayer"
This reverts commit 6c1191d749.

Reason for revert:
 - the lowest-level issue is fixed in https://skia-review.googlesource.com/c/skia/+/337076
   which prevents bad replaceClips from going beyond the device bounds
 - but this also updates the original CL so that we don't call
   replaceClip in these problematic situations. The old behavior of
   effectively downgrading a saveLayer to a save when the new device
   fails to allocate is better behavior.
 - now the bounds tracking is still consolidated as before, but only
   applied when the kNoLayer_Strategy is used, or the layer should be
   empty (in which case replaceClip() is passed an empty rect and
   everything works out).

 - when the layer fails to allocate, we add a clipRegion to restrict
   nested draw calls to what would have been the layers bounds, while
   still respecting the old clip (that normally would have been applied
   on the layer restore, but won't because there's no layer). This is
   somewhat pedantic, and is probably a rare case in the wild, but it
   makes some of our SkCanvas tests easier to deal with.
 - This is because, if you just make an SkCanvas(width, height) directly
   you get an SkNoPixelsDevice but also use the kFullLayer_Strategy.
   SkNoPixelsDevice always fails to create a layer (since it's meant to
   be used with subclasses of SkCanvas that return kNoLayer_Strategy,
   like SkNoDrawCanvas).
 - applying the failed layer bounds as a clip keeps the canvas' reported
   bounds as accurate as possible in this case.
     - in the future, it may be worth updating how SkCanvas can be
       constructed to avoid this, and overhauling the unit tests but
       I didn't want to further delay these changes.

 - it's important that replaceClip() is still used for the kNoLayer case
   because it allows image-filtered layers to expand the clip bounds
   until the restore. This keeps any virtual canvas or recording canvas
   completely in-sync with the base canvas or eventual real canvas that
   is backed by a device that actually draws.

Original change's description:
> Revert "Simplify layer bounds syncing and no-device error handling in SkCanvas::internalSaveLayer"
>
> This reverts commit b27ba538ec.
>
> Reason for revert: causes invalid memory accesses due to replaceClip use, and replaceClip() is probably not the right operation to use
> to emulate a layer when no layer was the strategy or failed to allocate.
>
> Original change's description:
> > Simplify layer bounds syncing and no-device error handling in SkCanvas::internalSaveLayer
> >
> > This corrects some subtle bugs that can occur with recording canvas or
> > if a device fails to be created for a new layer, where the stashed
> > matrix would not be restored properly. Since no new DeviceCM would get
> > added in those cases, the canvas' total matrix wouldn't get fixed in the
> > paired onRestore() and it would remain dirty for the remainder of the
> > canvas's lifetime.
> >
> > After this change, the underlying SkDevice's bounds are also kept in
> > sync with the intent of the saveLayer when kNoLayer_Strategy is used.
> > Previously, the bounds would be applied to the canvas' conservative clip
> > and quick reject bounds, but the device would remain un-updated. As we
> > move towards SkNoPixelsDevice taking over the conservative clip bounds,
> > this ensures bounds remain up to date within a saveLayer/restore pair
> > even if no layer was allocated.
> >
> > Change-Id: I5ca389bdd624ea7278106da863a96e9d8f90e2d1
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335861
> > 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
>
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:1151195, chromium:1151270, chromium:1151294, chromium:1151320, chromium:1151322
> Change-Id: I9db07916ffc450cc6ecc9188d72bb7c35770a974
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337117
> 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: Idcab9084c7f19d8f31b11231fd9b52292fc397a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337157
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-23 19:49:03 +00:00
Chris Dalton
b27f39c924 Add conic fill support to the tessellator
This started out as a sandbox to experiment with a Wang's formula
analog for rational quadratics, but it quickly became apparent that
running Wang's formula on the down-projected points was an upper bound
on what the rational version would have been (for both w<1 and w>1).

This CL therefore adds conic support by upgrading the tessellation
shaders to use ratoinal cubics, converting every path verb to a
rational cubic, and then running Wang's formula on the down-projected
points. In the future we can always drop in a better formula if we
work one out.

Bug: skia:10419
Change-Id: I97021ea56afea54fdbe76745bacd3251e350fd97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337156
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-11-23 18:05:21 +00:00
Mike Reed
ee9c4c71f6 remove legacy SkFilterOptions
Prerequisite:
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/native/+/13103845

Change-Id: Ic89937b2fffa2e81b5e38ac7082134bc0a90c4de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337399
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-23 17:42:21 +00:00
John Stiles
e81fb87bb4 Revert "Simplify _blend_set_color_saturation, removing an instruction."
This reverts commit ed289e777c.

Reason for revert: causing strange artifacts, only on Adreno

Original change's description:
> Simplify _blend_set_color_saturation, removing an instruction.
>
> This tightens up our intrinsics slightly; after inlining, it eliminates
> one scratch variable. (We no longer need to copy `sda` into `hueColor`
> as hueColor is now unchanged.)
>
> Change-Id: Iece5ba2fe11cde54481704a1787114a2c2a66d9b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336599
> 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>

TBR=brianosman@google.com,johnstiles@google.com

Change-Id: Ica506467b0a4e03d0cbe482034acfa2d9f8d2c16
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337560
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-23 17:16:13 +00:00
John Stiles
8b3b1597bb Remove operators &&= ||= ^^= from SkSL.
These are not actually supported operators in GLSL, Metal or SPIR-V and
we don't emulate them. Their absence was causing SPIR-V to fail the
Operators.sksl test.

Change-Id: Ia6933788392aea48836b7be19e32b9969805f254
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337185
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-23 17:12:21 +00:00
John Stiles
21a59d650d Fix double-negation of constant-value construcors.
Previously, the code which calculated Constructor constant values
assumed that a constant-value PrefixExpression would always have an
operand of Constructor. It turns out that another valid case is multiple
PrefixExpressions nested within each other (representing repeated
negation). Updated the code to work regardless of the type of the prefix
operand.

Change-Id: Ic9bf54725ae59330ac817bc4ec7a64def384ab54
Bug: oss-fuzz:27663
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337177
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-23 17:02:21 +00:00
Mike Reed
9a8cbe52e1 Share code handling legacy SkFilterQuality
Change-Id: Idfd3b96896d7fa2cdcf9127b4d30e2fc29bcab79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337436
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-23 16:56:11 +00:00
Michael Ludwig
cbbe0b0df6 Fix reverse bounds calculation for SkImageFilters::Compose
Since reverse bounds calculation is more-or-less the inverse operation
of forward bounds calculation, it needs to be computed from the outer
filter and then the inner filter. Previously bounds were always
computed from inner and then outer, which is only valid for forward
bounds calculations.

Bug: skia:10888
Change-Id: I94a2170617ed01c8ec3066f3518c6baa06da952d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337401
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-23 16:29:11 +00:00
Greg Daniel
b432754c00 Reland "Move vulkan memory uma stats to report on submit."
This is a reland of f77b6e6a68

Original change's description:
> Move vulkan memory uma stats to report on submit.
>
> The current model is biased towards users who make lots of allocations
> so the overall histogram gets more samples for high allocation/memory
> use. By switching this to reporting at submit time, it should make
> the reports much more even across all users.
>
> Change-Id: I269df9ea5e54439f0cca5e7637b0f39d1eaf903a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336957
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Change-Id: Ie5c9a448d224e309714ff4c98ccd6a02b680b402
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337556
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-23 15:07:41 +00:00
skia-autoroll
7d5a4b4a64 Roll SwiftShader from de9e649438ed to 6d612051c083 (4 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/de9e649438ed..6d612051c083

2020-11-20 amaiorano@google.com Kokoro: add Windows x86 (Win32) debug builds
2020-11-20 amaiorano@google.com marl: fix extra ';' warning
2020-11-20 amaiorano@google.com Make vk-unittests load/unload swiftshader only once per suite
2020-11-20 bclayton@google.com Vulkan: Fix use-after-destruction of VkFence event

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 adlai@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: adlai@google.com
Change-Id: I594a33ac1eda4e72bd217f5554d595bfa1ccc24d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337388
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-23 05:19:51 +00:00
skia-autoroll
d40e548110 Roll ANGLE from 777749aafaac to ebf890fcf9f3 (12 revisions)
777749aafa..ebf890fcf9

2020-11-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 62214500294f to bfc1b42ff141 (898 revisions)
2020-11-21 cnorthrop@google.com Tests: Add Google Maps trace
2020-11-21 cclao@google.com Vulkan: Track specialization constant usage bit and feedback to ctx
2020-11-20 cnorthrop@google.com Tests: Add LEGO Legacy trace
2020-11-20 jdarpinian@chromium.org Misc. iOS fixes
2020-11-20 courtneygo@google.com Vulkan: Move FenceRecyler to CommandQueue.
2020-11-20 cnorthrop@google.com Capture/Replay: Limit GL_MAX_IMAGE_UNITS further
2020-11-20 jmadill@chromium.org Trace Tests: Screenshot within the render loop.
2020-11-20 m.maiya@samsung.com Vulkan: Support the single-sampled targets
2020-11-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from 3f73b676d6e8 to 524e5bcfba33 (3 revisions)
2020-11-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 282aa417236a to de9e649438ed (2 revisions)
2020-11-20 syoussefi@chromium.org Vulkan: Drop dependency to VK_EXT_shader_atomic_float

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 adlai@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: adlai@google.com
Test: Test: LEGO MECTest: Test: angle_perftests --gtest_filter="*google_maps*"Test: Test: angle_perftests --gtest_filter="*lego_legacy*"
Change-Id: I118ea62b91596249a4ab835edd5d5026f8ca7624
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337389
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-23 05:10:41 +00:00
skia-autoroll
639fb024be Roll Dawn from 1a14e7e02441 to 546a7c98c897 (6 revisions)
https://dawn.googlesource.com/dawn.git/+log/1a14e7e02441..546a7c98c897

2020-11-21 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 7f075c2a88c0 to 4c13659a2a39 (3 revisions)
2020-11-20 bryan.bernhart@intel.com D3D12: Support caching DX shaders.
2020-11-20 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 36d9a061c847 to 7f075c2a88c0 (9 revisions)
2020-11-20 cwallez@chromium.org Suppress BufferMappedAtCreationOOM on Windows
2020-11-20 ivan.murashov@lge.com Remove storage class specifier for the explicit template specialization
2020-11-20 jiawei.shao@intel.com D3D12: Search the default path of Windows SDK for DXC DLLs

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

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

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

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: kainino@google.com
Change-Id: I3684ab4512688c8e532e0d7767ccb967774cba95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337390
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-23 04:56:21 +00:00
Florin Malita
9a5aa0a295 [svg] Handle zero-radius radial gradients
Per [1]:

"A value of zero will cause the area to be painted as a single color
using the color and opacity of the last gradient stop."

[1] https://www.w3.org/TR/SVG11/pservers.html#RadialGradientElementRAttribute

Bug: skia:10981
Change-Id: I5c4c8444c4dd72d2224b1d8b2536e7aa8c1f4712
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337180
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-11-22 19:12:10 +00:00
skia-recreate-skps
e4bc70cff5 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: I14812380e30fea326f480c6a6785f4a425e7f52f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337457
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-11-22 06:51:19 +00:00
skia-recreate-skps
dd612b6a92 Update Go Deps
Change-Id: I039247e7d3ede716f106b8155486f4f4da024068
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337382
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-11-22 05:48:50 +00:00
Mike Klein
ee40ec6dd6 remove Op::pack
pack(x,y,bits) as an alias for x|(y<<bits) only existed originally to
implement it with the SLI arm64 instruction, but I've since realized
that was misguided.

I had thought the assumption on pack ("(x & (y << bits)) == 0"), i.e.
"no overlap between x and the shifted y", was enough to make using SLI
legal, but it's actually not strong enough a requirement.

The SLI docs say "...inserts the result into the corresponding vector
element in the destination SIMD&FP register such that the new zero bits
created by the shift are not inserted but retain their existing value."
The key thing not mentioned there happens with zero bits _not_ created
by the shift, the ones already present at the top of y.  They're of
course inserted, overwriting any previous values.

This means SLI (and so pack()) become strictly order dependent in a way
I had never intended.  This will work as you'd think,

    skvm::I32 px = splat(0);
    px = pack(px, r,  0);
    px = pack(px, a, 24);

but this version swapping the two calls to pack() will overwrite alpha,

    skvm::I32 px = splat(0);
    px = pack(px, a, 24);
    px = pack(px, r,  0);

I find that error-prone, so I've removed Op::pack and replaced it
with a simple expansion to x|(y<<bits).  That of course works in either
order.

This new test can't JIT at head, but if we implement the other missing
instructions (soon, dependent CL) it would start failing when JIT'd.
The interpreter and x86 were both fine, since they're both doing what's
now the only approach to pack(), the simple x|(y<<bits).

I've left assembler support for SLI in case we want to try it again.

Change-Id: Iaf879309d3e1d0a458a688f3a62556e55ab05e23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337197
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-11-21 12:38:19 +00:00
Herb Derby
d90024d498 split subrun API into Blob and Op interfaces
Instead of using sub classing to generate the atlas API, give
the atlas portion its own interface. Then the atlas subrun
variants can subclass both interfaces.

Change-Id: I8a0ca3d19bd362877224fa64f6c49a5f50d0ceb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336958
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-21 02:24:07 +00:00
Mike Reed
a03f8bf837 other ways to organize samplingoptions?
do not land

Change-Id: I5fa7b2a0d1eb7e893d9b333f850a2f515d7ce065
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336956
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-21 02:00:26 +00:00
Robert Phillips
797831c3aa Reland "Hook up ShaderErrorHandler in the Metal backend."
This reverts commit 0758da2c60.

Reason for revert: A different CL was causing the iOS failures

Original change's description:
> Revert "Hook up ShaderErrorHandler in the Metal backend."
>
> This reverts commit 69df532a55.
>
> Reason for revert: See if this is causing the iOS redness on our tree
>
> Original change's description:
> > Hook up ShaderErrorHandler in the Metal backend.
> >
> > Also cleans up dumping of shader code to use GrShaderUtils.
> >
> > Change-Id: I4d2a13e1a54284d7da0242b74cebb3900921fc35
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337077
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=jvanverth@google.com,brianosman@google.com
>
> Change-Id: I34125bd560cfbd12e50c732137cf921067457be2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337184
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=jvanverth@google.com,robertphillips@google.com,brianosman@google.com

# Not skipping CQ checks because this is a reland.

Change-Id: I46c9d4356702b44c75bb416ae6e8639c7b23b63c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337187
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-20 23:37:36 +00:00
Greg Daniel
c5a37b1d72 Revert "Move vulkan memory uma stats to report on submit."
This reverts commit f77b6e6a68.

Reason for revert: maybe breaking chrome

Original change's description:
> Move vulkan memory uma stats to report on submit.
>
> The current model is biased towards users who make lots of allocations
> so the overall histogram gets more samples for high allocation/memory
> use. By switching this to reporting at submit time, it should make
> the reports much more even across all users.
>
> Change-Id: I269df9ea5e54439f0cca5e7637b0f39d1eaf903a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336957
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I220fe4b88f0e1c0128dbd6652a5e72a5b4ff31d4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337188
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-11-20 23:00:58 +00:00
John Stiles
dda1d31623 Enable SPIR-V disassembly output from skslc.
We now have SPIR-V golden outputs for `blend` and `shared` tests.
This exposes a handful of SPIR-V limitations for us to address.

Change-Id: Ie5278889b8a61432403d06231b17765885bee0ac
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337182
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-20 22:54:26 +00:00
John Stiles
0dd83e165a Revert "SkSL: Test/implement "geometric" intrinsics"
This reverts commit 0d5d956f7b.

Reason for revert: doesn't compile on Metal, breaks tree

Original change's description:
> SkSL: Test/implement "geometric" intrinsics
>
> Bug: skia:10913
> Change-Id: Ie82354b05db141c8ab90b1a615ddfada4f71a98b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335049
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,johnstiles@google.com

Change-Id: I3a44eaf7bafe2fa2d185186c48c39b61116dd2fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10913
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337186
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-11-20 22:17:38 +00:00
Robert Phillips
0758da2c60 Revert "Hook up ShaderErrorHandler in the Metal backend."
This reverts commit 69df532a55.

Reason for revert: See if this is causing the iOS redness on our tree

Original change's description:
> Hook up ShaderErrorHandler in the Metal backend.
>
> Also cleans up dumping of shader code to use GrShaderUtils.
>
> Change-Id: I4d2a13e1a54284d7da0242b74cebb3900921fc35
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337077
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: I34125bd560cfbd12e50c732137cf921067457be2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337184
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-20 22:00:09 +00:00
Robert Phillips
10089c6a42 Revert "Remove legacy SkImage::MakeFromYUVATextures."
This reverts commit df29db4c41.

Reason for revert: blocking the G3 roll

Original change's description:
> Remove legacy SkImage::MakeFromYUVATextures.
>
> Bug: skia:10632
> Change-Id: Iad8989e0ae5aa6921e8e2e27ba375221f2af0262
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336959
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Id77c1679a96ad9c1be93e6e29449cc4785a3983b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337183
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-20 21:51:40 +00:00
Robert Phillips
2c21a11923 Remove uses of SkCanvas::flush
afaict the perf surprises associated with:

https://skia-review.googlesource.com/c/skia/+/334417 (Remove SkBaseDevice::flush)

were bc Ganesh resolves MSAA buffers for SkCanvas::flush but doesn't do so for GrDirectContext::flush.

Where possible this CL switches SkCanvas::flush to SkSurface::flush (which will also resolve MSAA buffers) so that when https://skia-review.googlesource.com/c/skia/+/334417 relands there should not be any performance surprises.

Change-Id: I705ad6219f0f625a88cf3f9e8b2418a3182d298c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335866
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-11-20 21:42:38 +00:00
Mike Klein
c4e958bff3 tweak SkVMBlitter for paints with no shader
As written today we push two sets of the paint color uniforms (4 floats
each set, 8 total): the blitter pushes one unpremul set itself to pass
to shaders that would like to use them, and when there's no shader, we
synthesize an Color4Shader using the paint color that ends up pushing
the other set, this time premul.

When the paint color is opaque there's no difference between these two
sets of uniforms, and when not, well, it's just a few cheap *hoisted*
multiplies to go from that first unpremul set to premul.  So no real
pressing need to push those premul values at all.

This CL adds a new SkShaderBase subclass PaintColorShader used only for
that case where we're synthesizing a shader from the paint color, and
just does what I've described, `return premul(paint);`.

I really only did this because I've been poking around in the debugger
looking for some other bug and noticed the duplicate values in the
uniforms array.  I expect no real-world effect from this CL except fewer
uniforms to look at in the debugger.

Change-Id: I5e1c17945ed77467c91e351f58fcf900674c4391
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337196
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-11-20 21:00:17 +00:00
John Stiles
445df8d115 Factor out redundant code for compiling GLSL/Metal/SPIR-V/CPP/H files.
Change-Id: I4eb9fb50e645f503d71cd6423bfc38076a7c2119
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336777
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-20 20:51:47 +00:00