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>
Change-Id: I9568deca0031d32bc1c6bdf1f11f6da76de6d07f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320075
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This halves the time needed for OOP-R/DLL-like rendering of the simpleblurroundrect GM (which has a whole column of blurred circles).
Bug: 1108408
Change-Id: I5fcfe618caed65ee97000eae446ce98003bec8d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320556
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Pre-req for allowing rendering to an externally created MSSA VkImage.
Bug: skia:9832
Cq-Include-Trybots: luci.skia.skia.primary:Test-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All-Vulkan,Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Release-All-Vulkan,Test-Win10-Clang-ShuttleA-GPU-RadeonHD7770-x86_64-Release-All-Vulkan,Test-Android-Clang-GalaxyS9-GPU-MaliG72-arm64-Release-All-Android_Vulkan,Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Release-All-Android_Vulkan,Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_Vulkan,Test-Android-Clang-Pixel4XL-GPU-Adreno640-arm64-Release-All-Android_Vulkan,Test-Android-Clang-P30-GPU-MaliG76-arm64-Release-All-Android_Vulkan
Change-Id: Ibf41944c6946dda7e27bdcd509ecd04976fc9ade
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320262
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Compilation of Metal shaders on 10.13 is unstable and keeps crashing
the bots.
Change-Id: If4e707b80a6ca20f989b504b5bab33c8b2dcaac6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320297
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ia5cf75d40234e53fcbf49b4c6af96fd66844267e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320273
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
The node's kind can be easily inferred by presence of a statement or
pointer inside of it. When there are only two kinds, having a separate
field doesn't add value. (If we end up wanting more block types in the
future, we could re-add fKind as a private field.)
Change-Id: I8e9db122b4a82728d987c4913a7bdff85b4b1a2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320298
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 is the second CL for isolating the Chrome
remote glyph cache API from the implementation.
See CL/320074 for the first CL, which handles
SkStrikeClient.
Pull out the rest of the tracing functionality.
Change-Id: I4d6aa4bf648a0d2d55cecedbe445a05c27e3a986
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320256
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Older versions of MacOS are unstable when compiling shaders, and we
don't have the testing support for older versions of iOS.
Bug: skia:10777
Change-Id: I95d9fe0f1007af6bec5c7525dacda565e32989f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320260
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
ninja 1.9.0+ exposes a bug in python shutil.copy2 where a copied file's
date is the src's date but rounded. This can cause ninja to think the
copied file is slightly older than the src and trigger unnecessary work
when building.
https://github.com/ninja-build/ninja/issues/1554
Change-Id: I53247453f38a1c98c5d832bdda0f68effbe786c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320261
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
When using offscreen draws, we save the "previous" frame in fLastImage
in viewer. However this image holds a ref to the GrContext. When we
were destroying the vulkan context we thought we were destroying the
GrContext before the VkDevice but fLastImage was keeping it alive.
This changes makes sure to reset fLastImage when we are done with it.
Change-Id: Ib70e069a261f939217436a9f052d7565581cd230
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320263
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
The right side of assignments will collapse redundant swizzles, but the
left side does not. Code like this can actually cause the ByteCode-
Generator to assert if it is run (it asserts in `swizzle_is_simple`
during code generation).
Change-Id: I891912fe0b5de2670dfa95f6702a86d5c42bb2ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320296
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 was adapted from a test in SkSLInterpreterOutParams and presents a
challenging double swizzle.
Change-Id: Icb7b3bbb18d4b3cfa0c26acb524c08812ba88096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319920
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>
We have options how to represent 8 Q14 values in a ymm,
mainly either in the 8 low 16-bit lanes or in the 8 even 16-bit lanes.
I've tried both and the even-lane approach is nicer:
1) many operations are the same for 32-bit or 16-bit
2) splat and splat_q14 constants can share the same pool
3) to_q14 and from_q14 are essentially noops
Interestingly, over in the interpreter we use dense 16-bit storage for
Q14 to operate most efficiently there, so we've kind of already proved
the thesis that each backend should have this flexibility.
Change-Id: I4d5a40159d46b6b24413087d0837128e6477752d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319335
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
All the interface classes in SkRemoteGlyphCache have too
many Skia types exposed during compilation. This is
causing c++17 compilations to fail. This is the first
of a few CLs to isolate Skia better.
In addition, remove the tracing functionality. I will
add it back when I need it again.
Change-Id: I5d4efe7aadb5e8be2a863784dbbe5398afb09666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320074
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Ideally the surface onto which a glyph is drawn will not affect the
glyph metrics. In order to do this the kGenA8FromLCD flag must be
respected by the scalar context so that requests for subpixel rendering
always produces subpixel rendering metrics but the subpixel mask mixed
down to non-subpixel rendering should the canvas not support it.
Not supporting this can cause odd behavior when measuring one way but
then drawing the other way.
Change-Id: Id08ffa14483b4650459a2f0351da2ffdea81e3c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319696
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
SkGlyphRect is a rectangle encoding specialized for
union and intersect. It will be used for calculating
the bounding boxes of glyph runs, and clipping glyphs
for GPU.
Change-Id: Icab826b51dc2254ee4006ada84f7fc09e112a933
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319697
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This allows dead-stripping to properly optimize away unreferenced clones
of intrinsic functions, and allows the inliner to detect intrinsic
functions that are only called once (which can generally always be
inlined without penalty).
Change-Id: I0cf034d880ae5d52f4cc0f93de6e2c7aad34e975
Bug: skia:10776
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320258
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 is a reland of 435b482638
inlineStatement now takes a `const Expression* resultExpr` instead of
`const Expression& resultExpr` because resultExpr will be null for a
void function.
Original change's description:
> Support out parameters that use a swizzle.
>
> This CL also removes the `VariableExpression` class that was briefly
> added in a prior CL. This class was intended to support cloning an
> expression while changing the refKind of a VariableReference inside of
> the expression, but it added state and complexity. In this CL, rather
> than track this via extra state, the inliner just recurses into the
> expression as needed to find its VariableReference. Since most relevant
> expressions are just a VariableReference anyway, this is inexpensive.
>
> Change-Id: Id4d926b7d7520b5e6ce455446c05a6d59ef62a84
> Bug: skia:10756
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319917
> Commit-Queue: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
Bug: skia:10756
Change-Id: I35f76c21eccf0ba2ab47e4313e131f7aa26980fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320223
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bug: chromium:1132739
Change-Id: I67b7ac535232925e98e44c0bb90964fded9f4d05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320068
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
In the operation of taking the bounds of (horizontal text) and then
drawing the text within those bounds it is necessary to draw the text at
the origin of the bounds and not at the left edge of the bounds.
Change-Id: I712e1713ca5e0be929b11f526f224141a5310cc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319776
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is just part of the occasional refactoring to slowly move all of
vulkan resource tracking to sk_sp instead of manual ref/unrefs
Change-Id: I2ed4d5bb4c6acfc89dc6d797019977e1c4bd5d1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320065
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit 435b482638.
Reason for revert: ASAN/UBSAN unhappy.
Original change's description:
> Support out parameters that use a swizzle.
>
> This CL also removes the `VariableExpression` class that was briefly
> added in a prior CL. This class was intended to support cloning an
> expression while changing the refKind of a VariableReference inside of
> the expression, but it added state and complexity. In this CL, rather
> than track this via extra state, the inliner just recurses into the
> expression as needed to find its VariableReference. Since most relevant
> expressions are just a VariableReference anyway, this is inexpensive.
>
> Change-Id: Id4d926b7d7520b5e6ce455446c05a6d59ef62a84
> Bug: skia:10756
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319917
> Commit-Queue: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@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: Ibdda47607f9e6e7f3a7459915067cf5e20919993
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320220
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Even when expanding clip ops were disabled, the max value allowed the
fuzzer to produce those disabled values. This should fix the fuzzer to
only produce valid intersect or difference clip ops.
Bug: chromium:1132687
Change-Id: I7368ff36a00e6b0e87ecbae5ba647d249299b9ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320064
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Now that ternaries are no longer supported for assignment (as per GLSL
spec), there's no longer any cases where an assignment can target more
than one variable reference at a time. Replace the output vector of
VariableReferences `assignedVars` with a single VariableReference,
`assignedVar`.
Also, allow callers to pass null for the ErrorReporter. This is useful
if inability to assign to an expression does not actually indicate an
error condition.
Change-Id: I146a9d1a488131ac5048c665e4dc880d895a275a
Bug: skia:10767
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319859
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This is too slow at the moment to run on the CQ (~50 minutes), but
metzman@ is planning on caching a bulk of the work needed before
we can compile the fuzzers.
Bug: skia:10713
Change-Id: I664b8afbdb9fa57a4bce3aa479ffce3c70b684ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317283
Reviewed-by: Eric Boren <borenet@google.com>
Subpixel and slight hinting also make a big difference.
Change-Id: I1b942caf20dbdcf8bebc3504695c673fbe7e4392
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319791
Reviewed-by: Ben Wagner <bungeman@google.com>
This CL also removes the `VariableExpression` class that was briefly
added in a prior CL. This class was intended to support cloning an
expression while changing the refKind of a VariableReference inside of
the expression, but it added state and complexity. In this CL, rather
than track this via extra state, the inliner just recurses into the
expression as needed to find its VariableReference. Since most relevant
expressions are just a VariableReference anyway, this is inexpensive.
Change-Id: Id4d926b7d7520b5e6ce455446c05a6d59ef62a84
Bug: skia:10756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319917
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Also add a skiplist to bypass a skp that is (hopefully temporarily)
timing out.
Change-Id: I912bd901a985ae86adfed13db102a1e7fee5686a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320060
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Swizzles in combination with out params are currently broken in SkSL.
They are fixed in the followup CL at http://review.skia.org/319917
Change-Id: I22d9436a15631e6ee2acf9fc312a8634cf3b5407
Bug: skia:10756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319918
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>