Commit Graph

51406 Commits

Author SHA1 Message Date
Michael Ludwig
e267464b89 Make small epsilons more rigorous for gpu gaussian blurs
This also has several other bug fixes and refactorings within it that
I realized were possible while updating every where that had checked
sigma > 0 to be sigma > kEffectivelyZeroSigma.

The big things are that SkBlurPriv.h goes away and its functions are
just moved into SkGpuBlurUtils since they were only used by the GPU.
The implementations of those functions are also collected into
SkGpuBlurUtils.cpp.  I removed the GrMatrixConvolution::MakeGaussian,
in favor of SkGpuBlurUtils filling in the kernel itself and then calling
the regular Make. This let me consolidate two different 1D kernel
computing functions, and remove the 1D fallback code from the 2D kernel
calculation because GaussianBlur() can detect that earlier.

The new GM, BlurSigmaSmall, originally drew incorrectly on the GPU
backend because it's small but non-zero sigma would trick the sigma > 0
checks in various places so we'd do a full 2 pass X/Y blur. However,
when the sigma was too small, the kernel was just filled with 0s so the
Y pass would effectively clear everything. While I could have just fixed
that to be a [0, 1, 0] kernel, updating the blur pipeline to compare
against integer radii seems more robust.

Change-Id: I3c41e0235a27615a9056b25e627ffedd995264bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328797
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-21 17:37:12 +00:00
John Stiles
fb330c2b6b Revert "Create a basic IRNode pooling system."
This reverts commit e16eca95f5.

Reason for revert: ASAN error on fuzzer

https://status.skia.org/logs/snBeMRUkDrwDYbnm2SAG/7ad38736-d579-4e94-bc10-87c002f3f7d6/fd7b6ea1-5d36-4612-85d1-88462a5271f7

Original change's description:
> Create a basic IRNode pooling system.
>
> Allocations are redirected by overriding `operator new` and `operator
> delete` on the IRNode class. This allows us to use our existing
> `unique_ptr` and `make_unique` calls as-is. The Pool class is simple;
> it holds a fixed number of nodes and recycles them as they are returned.
>
> A fixed pool size of 2000 nodes was chosen. That is large enough to hold
> the contents of `sksl_large` during compilation, but it can be
> overflowed by very large shaders, or if multiple programs are converted
> at the same time. Exhausting the pool is not a problem; if this happens,
> additional nodes will be allocated via the system allocator as usual.
> More elaborate schemes are possible but might not add a lot of value.
>
> Thread safety is accomplished by placing the pool in a `thread_local`
> static during a Program's creation and destruction; the pool is freed
> when the program is destroyed. One important consequence of this
> strategy is that a program must free every node that it allocated during
> its creation, or else the node will be leaked. In debug, leaking a node
> will be detected and causes a DEBUGFAIL. In release, the pool will be
> freed despite having a live node in it, and if that node is later freed,
> that pointer will be passed to the system `free` (which is likely to
> cause a crash).
>
> In this CL, iOS does not support pooling, since support for
> `thread_local` was only added on iOS 9. This is fixed in the followup
> CL, http://review.skia.org/328837, which uses pthread keys on iOS.
>
> Nanobench shows ~15% improvement:
>   (last week) http://screen/5CNBhTaZApcDA8h
>       (today) http://screen/8ti5Rymvf6LUs8i
>
> Change-Id: I559de73606ee1be54e5eae7f82129dc928a63e3c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326876
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

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

Change-Id: I625d95a14057727b297c0bfc5b98bcd78ad8572c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328906
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-10-21 15:50:13 +00:00
Brian Salomon
07829f27ec Revert "Perform bounding rect-relative calcs in full float in GrRRectBlurEffect"
This reverts commit f4594d1d5b.

Reason for revert: skp gone bad

Original change's description:
> Perform bounding rect-relative calcs in full float in GrRRectBlurEffect
>
> Add GM that tests very wide/tall SkRRects with blurs
>
> Bug: chromium:1138810
> Change-Id: Ib5a2e04de50c441f57f5e4b6194c3f9829323dc9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328383
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I3633efd4802a0a9493831ec471304333272fa87e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1138810
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328905
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-10-21 15:35:34 +00:00
John Stiles
5e7c0403cd Migrate additional FPs to return instead of sk_OutColor.
These changes cause fewer unnecessary temporary variables to be emitted
in the final gencode and give the optimizer less work to do.

