Commit Graph

51452 Commits

Author SHA1 Message Date
John Stiles
312535b47d Create sksl_small nanobench test.
This is the standard no-op shader that Viewer uses to blit the software
rasterizer's back-buffer to the screen. It modulates against white and
samples a texture using an identity matrix.

This gives us a realistic best-case-scenario test. `sksl_tiny` is too
small to be a realistic test (although it's a good data point to show
our ultimate speed-of-light).

Change-Id: Ic697cb1301752574ab63a9a0d7b07a0ff81c3a88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329476
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-24 13:05:11 +00:00
John Stiles
071934570a Reduce the SkSL pool size to 512 nodes.
This is large enough to hold sksl_medium in its entirety; sksl_large
overflows somewhat, but it's still much better than nothing.

Change-Id: Ief22a94cc7f554ecc289905e9ccc20594eab6819
Bug: chromium:1141863
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329456
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-24 13:03:51 +00:00
Robert Phillips
375e1f6a64 Add unit tests for vertexData in the thread-safe cache
Bug: 1108408
Change-Id: Ia984324d559bb33bfe668a44ee93c6e39fc47685
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329419
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-23 23:21:56 +00:00
Ben Wagner
9abf719e67 Remove code guarded by SK_LEGACY_SURFACE_PROPS.
This removes the last of the SkFontHost LCD globals and the
SkSurfaceProps::kLegacyFontHost_InitType.

Bug: skia:3934
Change-Id: Ic2342a3ea3dbcd075d6817cbd3fc27274e376b8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329364
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-10-23 22:41:36 +00:00
Chris Dalton
58a26a8362 Fix the formula for fNumRadialSegmentsPerRadian in GrStrokePatchBuilder
GrStrokePatchBuilder had the wrong formula. This CL moves the formula to
GrStrokeTessellateOp and calculates it in one spot for the builder and
tessellator both. It also fixes a bug that was hiding behind this
formula error and updates some variable names.

Bug: skia:10419
Change-Id: I908d3960b16cac8dca0d40ff4116a3f5c5beed06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328416
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-10-23 22:09:46 +00:00
John Stiles
8744a5c820 Add unit test for nested function calls in FP files.
`func1` and `func2` emit bad code, `return %s()`, and because they don't
consume their `%s` format argument. This leaves the format argument list
unbalanced and all future args are wrong.

Another serious problem is that we don't actually know the names of the
functions that they need to call, because we haven't emitted them yet.

`func3` is not emitted at all. Sampling from a fragment processor
apparently fails in this context.

This is a more general case repro for skia:10684--it turns out that
recursion in particular wasn't the issue, but nested function calls just
don't work properly at all in FP files. This wasn't an issue in practice
because we don't have any existing FP files which nest function calls,
and the inliner also tends to aggressively flatten everything out if we
don't explicitly disable it.

Change-Id: Iff029c459c7d90be566f9b4c9be0e3150e459866
Bug: skia:10684
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329367
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-23 21:07:36 +00:00
Mike Reed
65dc579f13 Show cubic made up of 2 quads
Change-Id: Iafc2e6c23c8fa8a69424d7c42dfb4d2c59e1ea08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329420
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-10-23 21:03:45 +00:00
John Stiles
80f240a3d3 Revive SkSLFPTestbed for basic verification of CPP/H codegen.
This brings back the basics from SkSLFPTest.cpp. This file was removed
entirely in http://review.skia.org/319029 but, in retrospect, it's still
a good idea for dm to verify that CPPCodeGen and HCodeGen can do their
jobs. And, like SkSLGLSLTestbed, this gives us a good place to attach
the debugger in dm for testing CPP/H-specific code generation bugs.

