The SkRasterClip on DeviceCM appears to be unused and just increased the
size of that struct. Now the clip is tracked on the MCRec or within
SkBitmapDevice itself.
This adjusts the reserved size for DeviceCM to match (as reported on my
machine), and moves it into an anonymous namespace.
Change-Id: Ifa8635f839fc3d75339a64c9378ee054fe0cc071
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321250
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Avoids double call of release proc on failure.
Bug: skia:9832
Change-Id: I517c010376ba73f6d98c95f3453c8b0f9a5a299a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321461
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: Ib97cbf2e20580d3b9e54a5ffe793013ec97d4892
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321539
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>
Part of this change is to move some of this static format information
off of GrCaps since it is not cap dependent in anyway. This allows us
to the need for caps in many places. Also changes the low level format
query to be based off of bytes per block so it can be shared for
compressed and non compressed formats.
This change will also make it easier to add stencil/depth formats in
follow on change since we don't have to fill in a whole caps
FormatInfo block just so we can get the bytesPerPixel which is all
they need.
Bug: skia:10727
Change-Id: I2e6fdabf3ed699b4145ef9e6f0a73078d32a0444
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321463
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit 135e237656.
No-Tree-Checks: true
Change-Id: I7e9dd2148f7b2a8dee1e49a9a9cc593e0d7ceb6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321460
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Instead of being passed separately.
Check sample count in various onWrap methods in GrMtlGpu.
Bug: skia:9832
Cq-Include-Trybots: luci.skia.skia.primary:Test-iOS-Clang-iPhone8-GPU-AppleA11-arm64-Release-All-Metal,Test-iOS-Clang-iPhone7-GPU-PowerVRGT7600-arm64-Release-All-Metal,Test-iOS-Clang-iPadPro-GPU-PowerVRGT7800-arm64-Release-All-Metal,Test-iOS-Clang-iPhone11-GPU-AppleA13-arm64-Release-All-Metal,Test-iOS-Clang-iPhone6-GPU-PowerVRGX6450-arm64-Release-All-Metal,Test-Mac10.15-Clang-MacBookAir7.2-GPU-IntelHD6000-x86_64-Release-All-Metal
Change-Id: If5813db95b07f5d272e80920486f461cc5a587fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320956
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Maybe a hair faster for OOP-R/DDL-style rendering of the shadow_utils GM.
Bug: 1108408
Change-Id: If8827f7a765b8fc231f7a37178b7a12dc78357ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321159
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
No discernable perf improvement for OOP-R/DDL-style rendering of the matrixconvolution* GMs.
Bug: 1108408
Change-Id: Iea016feb2a8a0e5303a64ee8166c3ef089bb2649
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321137
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Using return statements generates better code when there are no early
exits.
Change-Id: I18edd49991324aaf1473b614261862d273eac541
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321237
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Similar to the same field on Enum and FunctionDeclaration, will be used
to facilitate cloning builtin variables into Programs that use them.
Bug: skia:10589
Change-Id: Ic63701c61ee4658a5ec72adb506cc96aa0b2836f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321196
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Makes it simpler to call methods that update the internal ref counted
state.
Change-Id: Iecefab2c14ff13eae2fa34eafdcc7e031b3c85b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320957
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
By using `return` directly instead of creating a temporary `_output`
variable, we generate less code and simplify the final GLSL output.
In the case of OverrideInputFragmentProcessor, the ternary expression
is performed on a `layout(key)` bool and will always be optimized away.
Before:
vec4 _10_ConstColorProcessor_Stage1_c0;
{
vec4 _12_output;
_12_output = ucolor_Stage1_c0;
_10_ConstColorProcessor_Stage1_c0 = _12_output;
}
After:
vec4 _8_ConstColorProcessor_Stage1_c0;
{
_8_ConstColorProcessor_Stage1_c0 = ucolor_Stage1_c0;
}
Change-Id: Ic3fd446345aa73e3936d1759443b80b41f5468f0
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320962
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
For mipmaps, the texture view we need depends on the mipmap mode. In
particular, for mipmap "none" mode, we need a view which ignores
everything but mip 0. So remove the persistent one.
Change-Id: I37a5e8a299edf423b67fd85135d6fbd9d26e62a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320636
Commit-Queue: Stephen White <senorblanco@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Android is turning on a flag which zero's all malloc calls for security
purposes. Since allocations with sk_malloc_flags are potentially very
large, and this flag is known to regress some HWUI usecases, disabling
this initialization for graphics buffers (which we know will get filled
anyway).
Bug: 131355925
Test: removes large hwuimacro regressions w/ heap initialiation
Change-Id: I7ae11b075f88d03c0a9709928ad7bbbc3b04f73f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320266
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Steven Moreland <smoreland@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Change-Id: If2b1e8f89730bfff9e08c1ff5f5cb02c16088d86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321117
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>
This, maybe, yields a slight perf improvement for the blur_matrix_rect
GM but, regardless, is good form.
Bug: 1108408
Change-Id: I6d589cc0f08f4264419ab33f27ac5a503cd036e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320933
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The X and Y values of `clampedCoord` were being calculated and stored
separately, even in cases where work could easily be done in tandem.
Updated the code so that we use .xy when it makes sense to do so.
This CL is a partial re-attempt of http://review.skia.org/318436 but
changing only one variable instead of three.
Change-Id: I8cab3c2225e1d95bc77371f85d46ab45a184e145
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321116
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We don't need to create a temporary variable for expressions like
`half3(x)`.
Change-Id: Ie0fa6a6dfb3d77d4372f96c676d3081f7e278852
Bug: skia:10786
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320960
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Previously, this would only return kClippedOut if the draw didn't
intersect with the device bounds. Now takes into account the bounds of
any identified single rrect/rect clip element and reports kClippedOut
if the draw does not intersect the element.
This fixes the bug identified in flutter where draws would appear outside
the clip. Within the problematic drawPoints call, each segment would turn
into a separate rect to draw, and if the rect was fully outside the clip,
it would incorrectly pass preApply and then not get cropped properly since
it didn't actually intersect the crop rect.
This only presented as a bug when SK_DISABLE_NEW_GR_CLIP_STACK was defined
(the current behavior for flutter). The new GrClipStack preApply already
reported kClippedOut in this scenario.
Bug: https://github.com/flutter/flutter/issues/66719
Change-Id: Idd810efcce4dfb6b51745d4a7a2ea66de9d4f46b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320965
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This allows us to traverse a program's hierarchy and make changes (as
long as the structure remains intact). It's the caller's responsibility
to make sure they don't invalidate any iterators of the ProgramWriter.
Change-Id: Icfc651134d916e19b92004c92fe09880bb96600b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320717
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Since we are now referencing the exact methods instead of calling
GetProcAddress, there is no need to cast the function pointers. This
also catches a bug where the emscripten signatures for glWaitSync and
glClientWaitSync did not match the OpenGL API.
Change-Id: If365a8f6090961cb4b44146d87e102430bc5b30f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320659
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
The "sksl_huge" test has been renamed to "sksl_medium."
Added a new "sksl_large" test which contains a dithered gradient shader.
Change-Id: Ia8488460022008ae4efecb5593f01db06c1c283f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320827
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit dd33b3ea90.
Change-Id: I348b2b5976966a7451d88bd7f96ce17ce1702b79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320826
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Remove separate constructor arg from GrBackendRenderTarget.
Add appropriate checks in onWrap functions in GrD3DGpu to limit to
previous functionality.
Bug: skia:9832
Cq-Include-Trybots: luci.skia.skia.primary:Test-Win10-MSVC-Golo-GPU-QuadroP400-x86_64-Debug-All-Direct3D,Test-Win10-Clang-ShuttleA-GPU-RadeonHD7770-x86_64-Debug-All-Direct3D
Change-Id: Ieba398d4bc00d18fdb0adffcda81f1a166db24b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320757
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
For instance, `foo[0].x` is now considered trivial to inline. It
combines two trivial cases: array-indexing by an int literal, and a
swizzle.
Change-Id: Ibb3ca1f324bbee0e9b3556e66644923fc9e0cf45
Bug: skia:10786
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320768
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 6877f0bfdc.
Reason for revert:
../../src/sksl/SkSLDehydrator.cpp:423:31: error: no member named 'fExpression' in 'SkSL::ExpressionStatement'
this->write(e.fExpression.get());
Original change's description:
> moved SkSL ExpressionStatement's data into IRNode
>
> Change-Id: I11b1662cd58b01fabba75dbbee40267a62c8b420
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320639
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: Id22b8a9c93e842b2775e11f5d4c173e25860b5d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320824
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit 4cf00a814f.
Reason for revert: ANGLE and Mali 400 unhappy.
Original change's description:
> Make GrRRectBlurEffect use the thread-safe uniquely-keyed view cache
>
> This yields a ~8% performance improvement on OOP-R/DDL-like rendering of the simpleblurroundrect GM.
>
> Bug: 1108408
> Change-Id: I1ec9477dffe870e5973f8a334a65b1013a4ca3dd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311720
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com,adlai@google.com
Change-Id: Ib7135a2244b956d1a5d06c12a2b4c2ce398b9db2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1108408
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320817
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The following types of expression are hoisted directly into the
inlined code:
- Struct field access: `myStruct.myField`
- Swizzles: `myVector.xzy`
- Simple array indexes: `myArray[0]`
This significantly reduces the number of temporary variables generated
by the inliner.
Change-Id: Ifed226ecc87b096ec1e38752c0c38ae32bd31578
Bug: skia:10737, skia:10786
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319919
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit ff22910286.
Change-Id: I86619819aae169a2cb8d59ad7ccecf26423f2aa9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320764
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
This yields a ~8% performance improvement on OOP-R/DDL-like rendering of the simpleblurroundrect GM.
Bug: 1108408
Change-Id: I1ec9477dffe870e5973f8a334a65b1013a4ca3dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311720
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This yields a ~30% performance improvement on OOP-R/DDL-like rendering of the simpleblurroundrect GM.
Bug: 1108408
Change-Id: Ic6c3fde53831cfeb61169681c8aaa77f657cae73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320656
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 98503f1c57.
Reason for revert:
../../src/sksl/SkSLDehydrator.cpp:513:28: error: no member named 'fTypeName' in 'SkSL::Enum'
this->write(en.fTypeName);
~~ ^
../../src/sksl/SkSLDehydrator.cpp:514:56: error: no member named 'fSymbols' in 'SkSL::Enum'
AutoDehydratorSymbolTable symbols(this, en.fSymbols);
~~ ^
../../src/sksl/SkSLDehydrator.cpp:515:62: error: no member named 'fSymbols' in 'SkSL::Enum'
for (const std::unique_ptr<const Symbol>& s : en.fSymbols->fOwnedSymbols) {
~~ ^
Original change's description:
> moved SkSL Enum data into IRNode
>
> Change-Id: I0de52d252715b5f4e10c26ebca3ea1a4f728ea2e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320637
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: I2b78dd5acf4277765b36776a8fb8e435f8b18861
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320759
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I0de52d252715b5f4e10c26ebca3ea1a4f728ea2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320637
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:10785
Change-Id: I01708af63d7e2ffc160022074ea9ff2b3c69eab5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320638
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is basically timing the rehydrator, but is helpful in conjunction
with heap usage if a client wants to decide to throw away a compiler
that they don't anticipate using for some amount of time.
Change-Id: Ie9b27d9a3b7667b5492d870f242cdafd00784708
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320617
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>