Moves the view matrix transformation onto the CPU (when local coords
are not used), and plumbs a color attrib through the tessellation
patches.
Bug: skia:12524
Change-Id: Ic4740048b4fc85cb18e7235a7754d57762db3daf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468997
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Indexing into a constant matrix is a constant expression, so we are
obligated to support it for ES2 compatibility.
Change-Id: Ibe1e5bac39d9a88ce0222997a38e8b6952fdb336
Bug: skia:12472
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469819
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: Ibeea56ebd5dce53af1252ca3ecf6cc6f010bd461
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469902
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We should support constant-expressions involving matrices (GLSL ES2
does, WebGL does). We currently don't. We do properly report out-of-
range indexing, but we don't optimize away valid matrix index
expressions or allow matrices to be indexed in a constant-expression
context.
Change-Id: If58aa4c5f15abef421a412957072f3617b4176df
Bug: skia:12472
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469818
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
When optimizations are disabled, the compiler flags this function as
exiting without returning a value (since it doesn't convert the ifs from
maybe-taken into definitely-taken).
Change-Id: I226d0f6ba8cc664aecf1c5afaaf03e92038185ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469821
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>
Lots of potentially messy changes.
Also includes a major recipe roll.
Bug: chromium:1256037
Change-Id: Id05779802c5ca05921d93fa73c21930723793585
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467980
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Previously, SkSL was unable to resolve the constant expression `x[y]`
for a constant-array `x` and a constant-integer-scalar `y`. Now, if `x`
and `y` are known, we can replace `x[y]` with the indexed array element.
Note that we need to be careful here, as it's not a valid optimization
to eliminate array elements that have side effects. We preserve side-
effecting expressions using the comma operator.
Change-Id: I5721337eb42b48c0b05f919c1cadfae19dd3b84f
Bug: skia:12472
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469839
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Previously, we didn't have tests which leveraged constant-evaluation of
array indexing (because we didn't support it), and our test files
commingled constant-indexing into vectors with constant-indexing into
arrays.
The test files now separate vector- and array-handling into separate
tests, and a ton of new cases have been added to ArrayFolding. The
ArrayFolding tests now require constant-evaluation of array indexing,
so they fail in this CL, but will be fixed in the followup CL.
Change-Id: I3b663e743d97d6db80627bc9b7808f88c99917a7
Bug: skia:12472
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469528
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Handle kColor_GradientType (which is returned by asGradient
for color shaders) as a straight color paint server.
Bug: skia:12622
Change-Id: I46fa21ed23a7824d67fc0460f92d649743e1b1f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469900
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
This is unnecessary - the child FPs don't pay attention to the input
color anyway. Simplify OverrideInput while we're here - no one uses it
in the specialized form.
Change-Id: I07cd7ccafd3451e0436b61362a7f2cecfd5633ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469896
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12630
Change-Id: Ie4d4d9a62b4152b8ce3ebb5edebfe9aab88a2a25
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469858
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Bug: skia:12625
Change-Id: I8ad737855f25df83c85d619d69b006ccbd83658d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469897
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is generally not a property of individual FPs in the shader tree,
it's a property of the root level FP, and how it applies alpha to the
color generated by the shader FP. So, two improvements:
1) Remove all of the coverage-as-alpha inhibition happening in
individual shaders.
2) At the root of paint conversion, if there's a shader FP (and no
primitive color), we either: use ApplyPaintAlpha, which *is* safe
with coverage-as-alpha (updated flags to reflect this), or disable
coverage as alpha (because our FP is now just generating a color and
ignoring incoming alpha).
Note that we *could* choose to ALWAYS use ApplyPaintAlpha, even if the
paint color is opaque. That could result in extra (useless) work in some
situations, but it would enable the coverage-as-alpha optimization far
more often than we get it today.
Also: We don't change the behavior when there is a primitive color,
because that code path is already disabling coverage-as-alpha, thanks to
OverrideInput.
Change-Id: I1f040ee1217cf03e731ad1b8b497dc8e4df2de2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469518
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
To pick up canary commit msg change in buildbot repo
Updated with:
$ go get go.skia.org/infra@553519b41e
$ go mod download
$ make -C infra/bots train
Bug: skia:12630
Change-Id: Iba6dc47dd014d690b54b017a2f9d4d597ecf0d97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469857
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Bug: skia:12466
Change-Id: Icf59f2412a66f3f339635014f4b1e4c44d3c1619
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469523
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
No longer necessary - incoming alpha is 1.
Bug: skia:11942
Change-Id: Idf94e9de95dd233a0559efec4ed50c79e3b2da2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469516
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Previously, this code assumed that IndexExpression::Convert had done
range checking and that it was safe to access the base expression at
the passed-in index. The inliner violates this assumption, because it
can replace unknowns (where out-of-range access is undefined but non-
fatal) with knowns (where out-of-range access is forbidden).
We now do range-checking inside IndexExpression::Make and report the
error cleanly, instead of asserting inside of Swizzle::Make due to an
invalid component index.
Change-Id: If0f31b1f694bcc2a875d124f70be311d6634c77b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469535
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
We only can guarantee that the positions are strictly monotonic. The
assert was testing that pos n+1 minus pos n would produce a positive
value which may not be true if the subtraction underflows.
Bug: chromium:1267605
Change-Id: Iaeff8f83f901f9b5af990cc866bfc24fb4af921d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469522
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Previously, a dangling type or function reference would be eliminated
silently with optimizations on, or would assert when optimizations were
off.
Change-Id: Ib2e273b6f069724e8872c9cb97351b647b875a62
Bug: skia:12472
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469525
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The ExpressionStatement currently eliminates dangling references without
reporting them as an error. This happens due to optimization; these
expressions (being meaningless) have no side effects, and so the
optimizer replaces them with Nop. When the optimizer is off, these
programs trigger an assert:
https://osscs.corp.google.com/skia/skia/+/main:src/sksl/SkSLAnalysis.cpp;l=582;drc=e7a953524787e3bd0c437ec52de4e40986689825
A followup CL will fix ExpressionStatements so that they report
incomplete expressions as an error.
Change-Id: Ica49166032e670749fc1b4e7a869fbab03364d4f
Bug: skia:12472
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469524
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
In some contexts, we rely on constant expressions to fold in order for
SkSL to work properly. (e.g. an array size is allowed to be any
constant-expression in GLSL, but the compiler really needs to know the
actual size). Previously, turning off optimization would break several
tests. Now, constant-expression folding always occurs even when the
optimizer is disabled.
Note that disabling the optimizer isn't an end-user option, so this
only affects internal usage.
Change-Id: I106ecb7e5bff3f7a8235cdccf0a7a60b48a97e2e
Bug: skia:12472
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469520
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This cycles the primaries, just like SkColorSpace::makeColorSpin.
Helpful for debugging more exotic color space issues.
Change-Id: I3434c7a9f24642f13be0ac3513599a15247d1f6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469360
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Fixes inconsistent results in other color types/spaces, where the output
can be negative.
Change-Id: I8a346cf7bb02cb298c11d658948c117d74b6ddaa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469359
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This CL focuses on removing the SkStrikeSpec from the GlyphVector.
Now the GlyphVector can use an SkStrike directly. This CL
is mostly a bunch of tricky plumbing.
Change-Id: I4eb8ccfc44d9e8b7f35578bf754c188a7fd55596
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469176
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This reverts commit 2ed7729180.
Reason for revert: Didn't help, introduced small regressions.
Original change's description:
> [MiddleOutPolygonTriangulator] Convert pushVertex(p0) to close()
>
> This is the pre-iterator behavior of MiddleOutPolygonTriangulator.
> It's slower, but may lead to better triangulations.
> We may or may not keep it, depending on Perf's opinion.
>
> Bug: skia:12620
> Change-Id: I46f39b551b32af4eebfe8221cbb48a4332db83a8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468096
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:12620
Change-Id: I58e7cc066540c594144f1e4d0cc1646051441af4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469230
Auto-Submit: Chris Dalton <csmartdalton@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
We had never set up the ModifiersPool here, so if the inliner tries to
make a scratch variable, it ends up accessing a null ModifiersPool and
crashing. I discovered this error by disabling optimization during the
initial loadModule call (during an unrelated experiment).
Change-Id: Ifa3e0007dc1dea02745d55a544b6ddd7b5a7c6de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469517
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>
Change-Id: Ia5da00913d0b96e9edc47f8b2274bd26c35c251c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469457
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
This enables stepping over function calls automatically.
Change-Id: Ie15ed745377d851cb7752f651b573efa2cc8195f
Bug: skia:12614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469077
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: NA
Though we set this variable, we never use its value. This causes a
warning in Android.
Change-Id: I84492fd97e8c6f23db7bf51c116d227551ae7a94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469358
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Previously, the for statement's "increment/test" expressions were
executed without moving the trace-line back up to the for statement.
When stepping through code, we will now explicitly step to the next/test
line on each loop iteration.
Change-Id: I5d9f005a42150670cec77218323cf932ee1cbdb0
Bug: skia:12614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469180
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This writes an entry to the trace buffer every time a slot value is
changed.
Change-Id: Iac3912be71ad654f70a7158e306e0643086c6cb0
Bug: skia:12614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469179
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12466
Change-Id: I1e92dcf66c117ca351cebf20722524672c88e5cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469178
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This is a reland of b61804e94c
Original change's description:
> Add ConvertPixels versions of PremulAlphaRoundTrip
>
> Prior to the force_highp trick, the GrConvertPixels version failed, just
> like the GPU would do if we disabled the canvas2D fast path. With the
> highp trick, all tests pass.
>
> Bug: skia:12592
> Change-Id: I63ad2fd3b67863b6a736316e7c7b3b9bd2ee8970
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467516
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:12592
Change-Id: I4c83c8d20959ab13cc493748a22fff5133706a77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468458
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>