Change-Id: I514192bacd63021708dbd02a0276a3d55a43195f
Bug: skia:10684
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329370
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-23 20:32:35 +00:00
Robert Phillips
42a741a214 Allow vertex data to be stored in the thread safe cache
Bug: 1108408
Change-Id: I4d51b9c837fad435c7a3e6823390b519b785631b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329363
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-23 18:08:05 +00:00
Jim Van Verth
7c64798b3d Add control to toggle immediate/delayed MTLDrawable acquisition
Change-Id: Ia1b57dc4af65e7625659c147077b5e47b09b6b62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329178
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-10-23 17:30:15 +00:00
Kevin Lubick
acdc283404 [canvaskit] Use portable fonts for GMs
This adds an Init() which should be called before any resources
are loaded or GMs/Tests are called.

This also adds a little helper in compile.sh for building only
a single GM, which can make local development faster given the
fact that emsdk doesn't do its final compilation/linking in
parallel.

Bug: skia:10812
Change-Id: I1a8932549b9ae951c153c0d49927bdc933c29657
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329358
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-10-23 17:04:48 +00:00
John Stiles
530933006d Add unit test demonstrating recursion codegen bug.
The generated code does not assign to sk_OutColor correctly; it assigns
into the `factorial` function name instead, which doesn't make sense.

Change-Id: Ibad1d47f2f9c4fbb410b5277cea6e1022daf8b9d
Bug: skia:10684
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329360
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-23 16:33:15 +00:00
John Stiles
9cef66fbf5 Fix use-after-free discovered by fuzzer.
In cases where multiple variables were declared on a single line, it is
legal for variable initialization-expressions to reference variables
declared earlier in the var-decl statement. It is NOT legal for the
inliner to move those references up to the previous statement, where the
variable doesn't exist yet.

This is mitigated by disabling the IRGenerator inliner for var-decls
past the first one in a var-decls statement. (The optimizer will still
pass over this code later and is able to inline it correctly, if it is
worth doing.)

Change-Id: I7a0d45eab20e30ed9f6b2f5c1251b6e0d8eeaea3
Bug: oss-fuzz:26167
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329357
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-10-23 16:10:15 +00:00
John Stiles
15d8174fc9 Add unit test for self-referential initializer expressions.
These don't compile in GLSL, so they shouldn't compile in SkSL either--
and fortunately, they do not.

(In C++, and consequently in Metal, these expressions are considered
legal by the grammar and do compile, but generate garbage output.)

Change-Id: I6c7bea70b3d91677ccd8fcbad1eba123d655e856
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329359
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-23 14:36:05 +00:00
skia-autoroll
58cf3fe83b Roll Dawn from 22505a5afe1f to ade9a5235c73 (2 revisions)
https://dawn.googlesource.com/dawn.git/+log/22505a5afe1f..ade9a5235c73

