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>
This reverts commit f33cf451a2.
Reason for revert: breaking the android roller
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: Ibd621aa2f07359f9b72e1a35df0f50ca3c063e86
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531543
Auto-Submit: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Now that we can call into Skia utils directly, we can use the
preexisting code from SkOSPath instead.
Change-Id: I67e3099e97ec0e93acc08c7f2142a01a2af48f15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531416
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
FreeType introduced FT_LOAD_COLOR in 2.5 so an application could
indicate that it could handle the new color format. If this glyph load
flag was not set then the colors would be desaturated into the old gray
format so that something would be drawn while applications were updated.
The only source of color glyphs was bitmaps, but Skia always set the
flag on both scalable and non-scalable (bitmap and outline) fonts.
In FreeType 2.10 the meaning of this flag was expanded to mean that
using FreeType to render a glyph with an associated COLR entry would
attempt to draw using the color layers instead of the base glyph. This
did not affect Skia since Skia handles the color layers itself.
In FreeType 2.12 the meaning of this flag was updated again to mean that
if using FreeType to load a glyph with an associated SVG entry would
prefer loading the glyph with a new FT_GLYPH_FORMAT_SVG. This means any
users loading a glyph with FT_LOAD_COLOR on a scalable font (like Skia
has been) will get this new format and not the base outlines.
In order to work properly with this setup, Skia must ensure the
FT_LOAD_COLOR is only set on scalable (outline) fonts when Skia supports
SVG glyphs. For now this means setting FT_LOAD_COLOR on bitmap fonts
only with a comment where it should be set when SVG is supported.
Change-Id: Iaf8991b73d353ab7bda836ff4c290d75ab519d78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531323
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
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>
This is a reland of commit ca0c82a968
Original change's description:
> Eval args of trace macros in debug builds
>
> Change-Id: I9ae48cfa23948fbdcdf6e8997365f5a8c2b3be8b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530677
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I8eb6c5fb129e907577c504776c3bab37c6a94fec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531236
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>