OpenGL docs specifically insist that the sequence (comma) operator
should not be treated as a constant-expression so that attempts to
declare multidimensional arrays with a comma will fail:
http://screen/vJEpAe9yNmbzZTm
(See "12.43 Sequence operator and constant expressions" in the OpenGL
ES3 documentation or read skia:13311 for details.)
In practice, we don't get much benefit from optimizing away unused
comma-expressions; it improves some synthetic tests, but realistically
this will not help Skia in any real-world scenario. The constant folder
no longer attempts this optimization, and comma-expressions are now
rejected in a constant-expression context.
Change-Id: Ic5dea6ff90e36614b548c1ce89a444e81da944ae
Bug: skia:13311
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539565
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Previously, this slide used a bunch of code to render a gray ramp. My
first impression was that the test slide was broken, but this was the
actual intent. We now use the shaders.skia.org zoomy-neurons.
Change-Id: Icd08462e30ab328b533525d74fa6064bccb76e8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539202
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Most shader text displayed in SkSL mode is passed through, exactly as
written--comments and all--and is unaffected by the optimization
setting. However, runtime effects go through the pipeline stage which
can subject them to optimizations. This is unexpected in "SkSL" mode,
where the goal is to display the shader as close to the original input
as possible.
Now, when Viewer displays a runtime effect in "SkSL" mode, it will not
have optimizations applied (other than some basic stuff like constant
folding, which is currently non-negotiable in SkSL).
Change-Id: I9bd3d8f7067d7124b3fbe88e8a422212b645597a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539200
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This includes using SkNoPixelsDevice for the GlyphTrackingDevice
in the SkChromeRemoteGlyphCache because it is the only thing that
uses SkGlyphRunPainter outside of GPU.
Change-Id: Id22e538b2c1aa0d65433878e428c9465fe222d12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539558
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
GLSL/SkSL allow creation of a uniform scale matrix by constructing a
matrix with a single scalar argument. It will be splatted across the
matrix's diagonal.
Change-Id: If3410909f8136f3f4c39f7d7208d5bd6066e4e53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539047
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Looks like really old drivers struggled with weird no-op blocks.
Change-Id: Ie32754a9c221eb7c20924ee27e5facca7e9701f0
Bug: skia:13309
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539561
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The conceptual meat of this change is that instead of taking a local-to-
device scale factor and the local stroke width, CalcNumRadialSegments
now takes the approximated device-space stroke radius. The main benefit
of this is that hairlines can be defined exactly without needing to
invert the local-to-device matrix or otherwise estimate a local-space
radius that would transform to the 1px hairline. The actual math for
regular strokes remains the same (scale factor * radius), but is moved.
In addition, this CL fixes a bug I had introduced in
https://skia-review.googlesource.com/c/skia/+/502059/
where I had not realized the CPU code operated on stroke *width* and the
GPU code operated on stroke *radius*, so updating them to use the same
equations w/o changing their inputs actually caused us to overestimate
the number of radial segments required. With this change, both the CPU
code and GPU code operate on stroke radius.
Between that bug fix and simplifying the hairline stroke radius math,
I am expecting lots of slight AA changes around stroked paths.
Lastly, I entirely removed the StrokeTolerancesBuffer, which was a class
that buffered up calculations of CalcNumRadialSegments by looking at the
entire list of paths in an op and putting them into a 4-lane SIMD
function instead. This isn't currently available for Graphite and makes
it harder to consolidate the radial segment calculations. Locally I
found no noticeable difference in the patch writing microbenchmarks
(where it would be more significant), and somehow the motionmark SKPs
were actually a touch faster. I'm hopeful that we can drop this
complexity and not take a large performance hit.
Bug: skia:13056, skia:13012
Change-Id: If16103078ebe9e4e60470445c0868deb3904f7de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/537239
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
The fuzzer found a subtle bug where our line vs. rect clipping could
produce points outside of the rect. Thanks to floating poing inaccuracy,
the first (horizontal) clip would produce a point just outside the
bounds. Then, we'd re-clip against the vertical segments - but go back
and start from the original points. Again, thanks to floating point,
we'd produce a point just outside the bounds.
The fix here is straightforward: After we've done the first clip
(reducing the magnitude of the values involved, and constraining the X
coordinates), use *that* as the new endpoints for the second clip.
Mathematically this is identical (the tmp values are new upper bounds on
the extents of the final endpoints after the first clip), but the math
is more stable this way.
Bug: chromium:1320467
Change-Id: I9c816110edb2944544243f2ad89665d5bc5c9c53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539196
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I2a1fedbbaabd57e4546c2a628f6d297e11f4244b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539318
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This CL define a const label string in GrDrawOpAtlas and have the
constructor accept it. This will help us to label atlas.
Bug: chromium:1164111
Change-Id: I6e194b9a59b940b359887736df27c1da130b1d8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539136
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is just a cascade of changes from removing the (unused) 'flushTimeOpsTask' parameter from SurfaceDrawContext::Make.
Change-Id: Ia92dfada8df007761d9de3c16e6a9c8850c3d399
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539066
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This made sense when literals were spread across multiple classes
(FloatLiteral/IntLiteral/BoolLiteral). Nowadays we can just call
Literal::Make and pass the Type that we want our literal to be.
Change-Id: I54ce5fcf7bcadac4be1fe10a358b9c86c234de8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539397
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We will continue to fold expressions like `10 + 0` or `5 * 1` or
`PI * 1` (assuming PI is a const float) because both sides are known,
but non-constant-expressions like `x + 0` (assuming x is not a constant)
or `foo *= 1` will be left as-is when the optimizer is off.
This improves the accuracy of the Viewer shader tab, because a runtime
effect expression like `color *= scale` will be preserved in the final
output when optimization is off, instead of being replaced with a Nop
when scale equals one.
Change-Id: I218b327cb0cd12654dca446dee8a5baa96f589b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539197
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We were already running unit tests twice--once with inlining on, and
once with inlining off, but always with optimization on. Now, the two
passes are instead "inliner + optimizer both on" and "inliner +
optimizer both off". (Testing the full 2x2 matrix of possibilities seems
like overkill.)
Change-Id: I73fb0932877c7b953c1f2e122125e5e7781a8582
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539396
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Fixes a minor issue discovered by http://review.skia.org/539198 .
Change-Id: I63f555cc005df33ce50c412796a8c773a501d271
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539199
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Previously we didn't have any mechanism for disabling the optimizer when
building golden outputs, so every golden output always had optimizations
applied.
Change-Id: I8f370b06daab6cb50bb4339eab0d39578621413b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539198
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Some APIs have been const-ified.
Change-Id: I08699f219944057bd730d3f7a5f5466cdd829233
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539064
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 167e608bb3.
Reason for revert: breaking Housekeeper-CheckGeneratedFiles
(fetch-clang-format)
Original change's description:
> [infra] Remove old python scripts and urllib2 references
>
> I was searching for urllib2 while resolving issues with
> https://skia-review.googlesource.com/c/skia/+/538636
> when I found several old, apparently unused scripts.
>
> Rather than fix them, let's get rid of them. If they
> are still in use, the conversion to urllib.request is
> pretty easy.
>
> Change-Id: I27d419601e81c93a3d53e280188a379dfab927c4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538936
> Auto-Submit: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Ravi Mistry <rmistry@google.com>
Change-Id: I139a3cd070da2e6fee2f8865138cf6a63441a8cb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539201
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This comment fell out-of-date when the Graphite modules were added.
(I had tweaked it slightly at the time, but had missed some other places
that talked about injecting static code snippets.)
Change-Id: Ibbdf5ce14b8c77393f9da2ee22c82001e3bfd6c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539045
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Make it easier to figure out READ_FAILURE is reporting a problem.
Bug: chromium:1287356
Change-Id: I3962932aed5c55efc2ded941cf218e5a8e75e972
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539044
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
https://dawn.googlesource.com/dawn.git/+log/9483b741a884..be0abb611aed
$ git log 9483b741a..be0abb611 --date=short --no-merges --format='%ad %ae %s'
2022-05-09 dawn-autoroll Roll ANGLE from e316203a6a2f to 78d88796b44b (1 revision)
2022-05-08 dawn-autoroll Roll ANGLE from 225d8f83af71 to e316203a6a2f (1 revision)
2022-05-07 dawn-autoroll Roll SwiftShader from 00efa1913863 to 1dd93361b1d9 (1 revision)
2022-05-07 dawn-autoroll Roll ANGLE from cadb933fdb12 to 225d8f83af71 (2 revisions)
2022-05-07 dawn-autoroll Roll vulkan-deps from e13072c54977 to 626b2fd72bde (2 revisions)
2022-05-07 dawn-autoroll Roll SwiftShader from 74e34ab97aeb to 00efa1913863 (2 revisions)
2022-05-06 dawn-autoroll Roll ANGLE from 1d5d09e4191a to cadb933fdb12 (14 revisions)
2022-05-06 dawn-autoroll Roll vulkan-deps from 4957ae734445 to e13072c54977 (21 revisions)
2022-05-06 dawn-autoroll Roll SwiftShader from 62c1af08ea4d to 74e34ab97aeb (5 revisions)
2022-05-06 bclayton tint: Rename and move builtin_table and builtin-gen
2022-05-06 bclayton dawn: Fix clang warning treated as error
2022-05-06 zhaoming.jiang dawn: Add shader module validation for WGSL extension
2022-05-06 dawn-autoroll Roll ANGLE from 2ce60b52a239 to 1d5d09e4191a (10 revisions)
2022-05-05 jrprice Surface Vulkan validation messages in errors
2022-05-05 bclayton tint: Change all ProgramBuilder literals to 'i' or 'u' suffix
2022-05-05 dawn-autoroll Roll ANGLE from 9865ed8b8117 to 2ce60b52a239 (4 revisions)
2022-05-05 bclayton tint: Castable - support non-default-constructable return types
2022-05-05 dawn-autoroll Roll SwiftShader from 2e793ae08002 to 62c1af08ea4d (1 revision)
2022-05-05 amaiorano tint: add --overrides flag to specify pipeline overrides
2022-05-05 pkasting Fixes for C++20 support.
2022-05-05 bclayton tint: Add Bitcast helper
2022-05-05 bclayton tint: Fix CFI error in BlockAllocator
2022-05-05 dawn-autoroll Roll ANGLE from 9053a641bf5d to 9865ed8b8117 (1 revision)
2022-05-04 senorblanco OpenGLES: disable some end2end tests which require reading from depth textures.
2022-05-04 bclayton tint/reader/spirv: Generate 'i' suffixed literals
2022-05-04 bclayton tint: Merge [S|U]intLiteralExpression
2022-05-04 dawn-autoroll Roll SwiftShader from 643179694ec7 to 2e793ae08002 (1 revision)
2022-05-04 bclayton tint: Lex three types of integer literal
2022-05-04 dsinclair Enable more `gn check` results.
2022-05-04 dawn-autoroll Roll ANGLE from 84e42c3b04da to 9053a641bf5d (12 revisions)
2022-05-04 bclayton webgpu-cts/expectations.txt: Remove expectations that now pass
2022-05-04 amaiorano Disable angle dependency on wayland
2022-05-04 bclayton tint: Chromium-style fixes
2022-05-04 jamessliu2020 AST fuzzer: Change unary expression operator
2022-05-04 dawn-autoroll Roll SwiftShader from c75846ead9a0 to 643179694ec7 (3 revisions)
Created with:
roll-dep third_party/externals/dawn
Change-Id: I6656ab41573ce465e9ced94ad65731be9bc5dafe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538716
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
The comments in this shader are copied from
719239cd69:src/gpu/ganesh/gradients/GrGradientShader.cpp;l=806.
We could also link to that code in the comments themselves if that would
be helpful.
Bug: skia:13302
Change-Id: I8f0733bd02d519c603f62612b5299b6d1d56792a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538416
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: James Godfrey-Kittle <jamesgk@google.com>
Change-Id: I4643cc4c1f75deab279625e752b9fee7da2e2779
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539039
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This simplifies the bot script slightly. More importantly, it means that
local developers don't need to remember to do this when building ANGLE
on Mac.
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-ANGLE
Change-Id: Ia60cd07f15e3b447b58cfa1198ea26f68f72384b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539036
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Use if constexpr so that tracing code does not bit rot.
Change-Id: Ib85f79b53c6a48bb1b80a51e5539dbdf077802d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538898
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
I was searching for urllib2 while resolving issues with
https://skia-review.googlesource.com/c/skia/+/538636
when I found several old, apparently unused scripts.
Rather than fix them, let's get rid of them. If they
are still in use, the conversion to urllib.request is
pretty easy.
Change-Id: I27d419601e81c93a3d53e280188a379dfab927c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538936
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Simplify the fields used by each, and simplify the CTORs in
the original SkGlyphRunPainter.
TODO: come up with a better no gpu method. Eventually, this
should be pure Sk. There is no need for GPU to make and
serialize a slug only to draw them.
Change-Id: I446fe0c285ae778a14b30e09c8a2cff3cd1a56c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538896
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Move the SubRun buffers from the Paint to the Builder that is held
by the Canvas. This allows better sharing of the buffers, and enables
splitting the Painter into CPU and GPU.
Change-Id: I860441732b4042be0534af3d002d63ece02de8c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538662
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
In theory all glyph representations including masks, paths and drawables
should keep a reference to the SkStrike which owns the actual data they
refer to. For paths this is worked around by always creating a copy of
the path (which is inexpensive) which itself simply reference counts the
underlying path data which is not directly owned by the SkStrike. For
masks it is impractical for every mask to hold a reference to the
SkStrike in any event as the pointer alone would often be larger than
the image. For drawables the implementation may be simply a pointer to
the scaler context and a glyph id. In theory each drawable could hold a
reference to the SkStrike, but potentially means a lot of references
when ensuring the SkStrike outlives any drawables it produces would be
more effecient.
This change ensures that the SkStrike is referenced while holding
references to drawables the SkStrike produced.
Bug: chromium:1322902
Change-Id: I6db8ae1bd614167da008caaff089e7d3e15aa9bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/537980
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Isolate the buffers to move them from the Painter, where they are
situated on the Device(CPU) or SurfaceDrawContext(GPU), to the
Canvas. This will allow better sharing of the buffers, and the
splitting out of the CPU and GPU parts of the Painter.
Change-Id: Ie2a99dc7f9e784c4f00012b71ece5ff482687a88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538660
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Now that the painter has moved from a GlyphRun to a GlyphRunList,
handle the buffers at the GlyphRunList level only.
Change-Id: I37416c8b2164bbde207ecab0a77b419775d58e66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538659
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Also updates a script with 2to3 to be python3-compatible.
Change-Id: I45981349664aef4491e7ab20e49889d461f8bf3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538417
Commit-Queue: James Godfrey-Kittle <jamesgk@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Bug: skia:13263
Change-Id: I29e04ccc88a9ff2286c82302740e404aeba1b740
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534669
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>