2020-10-22 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 8f7c80347dc6 to 88d705dc85ff (1 revision)
2020-10-22 cwallez@chromium.org SwapChainVk: handle mismatching size and usage with a blit

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: I4129c68c903dc645410184dd3ec602861258b5bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329213
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-23 05:06:35 +00:00
skia-autoroll
075c527877 Roll SwiftShader from e02d8938821a to 8012e62471be (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/e02d8938821a..8012e62471be

2020-10-22 srisser@google.com Update VkStringify to use vulkan.hpp to_string

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: I51ebb431c2b26293be1511c4baa47418ecae2e51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329215
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-23 05:01:45 +00:00
skia-autoroll
3718e300e2 Roll ANGLE from d74754378f09 to 097f307e75a4 (10 revisions)
d74754378f..097f307e75

2020-10-23 courtneygo@google.com Vulkan: Fix segv referencing contextVk
2020-10-22 ianelliott@google.com Add run-time check in EVENT() to disable debug markers
2020-10-22 sugoi@chromium.org Allow rendering to half float in ES2 contexts when possible
2020-10-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 72a62c652dc1 to 8832c373d22b (1033 revisions)
2020-10-22 cnorthrop@google.com Revert "Tests: Add FIFA Mobile trace"
2020-10-22 syoussefi@chromium.org Vulkan: Validate SPIR-V transformer at link time
2020-10-22 xiaoxuan.liu@arm.com Fix end2end tests VertexAttribute* failure
2020-10-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Loader from 970c132746b1 to 91ce213a1d88 (3 revisions)
2020-10-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 84f5eeb6dd9b to e02d8938821a (3 revisions)
2020-10-22 lexa.knyazev@gmail.com Vulkan: Fix invalid clamping of ES3 clear stencil values

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: angle_perftests -v --local-output --gtest_filter="TracePerfTest.Run/*nba*"
Change-Id: I3f65f226706d20c20d49de995e96614a9d6df407
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329214
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-23 04:54:15 +00:00
skia-autoroll
734a27a2f3 Roll Chromium from 502ec4ce30b3 to e47bf15edfc4 (424 revisions)
502ec4ce30..e47bf15edf

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: I44ab1b7a82d3e7b5242e5bf7a1348cdf286e1865
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329212
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-23 04:47:15 +00:00
John Stiles
2d68ea3fbf Allow SkSL compilers to reuse SkSL Pools without reallocating.
When a Program is freed, rather than immediately disposing of its Pool,
it now sends it to Pool::Recycle, which holds onto it. If Pool::Create
is called, it satisfies the request by simply handing back the recycled
pool. Only one pool is kept in recycle storage at a time--recycling
more than one pool in a row will cause all but one to be freed. To avoid
holding onto Pool memory indefinitely, pool recycle storage is cleaned
up whenever a Compiler is destroyed.

Change-Id: I21c1ccde84507e344102d05506d869e62ca095a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329175
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-22 22:46:14 +00:00
Tyler Denniston
53281c7121 [svg] Add current node to render context
A couple of render-time decisions require knowledge of object bounding
boxes, such as gradients (whose default coordinate space is
"objectBoundingBox". This CL adds the current node being rendered to the
render context so that it can be accessed down-stack (for example, when
gradients are being resolved and added to the paint as Skia shaders).

Each node will overload the bounds computation, for now it just returns
empty bounds for all nodes. TBD if we want to cache bounds somewhere,
either inside the node object or in a separate cache.

Bug: skia:10842
Change-Id: I40061ffedcb840e4dd28dba6351421f5b4fc904b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329221
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-10-22 21:01:04 +00:00
Ethan Nicholas
01b05e5b83 moved SkSL Switch data into IRNode
Change-Id: I0373cccfd3acc56417f8d1545bbe7320dc2dfa05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327256
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-22 20:44:04 +00:00
John Stiles
060503ec27 Use SkMutex in SkSL.
Change-Id: I1b14e4c8de0ca60a0ebbdbc225befc5074e8de22
Bug: skia:10862
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329177
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-22 19:47:00 +00:00
Ethan Nicholas
cdeae8c0cc added SkSL OptimizationContext
This simplifies the signatures of several methods and makes it easier to
ignore errors we have already reported.

Change-Id: I767ca22a66e69fe72557c2560ef84f5dbe339eb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329220
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-22 19:33:10 +00:00
Kevin Lubick
65674e4c2e [canvaskit] Compile in most gms for testing
The few we omit fail to compile or link.

Bug: skia:10812
Change-Id: I660d64b6f9bfe63949a12506d29e9a8d73898e6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328377
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-10-22 16:44:07 +00:00
John Stiles
0bb9ec5437 Reland "Add pooling support on iOS."
This reverts commit f73091bb81.

Reason for revert: rolling forward after fixing prior CL

Original change's description:
> Revert "Add pooling support on iOS."
>
> This reverts commit 38a93e622b.
>
> Reason for revert: need revert first pool change
>
> Original change's description:
> > Add pooling support on iOS.
> >
> > This replaces the `thread_local` attribute with `pthread_setspecific`
> > and `pthread_getspecific`. I don't have easy access to iOS 8/9 for
> > testing purposes, but on Mac OS X, this implementation works and
> > benchmarks the same as the `thread_local` implementation.
> >
> > Change-Id: I86db88c24d59d946adb66141b32733ebf5261c76
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328837
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> TBR=brianosman@google.com,adlai@google.com,johnstiles@google.com
>
> Change-Id: Ic06f9e32e524b2be601ee21a5da605fd19aaa64b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329164
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I0e021e9304ee88d6a29739c287eb515abff8b8a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329173
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-22 16:38:40 +00:00
Greg Daniel
4fd41ffd54 Fix asserts for npot tiling in gl.
Change-Id: Iadbb0f85f929bf846f5ba03809b298b1d9d03786
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329172
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-22 16:07:30 +00:00
John Stiles
5c7bb326a7 Reland "Create a basic IRNode pooling system."
This is a reland of e16eca95f5

This fixes the no-op (iOS) implementation of CreatePoolOnThread.

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>

Change-Id: I8623a574a7e92332ff00b83982497863c8953929
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329171
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-22 15:56:00 +00:00
Greg Daniel
f15a598ab0 Revert "Reland "Create a basic IRNode pooling system.""
This reverts commit 5b09e6a007.

Reason for revert: breaking g3

Original change's description:
> Reland "Create a basic IRNode pooling system."
>
> This is a reland of e16eca95f5
>
> 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>
>
> Change-Id: I114971e8e7ac0fabaf26216ae8813eeeaad0d4a2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329086
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

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

Change-Id: Ie77a23366f2ba52fcbb0a751d11ca2792790a30c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329165
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-22 14:07:45 +00:00
Greg Daniel
f73091bb81 Revert "Add pooling support on iOS."
This reverts commit 38a93e622b.

Reason for revert: need revert first pool change

Original change's description:
> Add pooling support on iOS.
>
> This replaces the `thread_local` attribute with `pthread_setspecific`
> and `pthread_getspecific`. I don't have easy access to iOS 8/9 for
> testing purposes, but on Mac OS X, this implementation works and
> benchmarks the same as the `thread_local` implementation.
>
> Change-Id: I86db88c24d59d946adb66141b32733ebf5261c76
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328837
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

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

Change-Id: Ic06f9e32e524b2be601ee21a5da605fd19aaa64b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329164
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-22 14:04:02 +00:00
Brian Osman
bd70be614f Add much better SkTHashMap visualization to Skia.natvis
No-Try: true
Change-Id: I48a1722778931175c2d828171c40cc5ee4a7677e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329162
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-22 14:02:42 +00:00
Kevin Lubick
d1b4d34e99 [fuzz] Copy crashing outputs before failing
Also try to avoid lots of purple timeouts until
https://github.com/google/oss-fuzz/issues/4548
is fixed

Change-Id: I6a98352b3f5a583a137f915a4c3adf6954a35777
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328989
Reviewed-by: Eric Boren <borenet@google.com>
2020-10-22 14:01:33 +00:00
John Stiles
38a93e622b Add pooling support on iOS.
This replaces the `thread_local` attribute with `pthread_setspecific`
and `pthread_getspecific`. I don't have easy access to iOS 8/9 for
testing purposes, but on Mac OS X, this implementation works and
benchmarks the same as the `thread_local` implementation.

Change-Id: I86db88c24d59d946adb66141b32733ebf5261c76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328837
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-22 13:58:40 +00:00
Jim Van Verth
f3ec9833e8 Fix storage class issues for push constant variables.
Change-Id: I433159717b831e9dbfc251c38687572bdc45c959
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329037
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-10-22 13:17:45 +00:00
skia-autoroll
6c5f7774fc Roll SwiftShader from 84f5eeb6dd9b to e02d8938821a (3 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/84f5eeb6dd9b..e02d8938821a

2020-10-21 bclayton@google.com LLVMJIT: Fix memory leak
2020-10-21 natsu@google.com Update SwiftShader VK AHB to support generic gralloc
2020-10-21 amaiorano@google.com Fix when built against latest LLVM (11)

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: Ib6bd1f706a046151ad03296a3b4a6eeee2eea484
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329137
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-22 04:56:39 +00:00
skia-autoroll
cfb559ca30 Roll Chromium from 4bdce889ea35 to 502ec4ce30b3 (465 revisions)
4bdce889ea..502ec4ce30

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: I9cd4b877eb1b5ba95c4c0e5a5e8d70b0176bedc4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329136
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-22 04:50:45 +00:00
skia-autoroll
4af942c5f5 Roll ANGLE from e2147a58a233 to d74754378f09 (16 revisions)
e2147a58a2..d74754378f

2020-10-22 syoussefi@chromium.org Vulkan: Support vertex attribute aliasing for matrix types
2020-10-22 cnorthrop@google.com Tests: Add FIFA Mobile trace
2020-10-21 cnorthrop@google.com Tests: Add KartRider Rush+ trace
2020-10-21 syoussefi@chromium.org Vulkan: Faster check for vertex attribute aliasing
2020-10-21 cnorthrop@google.com Tests: Add Marvel Contest of Champions trace
2020-10-21 sugoi@chromium.org Revert "Allow rendering to half float in ES2 contexts when possible"
2020-10-21 geofflang@google.com GL: Use ANGLE_GL_TRY when setting pixel pack and unpack state.
2020-10-21 sugoi@google.com Allow rendering to half float in ES2 contexts when possible
2020-10-21 geofflang@google.com Expose glGetTexLevelParameter{if}v before ES 3.1.
2020-10-21 jmadill@chromium.org Test Runner: Command line sharding args override env.
2020-10-21 jonahr@google.com Disable TransformFeedbackTest.NonExistentTransformFeedback*
2020-10-21 jonahr@google.com Add dlopen_fuchsia.h as exception in export_targets.py
2020-10-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from 3ead01191215 to ea52b3c2d270 (3 revisions)
2020-10-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from df17a76102df to 84f5eeb6dd9b (3 revisions)
2020-10-21 m.maiya@samsung.com Vulkan: Add OES_shader_multisample_interpolation extension
2020-10-21 cnorthrop@google.com Tests: Add Free Fire trace

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: TransformFeedbackTest.NonExistentTransformFeedbackVaryingWithGLPrefix:/ES3_OpenGLTest: Test: angle_perftests --gtest_filter="*fifa_mobile*"Test: Test: angle_perftests --gtest_filter="*free_fire*"Test: Test: angle_perftests --gtest_filter="*marvel_contest_of_champions*"Test: Test: angle_perftests --gtet_filter="*kartrider_rush*"
Change-Id: Idfcee8951a97ac68849a899254c0793e94784404
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329118
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-22 04:50:39 +00:00
skia-autoroll
f645f0e6f3 Roll Dawn from cca03ca6bfe9 to 22505a5afe1f (9 revisions)
https://dawn.googlesource.com/dawn.git/+log/cca03ca6bfe9..22505a5afe1f

2020-10-21 enga@chromium.org Fix systemName output on Mac/iOS
2020-10-21 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 0ce070474164 to 8f7c80347dc6 (1 revision)
2020-10-21 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 4f79c8405028 to 0ce070474164 (1 revision)
2020-10-21 dsinclair@chromium.org Update type for atomic.
2020-10-21 cwallez@chromium.org Dawn infra: update the primary branch to "main"
2020-10-21 cwallez@chromium.org Trivial grammar fix in README.md
2020-10-21 hao.x.li@intel.com Query API: Record used query index in command encoder
2020-10-21 dsinclair@chromium.org Update WGSL struct syntax.
2020-10-21 jiawei.shao@intel.com Add the entry point of CreateReadyRenderPipeline

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: I0af44d5f4ce2c9bee7c2d0ec0904805947b99b00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329117
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-22 04:45:39 +00:00
John Stiles
5b09e6a007 Reland "Create a basic IRNode pooling system."
This is a reland of e16eca95f5

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>

Change-Id: I114971e8e7ac0fabaf26216ae8813eeeaad0d4a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329086
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-10-22 02:38:18 +00:00
Florin Malita
385e74470f [svg] Add support for preserveAspectRatio
This fixes the aspect ratio for pretty much all tests.

Since we're going to rebaseline everything, also have dm use a white
background (to match other user agents).

Bug: skia:10842
Change-Id: Iab2afd61560af540539c216d1c3673f19fe0fe51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328982
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-10-21 22:10:33 +00:00
John Stiles
e51b6a3da6 Pop the symbol table if compilation fails.
This fixes a potential leak of the symbol table. (The leak would
eventually resolve itself once the IRGenerator were destroyed, but it
does outlast the compilation step.)

Change-Id: I6b2e303f00a3331fccbd8421a5173defd352f022
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328985
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-21 20:44:53 +00:00
Kevin Lubick
bffc116a4a [canvaskit] Load resources into wasm gms/unit tests.
To load in the resources, we have the Node JS script
find all files in the provided resources directory and serve
that as a JSON file (the HTML JS can't list files easily).
The HTML JS reads that file, then loads all those files as
ArrayBuffers.

After the testing WASM and the resources all load, we pre-load
them into the WASM memory, assigned with their name. This is
just a map of name -> SkData. The WASM code can't (easily)
make fetch calls, so rather than load these resources on demand
like we would in a real file system, we pre-load them all
and serve them from RAM. For simplicity (and consistency with
the known_hashes), this map is a global.

Finally, to connect the resources to the GMs, we overwrite the
gResourceFactory (defined in ResourceFactory.h) which is used
by tools/Resources.cpp to load any resource file (in theory).

One more change is to write some progress steps to window._log
so it can be read by puppeteer and dumped to disk to aid in
debugging.

Bug: skia:10812
Change-Id: Ie22c7f4b8d7cbbd18173b4e2ed755105c1b45249
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328901
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2020-10-21 20:40:29 +00:00
Greg Daniel
292f7777da In Vk don't set dynamic blend constant on Pipeline if we don't use it.
We already don't call the dynamic update for the blend constant if it's
not used. This change makes it so we don't even tell the VkPipeline
to have support for a dynamic blend constant. This allows the driver
to make the pipline objects slightly more optimal.

Change-Id: Ib7ea4e0ec7eeb8e7c1cf165d426ee863fa0a3a00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329036
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-21 20:34:13 +00:00
Tyler Denniston
ab76ab40d3 [svg] Add gradientUnits attribute, value, and parsing
Specifying gradientUnits will allow gradient coordinates to be specified
relative to object bounding boxes, as seen in test 'coords-units-01-b'.

Not yet used with this CL.

Bug: skia:10842
Change-Id: I6038cf3995a94c7e3a7ac73ad8305872353a403c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328977
Reviewed-by: Florin Malita <fmalita@chromium.org>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-10-21 20:00:43 +00:00
Julia Lavrova
f857a87d64 Underline decorations with gaps and no text
Bug: Skia:10822
Change-Id: I5ab2f743fe2837070065954bc6f5ba930292f0c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328596
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-10-21 19:43:33 +00:00
Brian Salomon
5e961b0cb9 Reland "Perform bounding rect-relative calcs in full float in GrRRectBlurEffect"
This reverts commit 07829f27ec.

Reason for revert: actually looks like skp gone good

Original change's description:
> 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>

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

# Not skipping CQ checks because this is a reland.

Bug: chromium:1138810
Change-Id: Ic061849c410f43411d03972cdfadc5f0610efe6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328907
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-10-21 19:07:33 +00:00
Brian Osman
9cf9930724 Add several more visualizations to Skia.natvis
The default visualizations of shared and unique ptr are customized,
but in a way that requires an extra indirection. 99.9% of the time,
the other data is irrelevant, and people just want to treat it like
a raw pointer, so make that the default.

Added correct visualization of some SkSL types (StringFragment!),
fixed a bug in the SkAutoTArray visualizer, and added a few things
to make SkTHashMap a little bit better. (Still not great, but at the
point of diminishing returns).

No-Try: true
Change-Id: I62cec14bac921b04fc41685cc2527d280e883394
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328911
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-21 18:53:25 +00:00
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