Change-Id: Ied0e83904e2d108382666d18ab733334292e5a63
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328838
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-21 15:28:42 +00:00
John Stiles
28692882f7 Wrap built-in symbol tables when a switch statement is cloned.
Switch statements were not caught when originally implementing
http://review.skia.org/328384.

Change-Id: Iff21e5743bf6a604e13c45a736799b4929844472
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328900
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>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-10-21 15:13:12 +00:00
Brian Salomon
f4594d1d5b Perform bounding rect-relative calcs in full float in GrRRectBlurEffect
Add GM that tests very wide/tall SkRRects with blurs

Bug: chromium:1138810
Change-Id: Ib5a2e04de50c441f57f5e4b6194c3f9829323dc9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328383
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-10-21 14:48:02 +00:00
John Stiles
e16eca95f5 Create a basic IRNode pooling system.
Allocations are redirected by overriding `operator new` and `operator
delete` on the IRNode class. This allows us to use our existing
`unique_ptr` and `make_unique` calls as-is. The Pool class is simple;
it holds a fixed number of nodes and recycles them as they are returned.

A fixed pool size of 2000 nodes was chosen. That is large enough to hold
the contents of `sksl_large` during compilation, but it can be
overflowed by very large shaders, or if multiple programs are converted
at the same time. Exhausting the pool is not a problem; if this happens,
additional nodes will be allocated via the system allocator as usual.
More elaborate schemes are possible but might not add a lot of value.

Thread safety is accomplished by placing the pool in a `thread_local`
static during a Program's creation and destruction; the pool is freed
when the program is destroyed. One important consequence of this
strategy is that a program must free every node that it allocated during
its creation, or else the node will be leaked. In debug, leaking a node
will be detected and causes a DEBUGFAIL. In release, the pool will be
freed despite having a live node in it, and if that node is later freed,
that pointer will be passed to the system `free` (which is likely to
cause a crash).

In this CL, iOS does not support pooling, since support for
`thread_local` was only added on iOS 9. This is fixed in the followup
CL, http://review.skia.org/328837, which uses pthread keys on iOS.

Nanobench shows ~15% improvement:
  (last week) http://screen/5CNBhTaZApcDA8h
      (today) http://screen/8ti5Rymvf6LUs8i

Change-Id: I559de73606ee1be54e5eae7f82129dc928a63e3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326876
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-21 14:41:02 +00:00
Robert Phillips
01771c17f1 Increase encapsulation of GrThreadSafeCache::Entry
Prepare this class to hold either a proxyView or a vertex blob

