This CL improves on the previous fix for oss-fuzz:26789 by actually
propagating the negation from the PrefixExpression inside the
constructor, which unblocks further optimizations.
Interestingly, this fix also exposes a further missing optimization--we
optimize away comparisons of constant-vectors for floats, but fail to
do the same for ints.
Change-Id: I9d4cb92b10452a74db96ff264322cdc8a8f2a41f
Bug: oss-fuzz:26830, oss-fuzz:26789, skia:10908
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332263
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit 87bc83eaa6.
Reason for revert: breaking some platforms on tree
Original change's description:
> Add memsets to the GrBlockAllocator unit tests.
>
> These will verify that our blocks are actually set up properly--if not,
> we'll stomp over a sentinel word and/or trip an ASAN poisoned byte,
> causing the test to fail.
>
> Change-Id: I2dcb5b913d00c408f70c71f2660c6ec6017b452c
> Bug: skia:10885
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332260
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
TBR=brianosman@google.com,michaelludwig@google.com,johnstiles@google.com
Change-Id: I93abff1ead8430a233c18e9ff30c76192a090ab9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10885
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332545
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
These will verify that our blocks are actually set up properly--if not,
we'll stomp over a sentinel word and/or trip an ASAN poisoned byte,
causing the test to fail.
Change-Id: I2dcb5b913d00c408f70c71f2660c6ec6017b452c
Bug: skia:10885
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332260
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
The previous behavior leaked Skia-internal concepts into public SkSL.
Users coming from GLSL will expect that bindable/sampleable objects are
uniform (just like texture2D). This keeps the old support around (and
tested), but updates all of our examples to use 'uniform'.
Bug: skia:10679
Change-Id: I0c98162f5e21dad7014d9778ceb26143d2f6030e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332376
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This CL solves the fuzzer crash. Constant propagation of the negative
sign into the vector will be investigated in a followup CL.
This CL also adds a few cleanups into IRGenerator::constantFold.
Change-Id: If73a4fe2a5777265e7d43cc4f482653a38cb59af
Bug: oss-fuzz:26830, oss-fuzz:26789
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332261
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Change-Id: Ibc1a8d3ebbf62cc55d013f7d9146f6b155d11da2
Bug: oss-fuzz:26830, oss-fuzz:26789
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332377
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>
This ties the caps to the compiler instance, paving the way for
pre-optimizing the shared code. Most of the time, the compiler is
created and owned the GPU instance, so this is fine. For runtime
effects, we now use the shared (device-agnostic) compiler instance
for the first compile, even on GPU. It's configured with caps that
apply no workarounds. We pass the user's SkSL to the backend as
cleanly as possible, and then apply any workarounds once it's part
of the full program.
Bug: skia:10905
Bug: skia:10868
Change-Id: Ifcf8d7ebda5d43ad8e180f06700a261811da83de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331493
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Bug: skia:9000
This constructor is already declared; provide a definition.
Add a test.
Change-Id: Ic54ccffe0b1adf7c8c411e19a3fc9d825a5c9619
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331799
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Previously, temp variables created by sample() calls were named after
the offset of the sample() call within the code. This was
straightforward but would fail if the sample() call were duplicated via
inlining of helper functions.
FP sample() temp variables are now named using a counter, starting from
zero and counting upwards.
Change-Id: I16f9a3426117677c0df13d15772320def99cc0d6
Bug: skia:10858
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331415
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Previously, when a prototype was parsed, this added a function
declaration to the symbol table, but the prototype itself was not
re-emitted during code generation. This meant that the final code might
not be valid, since the absence of prototypes meant that the code might
attempt to invoke a function before its declaration. Now, prototypes are
stored in the ProgramElement list and re-emitted during code generation
for GLSL/Metal/CPP. (SPIR-V doesn't name its functions at all.)
Change-Id: I76446c796000eb0b56f964d82457122182c28b87
Bug: skia:10872
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331136
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
When eliminating a CFG node, we now flag its exit nodes; if our
optimization pass reaches one of those flagged nodes, we stop the
current optimization process in its tracks and initiate a rescan.
We do NOT recursively mark the exits of the exit nodes, so this fix is
reliant on the CFG being ordered in a non-chaotic fashion, but in
practice this seems to be sufficient for the CFGs we generate today.
Change-Id: I892805361c5f4297e02146f37a759dfda83f5488
Bug: oss-fuzz:26942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331597
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: Ief57d9c102b3c7658738920cdf54ccd4d21c5c5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331656
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Change-Id: I19a9564ac4d52b709b8fdd757b99222372c626f4
Bug: oss-fuzz:26942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331598
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>
This method is only valid in the range 2^(+/-30) due to fp32 overflow.
Adds a comment to the function and updates its test.
TBR=bsalomon@google.com
Change-Id: Ifa2fc0ed4a7f9123f0bebaa02c666c61e06e62a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331481
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This method finds the locations a cubic needs to be chopped at before
it can be passed to the stroke tessellation shader. It's an integral
part of CPU stroke preparation and therefore extremely perf sensitive.
Bug: skia:10419
Change-Id: Ib23c2583b8cfc78814ce52425f7af2c8b2f8b420
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330314
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Adds grvx, Ganesh's addendum to skvx. Here we introduce familiar names
and operations from GPU languages, as well as functions that are
approximate and/or have LSB differences from platform to platform.
The initial implementation has: fast_fma, fast_acos, and
fast_angle_between_vectors. When a function is approximate, its error
range is well documented and tested.
Also establishes GrWangsFormula as the first user of grvx.
Bug: skia:10419
Change-Id: Id0682599cf9c0303eff386095afc3ef9f3a7fa1b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330119
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
- Prototypes for never-declared functions
- Prototype before use
- Prototype after use
- A variety of inputs and outputs on the prototyped functions.
- Calling declared-but-undefined functions
Currently, the prototypes are not actually emitted in the generated GLSL
or Metal output at all. This CL is demonstrates our baseline before
proper prototype support is added.
Change-Id: I6112e0a89ab9bbecefccaca9fba985bb8011fff1
Bug: skia:10872
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331376
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We finally have a reference and derivation of Wang's formula, thanks to
tdenniston@. And it turns out that the formula we had been using for
cubics wasn't quite right. It was overly conservative for certain types
of curves.
This CL fixes the incorrect cubic formulas and adds a citation to the
"Pyramid Algorithms" book. We should now be getting by with fewer linear
segments.
Bug: skia:10419
Change-Id: Ib850c7b4d17b8d9f9abed800cc7cb5f074df6e17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331156
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This improves the test output for Metal. Previously, the Metal output
was just an error message, since 1D textures were unsupported. Now we
have a valid golden output for the 2D case in Metal. (1D is still
unsupported and is likely to remain unsupported; Skia currently has no
use case for 1D textures.)
Change-Id: I91977712030f08e371cc6bfb2afa578940ca00b7
Bug: skia:10797
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330940
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The triangulating path renderer can generate multiple triangulations of
the same path at different levels of precision. As previously
implemented the more precise triangulations would steal the unique
key from prior triangulations. This new callback will allow us to
replicate this behavior in the thread-safe cache.
Bug: 1108408
Change-Id: I8b445ca1e503b2fd78727a23d9376a2cf77f291c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330562
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Motivated by investigating
https://skia-review.googlesource.com/c/skia/+/330696
This CL does not fix anything, but is meant to better document
the current behavior.
Change-Id: I62b8cbfb39e05404f0f5303f024e1f56fc32b7e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330937
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
This error was caused by an unbalanced symbol table push. This could
occur when an interface block encountered an error while parsing its
var-decls.
Change-Id: I910a980ac92fac7c0786c48b8dc3003ee3e75e5b
Bug: oss-fuzz:26700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330896
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Also added unit tests for each of SkTArray's various constructors, and
added `SkTArray::value_type` which allows calling code to refer to the
array's value-type. These unit tests exposed some preexisting strict-
aliasing issues in SkSTArray when compiled on GCC 6+ with optimizations
enabled, which are being investigated separately at skia:10891.
Change-Id: Ia0fb18830cfbbdcb1545fe7f7ac51d8e768a3f94
Bug: skia:10891
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330279
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: Idfbe128978575ab84b54485bffe2d82570ee099f
Bug: skia:10870
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330620
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
(This CL also adds modulo to the IntFolding shared test, since this was
absent from the test. It's implemented and working properly already.)
Change-Id: I24a947ab38754bff2624cd5b58cf7a39553ca888
Bug: skia:10870
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330596
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>
This takes the "one pass" code path more often, using less memory, as it
does not have to allocate an intermediate width*height pixel buffer.
Wuffs v0.2 did not support RGB 565 color but Wuffs v0.3 does.
The Codec_AnimatedTransparentGif test passes with skia_use_wuffs true or
false.
Change-Id: Id569fc0bf62e614fa881cb235a9a6a1ca340dcb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329916
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
With the addition of vertex data to the thread safe cache we also have
to handle the case where a given SkPath becomes inaccessible and
proactively invalidate the matching entry.
Bug: 1108408
Change-Id: Id11ce2aa10517f7c0772a253634d3c0d13e13460
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330261
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Now that GrOps no longer needs a GrMemoryPool to be
deleted, just pass down the the SkArenaAlloc instead
of both the GrMemoryPool and SkArenaAlloc.
The alloc is only used for two ops, but we pass it
to all the ops most of which don't use it.
Change-Id: I873efcdfe44b446f2ac5089ea8425dff257e318c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330118
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This reverts commit 375721d7bb.
Some manual edits needed due to time elapsed.
Bug: chromium:1141332, skia:10566
Change-Id: Iadb15d3f5334d9eed4e7053e9c19d75a0bbeb9de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330196
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Change-Id: I93fdeaa3ea6be73619f82859bb53aa88fae3262b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329962
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
There's no functional change here; it's just using a slightly higher-
level abstraction to pass the same payload.
Change-Id: Ife7efa038db5d6dbde5decae2be79ad9db877aba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329782
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
GLSL requires that functions are declared before first use. In most
cases, we avoid the requirement for explicit prototypes by this by
strategically ordering our functions within the emitted code, but an FP
file might reference its helper functions in any order or have helper
functions that cross-invoke each other, so prototypes should be emitted.
Change-Id: I3b9e9c9ec4bd5be90b4f71f8165af45364facf30
Bug: skia:10872
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329781
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This is necessary to support function calls in FP files properly; in
some cases, functions can be referenced before they have been emitted,
and we need to be able to name them.
This CL resolves the remaining errors in GrRecursion.cpp. There are
still additional errors in GrNestedCall.cpp that will be fixed in
followup CLs.
Change-Id: Iec98ef02ea6a98a9945a4e0e3cfa3537dff01305
Bug: skia:10684, skia:10872
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329676
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We've given up on Abseil, and these warnings are annoying:
... libtool: warning same member name (libabsl.escaping.o) ...
Bug: skia:10165
Change-Id: I144573206174cbe9b48fce8e86ed22eb4a4e29b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329937
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Adds an SkChopCubicAt overload that performs two chops at once in
SIMD. Also updates SkChopCubicAt to accept T values of 0 and 1. This
has been the source of bugs in the past.
Bug: skia:10419
Change-Id: Ic8a482a69192fb1685f3766411cbdceed830f9b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327436
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
and flush out some non-substantive changes; namely:
whitespace changes
tweak what is stored in TessInfo
change createMesh to be CreateMesh
Bug: 1108408
Change-Id: Ife9a0e500b9f51db597350b0257b20efece03bdc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329633
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Introduce three calls on GrOp: Make, MakeWithExtraMemory,
and MakeWithProcessorSet. Instead of returning
unique_ptr<GrOp>, they return a type of GrOp::OpOwner.
GrOp::OpOwner safely deletes the op when it goes out
of scope for either new/delete or GrOpMemoryPool
allocations.
In order to make the code easier to refactor, I
eliminated MakeArg from the helpers.
Change-Id: Icfd697906f3147a8734575d08bd7195e7517383a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323778
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Previously, we'd just emit functions with `%s` in their function bodies.
Also, the fFormatArgs wouldn't get cleaned up, so subsequent code would
fill in the wrong format arguments in each place.
There are still problems with function calls (`sample` is broken;
function names are accessed before they've been declared or initialized)
but this is a step in the right direction.
Bug: skia:10684
Change-Id: I7399a71d44ebba5049703484ec9933dffbe8e2b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329417
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
`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>
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>
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>
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>
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>
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>
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>