Bug: skia:13173
Change-Id: Ifbcce77605dd781563568293fc501dfa31f143da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528706
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:13118
Change-Id: Iab67fd1148182fdd29a38b69f27c51b13942a2b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532400
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Remove code suppressed by SK_IGNORE_COLRV1_TRANSFORM_FIX and
SK_IGNORE_COLRV1_SWEEP_FIX as these flags are no longer used on the
Chromium side and the respective tests were rebased there.
Bug: chromium:1316318
Change-Id: Ic3235524e366688067310f489919bbbaa9a8a094
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532056
Auto-Submit: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This makes part of of our testing infrastructure (i.e., the GMs)
compatible with Graphite's more stringent requirements.
Bug: skia:12701
Change-Id: I5e42d93050eccc1e455f46e07b64654ad3d4548c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531997
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
For lines with very large floating point coordinates, Wang's formula
doesn't actually return a value close to 0, even though the exact math
should for lines encoded as (a, 2/3a+1/3b, 1/3a+2/3b, b).
Since PatchWriter assumes the lines only need one segment, it doesn't
evaluate Wang's formula for lines. When the GPU re-evaluates Wang's
formula for a cubic that happened to come from a line, it can then have
a significant over estimate in the number of segments required if the
coordinates are really large.
This has been mitigated by GrStrokeTessellationShader uploading the
max edge count as a uniform so that the over-estimate is then clamped
back to a more reasonable value. By switching to (a, a, b, b), the
cubic is still visually a line but can be inspected quickly in the
shader and just skip evaluating Wang's formula entirely. This means
we will always use a single segment, and we unblock later changes that
let us remove the max-edge-count uniform from the stroke tessellation
shader.
It is possible that we could add the new trait and shader detection
logic to the fill curve and wedge shaders, but they aren't susceptible
to this because they don't rely on sk_VertexID to reconstruct 't'.
Bug: skia:12703, skia:13056
Change-Id: I95324a70d6429fef74d8abfaf6adaf95480a0879
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532014
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
* Move Rectanizer classes to a shared location
* Have GrDrawOpAtlas store SkColorType and explicit bytes-per-pixel
instead of GrColorType.
Bug: skia:13118
Change-Id: Ib5c3d79394c89dce7f06e8eddf09a5f6a9543a7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531320
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
It's time to better organize //third_party/BUILD.bazel
This CL starts by moving the "third party" stuff we closely own.
Change-Id: I3e0be0044b790794e94f34af6202860ce0a7b7aa
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531999
Reviewed-by: Ben Wagner <bungeman@google.com>
For now, the hierarchy of module dependencies is hard-coded into
dehydrate_sksl.py. (It is already hardcoded into SkSLCompiler.cpp, but
not in a way that is easily accessible to sksl-precompile.)
sksl-precompile now takes one output and an arbitrary number of inputs.
The inputs are processed from right to left, layering their symbol
tables as we go. e.g., sksl_frag is compiled like this:
sksl-precompile sksl_frag.dehydrated.sksl sksl_frag.sksl sksl_gpu.sksl
At present this doesn't change anything, because every module is
written in a standalone fashion (since nothing else was allowed). I've
demonstrated that these changes actually work as intended in a
followup example CL (not meant to be submitted).
Change-Id: Ifac638537f77b4a9c78b8cd94a6c4efd4bad01cc
Bug: skia:13164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532197
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
In a followup CL, we will have new ProgramKinds: `kGraphiteFragment` and
`kGraphiteVertex`. These accessors will add support for the new kinds.
Change-Id: I3fec7a8c02c56a855b7b33dd8c5b7e05263d5f1d
Bug: skia:13110
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532258
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Bug: skia:13171
Change-Id: I6dffb98ac2464f930995cf8ea57e422091d20fd2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531743
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This pattern was repeated several times in the code, so now it's a
dedicated function.
Change-Id: I31c32414aca3bc99ab655d8a480a849184a11037
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531836
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Avoids buffer overrun if sizeof(GrTextBlob) < sizeof(Slug)
Change-Id: If770eb2a337f2b7ee9a5c7576d155f60c39d9cf7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532256
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Bug: skia:13214
Change-Id: I4aee7bd73711a464371ebe7892335bfce2fdd09a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529279
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Instead of inverting 'deviceToGlobal', we pass the invert to the
function. 0.1% of all cpu time (M1 Mac) for Motionmark1.2 is spent
doing this inversion.
We can remove a matrix inversion in setDeviceCoordinateSystem by
taking advantage of the fact that we can easily compute the
inverted matrix from values available on hand. The code previously
computed:
fGlobalToDevice = (priorDeviceToGlobal * newLayerMappingLayerToDevice)'
We have access to the following values:
newLayerMappingLayerToDevice' = newLayerMappingDeviceToLayer
priorDeviceToGlobal' = priorGlobalToDevice
With the matrix property (A * B)' = B' * A', we can calculate:
fGlobalToDevice = newLayerMappingDeviceToLayer * priorGlobalToDevice
Change-Id: I39656f244fa5f907536d09d69f585f09f156f133
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527505
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
The MultiDrawBuffer no longer exists.
Change-Id: I31c2df9a5363daab018e33156104e3dd7904230e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532012
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Add UI options to select a named transform for tracking, and render a
decoration to highlight the transformed origin.
Change-Id: I2a51278150e7098034e1f6e00b268fce69558b44
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531551
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
This was intended to be a cleanup pass before adding spirv-opt support,
to avoid overloading `toSPIRV` with stuff. I'm no longer confident that
we need to run a spirv-opt trial, but the cleanup still seems like a
tiny win.
Change-Id: If5b0a627b400545d150d41189aca74f6fd0e856a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532010
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:13118
Change-Id: Ica760f58107de021b7823f69b94809dd2f313ac7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531739
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ia4dac275a8614d7597e5c17cae77ad3770ba27e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532001
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This is a reland of commit f274197de1
Original change's description:
> Use Slugs to render non-Blob text
>
> Weaken the assert to allow Slugs to draw if the matrix is the same as
> when the Slug was created with.
>
> Bug: skia:13214
> Change-Id: If0820408208378d57711afb31082a918c00ffc63
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529811
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
Rerun-Tryjobs: true
Bug: skia:13214
Change-Id: I1c144a4c28be8b6e65ee1672170bf51c988f6db2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529938
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Using .isTranslate to detect compatible matrices was just wrong. This
was forcing the drawing throught the inverse matrix calculation path
causing all the pixels to be slightly off. Correctly detect if
the matrices are the same except for translate.
Change-Id: I2497920bdbb1b0e3edf32b9a469fe8b14bdab351
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531796
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This is a reland of commit f33cf451a2
Original change's description:
> Update VMA to latest version.
>
> This is needed so that we can use non skia supplied vk_mem_alloc.h on
> clients that have already updated to newest version. As we transition
> to Bazel builds this helps to make it so we can set the rules for
> specific clients around VMA without things breaking
>
> Bug: skia:13211
> Change-Id: I5d38a3a91a44f6b3fdf75894a3248ee3991dd5d9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531157
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
Bug: skia:13211
Change-Id: Ia4a863819a7d0bb4763f1b516acfa1cc76c47a8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531548
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This makes part of of our testing infrastructure (i.e., the GMs)
compatible with Graphite's more stringent requirements.
Bug: skia:12701
Change-Id: I5d2bf44a1f044797971a1cf6874cf1819d715ca6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530539
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit a370ecf9fc.
Reason for revert: This broke iOS and Mac bots
Original change's description:
> [infra] Update iOS device provisioning profile.
>
> We're moving from Apple's Enterprise program to their Developer program,
> which requires a new profile. Versions 7 and 8 were mistaken uploads of
> who-knows-what by yours truly, so we skip them.
>
> Change-Id: I1b7913781eae5c643e60b47ad374a4365cef7bce
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531553
> Reviewed-by: Ravi Mistry <rmistry@google.com>
> Commit-Queue: Erik Rose <erikrose@google.com>
Change-Id: Icbf9fbf6ed1b84a884ed6aeeebe37ea04ad14bb2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531696
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: George Wright <wrightgeorge@google.com>
We're moving from Apple's Enterprise program to their Developer program,
which requires a new profile. Versions 7 and 8 were mistaken uploads of
who-knows-what by yours truly, so we skip them.
Change-Id: I1b7913781eae5c643e60b47ad374a4365cef7bce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531553
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Erik Rose <erikrose@google.com>
(This mirrors an optimization performed in the constant folder.)
Expressions like `OpIEqual %20 %20` or `OpFUnordNotEqual %15 %15` can be
replaced by `true` or `false` on sight. The GLSL spec makes it clear
that checking for NaN is optional:
4.7.1 Range and Precision
"... NaNs are not required to be generated. Support for signaling NaNs
is not required and exceptions are never raised. Operations and built-in
functions that operate on a NaN are not required to return a NaN as the
result."
Change-Id: I2e29b659a73582e9ade0eb61f70f7d362a007c50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531550
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Previously, every expression/statement type was responsible for
pruning or clearing the store-cache when branches were involved. This
was difficult to reason about and easy to get wrong, particularly if
the details are not fresh in your mind.
Now, `writeLabel` takes care of the details for you. Pass in the
location of the branch(es) which use the label, and the proper cache
updating behavior will occur automatically.
Some of the label enum types are not strictly necessary and exist for
the benefit of a reader. Specifically:
- `kBranchlessBlock` and `kBranchIsOnPreviousLine` are synonyms
- `kBranchIsBelow` and `kBranchesOnBothSides` are also synonyms
The hope is that extra enum names will be easier for a reader to
follow, versus fewer but very-verbose enum names (like
`kBranchIsBelowOrOnBothSides`).
This change earned some very minor switch-related dividends. Previously,
every label in a switch was treated as a forward-branch, but in fact,
the very first label in a switch is privileged. This is because we are
branching from the previous line, and the store cache is trustworthy in
this case. (Versus "branching from above," where the store cache needs
to be pruned before it can be trusted.)
Change-Id: I38b539069c22be9f0777b632f60f0eab2409d687
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531540
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>