Bug: 1108408
Change-Id: Ib6abb4da64ccc70b9e2af2546e1b071396dd42cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328836
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-21 13:22:22 +00:00
Kevin Lubick
ffad5d3b2d [canvaskit] Fix gm test runner on non-tryjobs
Bug: skia:10812
Change-Id: I5e859fe96bb0f0f78f5da658a2fa4f77324bb439
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328896
Reviewed-by: Eric Boren <borenet@google.com>
2020-10-21 11:31:27 +00:00
skia-autoroll
b432d0b757 Roll SwiftShader from df17a76102df to 84f5eeb6dd9b (3 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/df17a76102df..84f5eeb6dd9b

2020-10-21 amaiorano@google.com Fix Android build
2020-10-20 amaiorano@google.com Subzero: workaround bad codegen for Windows x86 at Om1 optimization level
2020-10-20 bclayton@google.com LLVM: Replace legacy ORC JIT with new API

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 egdaniel@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: egdaniel@google.com
Change-Id: I682f85372d031e86e59be446e9f4e7e1a25abb2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328881
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-21 04:56:01 +00:00
skia-autoroll
1f88bb9a23 Roll ANGLE from 2be35682cd67 to e2147a58a233 (40 revisions)
2be35682cd..e2147a58a2

2020-10-21 jmadill@chromium.org Add missing condition_variable include.
2020-10-21 syoussefi@chromium.org Vulkan: Support vertex attribute aliasing for non-matrix types
2020-10-21 jmadill@chromium.org Perf Tests: Add stdout printing arg to bot mode.
2020-10-20 cnorthrop@google.com Tests: Add Brawl Stars trace
2020-10-20 cnorthrop@google.com Tests: Add Arena of Valor trace
2020-10-20 geofflang@google.com Generate CONTEXT_LOST errors on every GL call.
2020-10-20 geofflang@google.com Add Queries and Setters for resource initialization state.
2020-10-20 courtneygo@google.com Vulkan: functionally complete worker thread
2020-10-20 jmadill@chromium.org Fix missing validation cache update on VAO binding.
2020-10-20 jmadill@chromium.org Suppress timing out GLES 31 tests on GL/Linux.
2020-10-20 syoussefi@chromium.org Vulkan: Pull generic SPIR-V transform functionality into base class
2020-10-20 syoussefi@chromium.org Vulkan: Remove dead path in clear
2020-10-20 lehoangq@gmail.com Metal: Auto detect parent layer's contentsScale change
2020-10-20 lexa.knyazev@gmail.com Metal: Skip redundant clamp of stencil ref value
2020-10-20 lehoangq@gmail.com Metal: Remove no longer needed precompiled shaders
2020-10-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 7e1825a59619 to 6fac705e7616 (6 revisions)
2020-10-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from f4f1d8a352ca to 3ead01191215 (2 revisions)
2020-10-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 7501f2454376 to 72a62c652dc1 (438 revisions)
2020-10-20 cnorthrop@google.com FrameCapture: Image Texture binding in MEC
2020-10-20 cnorthrop@google.com FrameCapture: Implement Gen/DeleteVertexArraysOES
2020-10-20 cnorthrop@google.com Perf tests: Bump replay ES version to 3.1
2020-10-20 cnorthrop@google.com FrameCapture: Fix GLSync creation for MEC on 64-bit
2020-10-20 jmadill@chromium.org Perf Tests: Call finish every step in calibration.
2020-10-20 cnorthrop@google.com Add ES 3.1 check to ValidateBindImageTexture
2020-10-20 jdarpinian@chromium.org iOS: Disable worker contexts, and use sized formats
2020-10-19 jdarpinian@chromium.org Build fixes for MacCatalyst
2020-10-19 jdarpinian@chromium.org No need to check for Catalyst in the iOS build
2020-10-19 jonross@chromium.org Disable TransformFeedbackTest.SwitchProgramBeforeDraw/ES3_OpenGL
2020-10-19 ynovikov@chromium.org Expand ProgramBinaryTest.SRGBDecodeWithSamplerAndTexelFetchTest skip
2020-10-19 jmadill@chromium.org Rename "NonLinear" to "SRGB".
2020-10-19 jmadill@chromium.org Rename "texelFetchInvoked" to "texelFetchStaticUse".
2020-10-19 j.vigil@samsung.com EGL: Implement EGL_KHR_reusable_sync
2020-10-19 jmadill@ad.corp.google.com Add isSRGB flag to angle::Format.
2020-10-19 geofflang@chromium.org GL: Update BufferGL to use ANGLE_GL_TRY.
2020-10-19 jmadill@chromium.org Test Runner: Disable watchdog when debugger attached.
2020-10-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 52c1a859d9eb to df17a76102df (4 revisions)
2020-10-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 5c64374dd6cb to 7e1825a59619 (7 revisions)
2020-10-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Headers from 04306fa5d673 to 320af06cbdd2 (1 revision)
2020-10-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 7e36b15b99a7 to 7501f2454376 (405 revisions)
2020-10-19 jiajia.qin@intel.com Add the ES31 status on d3d11 document.

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 egdaniel@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: egdaniel@google.com
Test: Test: FIFA Mobile MECTest: Test: LEGO MECTest: Test: Lots of traces were hitting thisTest: Test: TransformFeedbackTest.SwitchProgramBeforeDraw/ES3_OpenGLTest: Test: angle_deqp_egl_testsTest: Test: angle_perftest --gtest_filter="*arena*"Test: Test: angle_perftests --gtest_filter="*brawl_stars*"
Change-Id: If1fc65cc9b936d2258bea155ae26928fb6dbd5ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328879
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-21 04:53:06 +00:00
skia-autoroll
5128715f2c Roll Chromium from 60b90a0bfd24 to 4bdce889ea35 (441 revisions)
60b90a0bfd..4bdce889ea

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

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

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

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: egdaniel@google.com
Change-Id: Iad0ff6c82179b3d6be512f0d948d207e06609543
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328878
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-21 04:48:31 +00:00
skia-autoroll
41d4c65a33 Roll Dawn from c4593127cbdd to cca03ca6bfe9 (7 revisions)
https://dawn.googlesource.com/dawn.git/+log/c4593127cbdd..cca03ca6bfe9

2020-10-20 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 7156d3e3140b to 4f79c8405028 (1 revision)
2020-10-20 dsinclair@chromium.org Add algorithm include.
2020-10-20 jdapena@igalia.com IWYU: unique_ptr usage in ChunkedCommandSerializer requires including <memory>
2020-10-20 dsinclair@chromium.org Remove HOMEPAGE_URL from cmake project.
2020-10-20 dsinclair@chromium.org Use CMAKE_CURRENT_SOURCE_DIR for third_party/khronos.
2020-10-20 dsinclair@chromium.org Skip None paths when looking for modules
2020-10-20 cwallez@chromium.org CMakeLists: make DAWN_THIRD_PARTY_DIR an option.

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

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

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

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: dsinclair@google.com
Change-Id: If300b76c6fa9dfacbb5049237d37c39590e573ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328880
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-21 04:48:02 +00:00
Brian Osman
2d2f82c00a Always declare sk_FragColor in GLSL, even if unused
PLS and discard-only shaders are the only time this has an impact,
and it doesn't seem like a problem to have the declaration?

Removes one use of variable reference counts, which are going to be
refactored.

Change-Id: Idb8d06087eed56070252ee02dcf907bf0d24c5a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328796
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-10-20 21:13:31 +00:00
Ethan Nicholas
838d71d93f added SkSLNodeArrayWrapper
Not yet used as of this CL.

Change-Id: Ic82ab5e2e2ca17fb11c16e22cfa6b7ad5ff74c77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328657
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-10-20 20:21:11 +00:00
Mike Reed
d6e6a3c507 update dox for drawPaint
Bug: skia:7745
Change-Id: I3b43aa28349d8525f85f6caaf416659f90c9b285
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328816
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-10-20 19:48:11 +00:00
John Stiles
a1e2b41923 Wrap built-in symbol tables during inlining.
This is conceptually very similar to http://review.skia.org/328384, but
the inliner doesn't use `clone()` when it clones a node.

Change-Id: I7456b63687ce2f93a7980fb101dfc97e143a378f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328817
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-10-20 19:34:01 +00:00
John Stiles
82f373c0d7 Wrap built-in symbol tables when an IRNode is cloned.
After an IRNode is cloned, callers expect to be able to safely mutate
its SymbolTable, so it can't be left with a built-in one.

Change-Id: If658fd11ad580da552f9d689edeeed4c842b38c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328384
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-20 18:42:31 +00:00
John Stiles
5630abf527 Fix typo in class name.
Change-Id: I28b01a83960b6f7c8e715a817dc75a2408465a26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328658
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-10-20 17:49:31 +00:00
Robert Phillips
473a848200 Make GrFillRectOp::onPrePrepareDraws also call base class' version
and add a TriangulatingPathOp::onPrePrepareDraws shell.

Bug: 1108408
Change-Id: Ifc5e80c08ffaa47927d1691c0a8dd52db24adcd0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328597
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-20 17:35:42 +00:00
Adlai Holler
9ae860a9fe Reland "Remove GrContext"
This reverts commit 3172208ad0.

Reason for revert: Fixed issues

Original change's description:
> Revert "Remove GrContext"
>
> This reverts commit 2edf18d818.
>
> Reason for revert: breaking wasm-debugger
>
> Original change's description:
> > Remove GrContext
> >
> > Woo!
> >
> > Change-Id: Ifa3ff7e79c7048c2f1d808cc9705593d72886f08
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326436
> > Auto-Submit: Adlai Holler <adlai@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> Change-Id: Ie05bda5dad7fb5d369ebe579d2e009fdb99c0729
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326941
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I141a473439a2b444aac1944e434e8b48d9fda428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327217
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-20 17:20:51 +00:00
Robert Phillips
74ad27d9ef Rename some of GrThreadSafeCache's member variables
Cached vertex blobs are coming so the old 'view'-based names weren't helpful.

Bug: 1108408
Change-Id: Icf09182c8b71b511dad36e006e0f2129ee56635f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328557
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-20 17:11:41 +00:00
Adam Barth
130eef1c24 [fuchsia] Migrate to new zx::vmar::map method
This new method receives its arguments in the same order as the
underlying C system call. This CL should not change behavior.

Change-Id: I6fd1e497b19d38d1133b1b8187146b98131093a8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328624
Commit-Queue: Adam Barth <abarth@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Adam Barth <abarth@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-10-20 17:10:41 +00:00
Mike Klein
c49da0b519 upstream cl/337571894 with tweaks
Seems harmless to fall back to other SetupCrashHandler() options.

Change-Id: I2e7ce5dd72f391af88a57f4bd29831122fe784b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327893
Reviewed-by: Peter Foley <pefoley@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-10-20 16:22:01 +00:00
Robert Phillips
9dfc6d8735 Pull the triangulating path renderer's shape-space triangulation into a helper method
This functionality will also be needed in TriangulatingPathOp::onPrePrepareDraws

Bug: 1108408
Change-Id: I0bf3f3c14820b946f4c4bc738c55e7a5eb2e7ced
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328556
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-20 16:10:41 +00:00
Florin Malita
39fe8c86fa [svg] Parse text attributes
Convert font-family, font-size, font-style and font-weight to
presentation attributes, and add parsing utils.

Bug: skia:10840
Change-Id: I1acdb59bc95fe46e67ed0f499dd0732420016663
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328436
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-10-20 16:04:41 +00:00
John Stiles
1c823674d9 Clear the builtin status of SkSL nodes when they are cloned.
This has a slight ripple effect into Enum, as it was using the builtin
status as an indicator that the enum was shared with C++ code. This now
has a dedicated bool flag.

Change-Id: Id03efa902546775666acd031e6d57123e02b6c6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328381
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-20 15:53:41 +00:00
Adlai Holler
b270568f29 Almost remove GrContext
This is everything except for literally removing the class.

Change-Id: I2f16caf865d1bcf9c0f267aed73313c0676a73bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327222
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-20 15:52:01 +00:00
Kevin Lubick
4a4eead1aa [canvaskit] Make build docs more clear
Bug: skia:10573
Change-Id: I4142418f0f26859a7953dbeeb8c25fa176719f76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328598
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-20 15:51:40 +00:00
Jorge Betancourt
0e24265930 add new DemoActivity to showcase SkottieView xml loading and surface view backing
add resID source as SkottiveView xml attribute

Change-Id: I749dfd320ca0b75cb5fac2a4047442c1b198f07e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327676
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2020-10-20 15:33:11 +00:00
John Stiles
a80a3dc170 Fix frexp support in Metal.
Our Metal codegen assumes that out params are pointers, but Metal's
built-in frexp actually takes a reference for the exponent, not a
pointer. We now add in a helper function to translate.

Change-Id: I24686347d07151dd99a1ff1c43aff2b35c3181e5
Bug: skia:10762
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328387
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-20 15:31:31 +00:00
Kevin Lubick
bb9769fb21 [canvaskit] Add task driver for running GMs on WASM/WebGL.
This loads in the known digests from Gold, starts the test
harness (which runs the GMs using puppeteer) and then uses
goldctl to upload the results to Gold when finished.

This will fail (and should not be landed) until
https://skia-review.googlesource.com/c/buildbot/+/328156
makes it into goldctl and the cipd build.

Bug: skia:10812
Change-Id: I89e5cf188d8f2adeba4ff676525d9bfbdcb46d5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328380
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2020-10-20 15:25:30 +00:00
John Stiles
727f0cd54a Sort SkSL gencode enums by value, not name.
Change-Id: Iff707ae968b84609acde89ba94dec7a5d53c7525
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328576
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-10-20 15:11:01 +00:00
Michael Ludwig
3ed7cb5a8b Allow kNoCropRect to be referenced
This should fix the macOS fuzzer build.

Bug: chromium:1139725
Change-Id: I14090da4ee7d9d0a6e515b05c23c0a1e50ca4e5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328385
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-10-20 14:45:22 +00:00
Mike Klein
51dc28505f allow early returns
For posterity, here's my initial, wrong thinking:

    If we squint at "return foo" and read it as "result = foo; goto
    end_of_program", and then remember we can always skip forward jumps (and
    where's further forward than end of program?), early returns turn out to
    work just like a store.

The reason this is wrong is that by the time we reach a final return,
the entire mask stack has been popped back down to its original default
ffffffff (active) state.  But that return shouldn't override any prior
returns.  So that scheme isn't quite right.

Instead we accumulate the result by disabling updates to lanes that have
already returned.  By the time we're done, all lanes should have hit
_some_ active return, now asserted.

Bug: skia:10852
Change-Id: I27b05f04a60ff4a5f2fe5f59bf398c3f7224a41b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327457
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-20 14:33:31 +00:00
Robert Phillips
6cc9d8dd59 Better encapsulate creation & usage of triangulating path renderer's key data
We will need this functionality in TriangulatingPathOp::onPrePrepareDraws as well as at the
current locations

Bug: 1108408
Change-Id: I2a65f07f47a549531d84dbf2afd82ad9d9b35225
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328536
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-20 14:25:11 +00:00
John Stiles
607d36b829 Add a fBuiltin flag to FunctionDefinition.
This is useful because we can clone FunctionDefinitions without cloning
the matching FunctionDeclaration. The FunctionDeclaration will remain a
builtin, but the definition should be a malleable clone.

Change-Id: Icfc1e0855fb8fcd6914a5d657f5098986fcf19ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328396
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-20 14:21:01 +00:00
Kevin Lubick
13fa34606b [infra] Sync to latest infra repo.
This picks up a new version of the CIPD deps and a new helper for
writing task drivers.

Bug: skia:10812
Change-Id: I8b9b57acd4d8eee9cdea86008da1f3039af0cdc9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328496
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-10-20 13:56:41 +00:00
Brian Salomon
9f8ee0dbb1 Remove legacy SkImageGenerator YUV planes interface
Bug: skia:10632
Change-Id: Iaed6b51e03ef9023a74d77f3262104c1677c416f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327917
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-20 13:44:11 +00:00
John Stiles
4964300530 Improve gencode for inlined blend and composition functions.
Using `return` instead of assigning to the output color removes an
unnecessary temporary variable from the output.

Change-Id: Ica31e290f8745a7309ae32c7148516d2189308ea
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328386
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-20 13:01:41 +00:00
Kevin Lubick
cd74dfa477 [canvaskit] Add test harness for running all gms and getting output
The JS starts a web server and then uses puppeteer to load the html
page. The page will load the compiled JS+WASM to run the GMs,
calculate the md5 hash of the pixels using the exact same algorithm
as DM and then get those encoded as a PNG. The HTML then makes
a post request with that image data (assuming it's not an image we
have seen before) and keeps all the test results in a simple
JSON array.

The JSON array will be read in by a task driver in a followup CL.

Bug: skia:10812
Change-Id: I90e8ed42bd96ae11fa75ce84ef2ee1a97ab93d5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328378
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2020-10-20 11:54:23 +00:00
Kevin Lubick
a25c0619b5 [canvaskit] Make gm test wrapper not omit known pngs
We just make a global set of known png digests and expect that the test
harness will load this with the appropriate data.

Bug: skia:10812
Change-Id: I8e1fc987d36cc57386167410514803f8c3b90a69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328379
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-10-20 11:53:49 +00:00
skia-autoroll
38688fcdba Roll Chromium from cb9deed9f162 to 60b90a0bfd24 (436 revisions)
cb9deed9f1..60b90a0bfd

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

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

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

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: egdaniel@google.com
Change-Id: I9ed9cd8adec2603e5e6a7503a0234e9a70b9c065
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328458
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-20 04:51:00 +00:00
skia-autoroll
ac1ded0331 Roll Dawn from b1938273e405 to c4593127cbdd (14 revisions)
https://dawn.googlesource.com/dawn.git/+log/b1938273e405..c4593127cbdd

2020-10-19 dsinclair@chromium.org Include compiler header
2020-10-19 cwallez@chromium.org Roll third_party/swiftshader/ 2014e7b92..df17a7610 (79 commits)
2020-10-19 enga@chromium.org Fix unused variable warnings on ChromeOS
2020-10-19 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from c9a3e4739678 to 7156d3e3140b (1 revision)
2020-10-19 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 89042538376b to c9a3e4739678 (1 revision)
2020-10-19 enga@chromium.org Add missing include in SwapChainVk
2020-10-19 dsinclair@chromium.org Fixup cmake file
2020-10-19 enga@chromium.org Reland "Replace the wire serializer with a no-op impl on disconnect"
2020-10-19 jiawei.shao@intel.com Add the entry point of CreateReadyComputePipeline
2020-10-17 cwallez@chromium.org Initial new swapchains on Vulkan.
2020-10-16 enga@chromium.org Cleanup old/deprecated wire and native APIs
2020-10-16 cwallez@chromium.org Make wgpu::Extent3D default to {1, 1, 1}.
2020-10-16 cwallez@chromium.org Add wgpu::TextureComponentType::DepthComparison
2020-10-16 cwallez@chromium.org Format: Move the baseType to be per-aspect.

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

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

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

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: dsinclair@google.com
Change-Id: I627ff61ad7b12e7f832b9401c7a898c9f8aa1ef2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328457
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-20 04:31:30 +00:00
Greg Daniel
a670782ed3 Update GrAttachment budgeted and gpu memory size calculation.
This adds the budgeted parameter to the GrAttachment ctors. Currently
we only have stencil and msaa attachments which are always budgeted
but this will soon change as more things get added.

Along the same lines this fixes the gpu memory size calculate on
render target. The msaa attachment was getting double counted in
the RT and the attachment itself.

Bug: skia:10727
Change-Id: I3520de9627eadaa4074f7425df509a6c1ccbe07f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327337
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-19 17:54:10 +00:00
Chris Dalton
f1cd1553b3 Remove a redundant position assignment from stroke tessellation shaders
Bug: skia:10419
Change-Id: I74429ceb1fc03e68872c74eb62f64675e1bd55cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327476
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-10-19 17:34:30 +00:00
Greg Daniel
f5323d92ae Implement computeScratchKey virtual for GrAttachment.
Was missing this virtual so when we were registering attachments in the
cache we were never setting a scratch key on them.

Bug: skia:10727
Change-Id: Id505fcea17ed83b9f9f33739ded518adbcc2acb7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326440
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-19 17:14:09 +00:00
Brian Osman
2e25ff436a Directly compute call counts, rather than mutating state
This causes a ~4% regression on sksl_large, but some of that
can be bought back in two ways:

1) Removing (now unnecessary) cloning of program elements
2) Hoisting the new analysis passes, with (nontrivial)
   logic to update/maintain the call counts as we edit IR.

Also, this fixes bugs where we were emitting functions that
had "calls" from no-longer called functions.

Bug: skia:10776
Change-Id: I4f8c29957be2e4233a883c9a1125f363b82ee40c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327198
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-19 16:08:39 +00:00
Brian Salomon
c1a249d1dc Revert "Revert "New variant of SkImage::MakeFromYUVATextures.""
This reverts commit be8004d2fb.

Bug: skia:10632
Change-Id: I52dd36ae167623563c7554c40092442a3822ee3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327760
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-19 15:37:29 +00:00
John Stiles
bcd1fc030a Avoid changing built-in symbol tables during lookup.
Previously, we'd add UnresolvedFunction symbols wherever the original
FunctionDeclaration was found, but that can alter shared SymbolTables
(e.g. the root table) and the node will not be cleaned up when the
program is deleted. The pooling system expects that any node created as
part of a Program will go away when the Program does.

This change puts the UnresolvedFunction symbol as close to the
FunctionDeclaration as possible without changing builtin symbol tables.

Change-Id: I4c80cfba734047f11b50c86829d95d8e393c3060
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327921
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-10-19 15:15:29 +00:00