We enforce no-recursion in all programs now, not just Runtime Effects.
Change-Id: I3737329e4526fa1b7fdbb47ccb959f78f507f665
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535119
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We now have a new type of ProgramKind, private runtime shaders.
`sksl_rt_effect.sksl` is now only loaded for these kinds of program.
Rather than having a special-case check for sk_FragCoord in
SkRuntimeEffect, the symbol will no longer exist at all unless a private
options flag is set.
Change-Id: I9223baaf59d74c44d64f322cd57fc841625342b7
Bug: skia:12202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532784
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Right now nothing prevents it from working. (skslc doesn't use
SkRuntimeEffect::MakeInternal.) This will be fixed in a followup.
Change-Id: Ib8479220e1f194b035516d976a7369d926a07f5d
Bug: skia:12202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532783
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This has two benefits:
1) We get detailed error messages with accurate positions
2) We can actually test these in our golden .rts files.
Thanks to #2, add a new unit test file, and adjust some existing files
that were breaking these rules.
Change-Id: I0b65e2f06f79ce8cbea9bad4c3d27062ec9b6e6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532769
Reviewed-by: Arman Uguray <armansito@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Some of our oss-fuzz tests contain garbage data which isn't in any
encoding. This throws an error unless the files are opened in binary
mode.
Change-Id: I5caf307f3c79fba5b177496fd8ced8381205b97e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530679
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This removes the assert from the SPIR-V generator so the
tests compile. The generated SPIR-V is incorrect. The next
CL fixes the generator, and restores the assert.
Change-Id: I77b507cf7fb5eac481322887000bd1c73cd5c899
Bug: skia:13219
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530336
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Fix starting angle to be the positive x axis instead of the vertical
upward axis, support repeat modes, fix clipping of sectors that cross
the 0/360 degrees position. No longer cut off sweep gradients outside
start and end angle.
Update test font with new sweep examples from [1].
[1] https://github.com/googlefonts/color-fonts/pull/98
Fixed: skia:13208, skia:13209, skia:13210
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_NativeFonts
Change-Id: I1bf4e3dd6184229dfd8b2a81aa6670e4f2be8937
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529460
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
A ternary of the form `anything ? value : value` can be reduced to a
comma-expression of the form `anything, value`. This seems like a rare
case in real code, but it's easy enough to detect with our existing
toolbox.
The `anything` test-expression will be eliminated from the expression
if it has no side effects, using our existing constant-folding rules
for the comma expression.
Change-Id: I1285b04cd6a08f1bed614aa1aa6f37ea2447de91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528439
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Previously, when we vectorized scalars, we would not place them in the
constant buffer, so we could emit simple vectors like (0,0,0) or (1,1,1)
more than once. Now, we use `writeConstructorSplat` to vectorize, which
knows how to write constants.
Change-Id: Ic97c0ce5415fd46ff8c7fb7dac9205844633ef3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527921
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This cleans up a lot of positions produced by DSLParser to make them
actually match the ranges of the elements being parsed.
Change-Id: Ic3a9d62c99c4b5f92b84a597a2ceba386bbcc334
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527501
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Followup CLs will improve their output.
Change-Id: I07059348f68cd6cd3154c31a41f81018b26a44e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527616
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>
We were not propagating the position into a double-negated expression,
leading to an assertion failure in PrefixExpression.
Change-Id: I1970ff1a06d9631582626c68e151f12f6b3ef278
Bug: oss-fuzz:46381
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527507
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
We didn't have any existing tests that exercised this path; it is
separate from most operators since it has no C++ equivalent.
Change-Id: I95b538dad01f8c8b122954fb5f66337371a398a8
Bug: oss-fuzz:46289
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527196
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>
AE alignment semantics:
- leading white-space counts (i.e. "pushes" the line to the right
in left/center alignment mode)
- trailing white-space is ignored (does not push the line to the left
in center/right alignment mode)
Skottie currently always takes white-space into account. This yields
incorrect center/right alignment not just in the presence of explicit
trailing WS, but also due to residual WS from paragraph line breaks.
To fix, detect trailing WS for each committed line, and adjust glyph
positions to compensate.
Change-Id: Id8589cb30f743f21d77961c0eb4fa20a97e5f13c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526457
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
This closes one of the last gaps in SkSL's constant-folding abilities.
Change-Id: I65c0f2e5fe11a7d47ab2069b2992403fca78b8a7
Bug: skia:12819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524761
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
What affects the placement of an sbix image? The cbox? The bounding box?
The lsb? The offsets? In which direction? What are the side effects?
Change-Id: I5b630c2117a26481733392bc1e95428d9a67fb34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519078
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
A few tests were divided into a Runtime Effect-compatible .rts test, and
a Runtime Effect-incompatible .sksl test.
Change-Id: Ib52554892685bdc44fe3622ab314960ee0962b90
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523377
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
In a few cases, this involved splitting a test into two (an ES2-
compatible portion and a ES3+ portion).
Change-Id: Ie6f18f787cf7c10696a2841ff538bbe2b95bf50d
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523187
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
A few tests received minor tweaks to make them Runtime Effect-friendly.
Change-Id: I9b4f66b0974c41d38324dfbb31ac9849338f600a
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523186
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
These are wrapped in an unscoped Block. Previously, we didn't assign any
position to the block, so it was implicitly given the position of its
enclosing statement.
Change-Id: Id320eb1db583acd6ae42deba2fbb0b61033c3936
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522922
Reviewed-by: Arman Uguray <armansito@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This is causing issues with various license checkers. The link to the
appropriate license is maintained.
Change-Id: I6a2e3f670860482bd1f5ec1b46f5ec3ec4840aa9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522984
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
A few tests received minor tweaks to make them Runtime Effect-friendly.
Change-Id: Icbcedb84b7882e42f21425b2d40d7819705c359e
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522918
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This is useful because it will allow these tests to be supported in
Android CTS, where only Runtime Effects are API-accessible.
This CL updates the C++ test harness so that .rts files in the error/
directory are found, and tweaks error tests as necessary to make them
Runtime Effect-compatible. For instance, Runtime Effects enforce the
parameters on main(), which adds extra errors that we don't want. And
some error tests require ES3 (e.g. array constructors) and so those
tests remain as .sksl files.
In this CL, only tests beginning with A are updated. The remaining tests
will be updated in followup CLs.
Change-Id: I70b064df4f0b3ed02d6bc8cc9add7ee844a78691
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522424
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
With variable fonts overlapping glyph contours are now normal. However,
these do not stroke well. Simpify the glyph paths which are marked as
overlapping.
Bug: b/225044541
Change-Id: I9687e28c9274cd189f4ae8e059d8d40dd802ec41
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521637
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit 5fe4b6faeb.
Reason for revert: relanding with guards
Original change's description:
> Revert "[skottie] Fix text-on-path tracking"
>
> This reverts commit ca973cbea0.
>
> Reason for revert: g3 image diffs
>
> Original change's description:
> > [skottie] Fix text-on-path tracking
> >
> > Tracking and line spacing computations require knowledge of cumulative
> > values for the whole line => we need two passes:
> >
> > 1) compute cumulative values
> > 2) compute per-fragment position adjustments
> >
> > Currently, #1 is implemented in the main onSync() loop (as we iterate
> > to compute fragment props) and #2 is post-applied via adjustLineProps(),
> > after the main loop.
> >
> > The problem is adjustLineProps() is executed after positioning glyphs on
> > path, and tracking is not taken into account for path positioning
> > (instead it moves glyphs horizontally, unrelated to the path).
> >
> > To fix this, we need tracking adjustments to be applied before
> > positioning on path (which is performed in fragmentMatrix()).
> >
> > - move the cumulative tracking computation to a dedicate lambda
> > (compute_linewide_props)
> > - move the fragment position adjustments to the main onSync() loop
> > (that way they participate in path positioning)
> > - to avoid executing the first pass unnecessarily, add flags to detect
> > the presence of tracking and line spacing animators.
> >
> >
> > Change-Id: Ieef2afb53ffe14177eba0ef41dc5c71149cab070
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518696
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Florin Malita <fmalita@google.com>
>
> Change-Id: Ia99fbb3d7d98eb6a59ff00d796bcc05bc6db63a3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519597
> Auto-Submit: Florin Malita <fmalita@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Change-Id: Ia39602178099d7fa016997f02e1bdf705b16bb2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519598
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
This reverts commit ca973cbea0.
Reason for revert: g3 image diffs
Original change's description:
> [skottie] Fix text-on-path tracking
>
> Tracking and line spacing computations require knowledge of cumulative
> values for the whole line => we need two passes:
>
> 1) compute cumulative values
> 2) compute per-fragment position adjustments
>
> Currently, #1 is implemented in the main onSync() loop (as we iterate
> to compute fragment props) and #2 is post-applied via adjustLineProps(),
> after the main loop.
>
> The problem is adjustLineProps() is executed after positioning glyphs on
> path, and tracking is not taken into account for path positioning
> (instead it moves glyphs horizontally, unrelated to the path).
>
> To fix this, we need tracking adjustments to be applied before
> positioning on path (which is performed in fragmentMatrix()).
>
> - move the cumulative tracking computation to a dedicate lambda
> (compute_linewide_props)
> - move the fragment position adjustments to the main onSync() loop
> (that way they participate in path positioning)
> - to avoid executing the first pass unnecessarily, add flags to detect
> the presence of tracking and line spacing animators.
>
>
> Change-Id: Ieef2afb53ffe14177eba0ef41dc5c71149cab070
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518696
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@google.com>
Change-Id: Ia99fbb3d7d98eb6a59ff00d796bcc05bc6db63a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519597
Auto-Submit: Florin Malita <fmalita@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Tracking and line spacing computations require knowledge of cumulative
values for the whole line => we need two passes:
1) compute cumulative values
2) compute per-fragment position adjustments
Currently, #1 is implemented in the main onSync() loop (as we iterate
to compute fragment props) and #2 is post-applied via adjustLineProps(),
after the main loop.
The problem is adjustLineProps() is executed after positioning glyphs on
path, and tracking is not taken into account for path positioning
(instead it moves glyphs horizontally, unrelated to the path).
To fix this, we need tracking adjustments to be applied before
positioning on path (which is performed in fragmentMatrix()).
- move the cumulative tracking computation to a dedicate lambda
(compute_linewide_props)
- move the fragment position adjustments to the main onSync() loop
(that way they participate in path positioning)
- to avoid executing the first pass unnecessarily, add flags to detect
the presence of tracking and line spacing animators.
Change-Id: Ieef2afb53ffe14177eba0ef41dc5c71149cab070
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518696
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Moved the MatrixFoldingES2.sksl test case for matrix construction with
side-effects into a new PreserveSideEffects.sksl test and added new test
cases for various vector and matrix types and constructors. The new test
is written such that none of its contents should be folded away.
Note: This test does not pass on NVIDIA GPUs when using OpenGL as
discussed in skia:13035. Notably, NONE of the increments are executed on
those GPUs as ALL increment expressions seemingly get subjected to
constant-folding. The test is disabled on NVIDIA GPU bots.
This also means that the remaining MatrixFoldingES2.sksl tests now work
on NVIDIA GPUs when using OpenGL (with the exception of Tegra3 + OpenGL
ES).
Bug: skia:13035, skia:11919
Change-Id: I561bb62fe2b6b814ba80fbc492d3885bbcd6b65b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518278
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
This relands commit 4d6d9e3f89.
Original change's description:
> [skottie] Max lines text auto-sizing constraint
>
> Introduce a new text property ("xl"), to limit the number of lines when
> auto-sizing.
>
> This is a Skottie extension, pending UI/controls in Bodymovin.
>
> Change-Id: Id0f1e633e1b324a97b227d6b187cd540990796a7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518498
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>
Change-Id: Ib9d28366332866d8b787f89fa1dc13132c02b435
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518699
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Introduce a new text property ("xl"), to limit the number of lines when
auto-sizing.
This is a Skottie extension, pending UI/controls in Bodymovin.
Change-Id: Id0f1e633e1b324a97b227d6b187cd540990796a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518498
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
ES2 disallows opaque types in expressions (other than passing them to
their associated builtin functions). We now enforce a similar
restriction on SkSL opaque types.
While I was there, I added several other cases to the invalid-shader
test to make sure that they were all caught.
I needed to reorder some code to make sure that ternary expression error
messages didn't change. Ternary expressions now check for opaque types
before checking that the left-side type and right-side type are
compatible. This is because we check for "compatible" ternary
expressions by checking if `leftSide == rightSide` would be accepted.
`shader1 == shader2` used to be considered a valid expression for the
purposes of this test, but not anymore.
Change-Id: I62a0a31feca9dadd428da7d1b48d7693c4b6434d
Bug: skia:13026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516802
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>
The fuzzer discovered that we allow == on void types (confusing the SkVM
backend).
Change-Id: Ia9494642faf67f3f86e3a365807be8bd4a7062e4
Bug: skia:13026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516796
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Previously, we would take the vector-folding path for all types. This
didn't cause any problem for scalars, but failed for "zero-size" types
like void. It isn't valid to compare zero-size values, but we currently
don't reject such code (see skia:13026), and the fuzzer noticed this.
It's safest to only run the vector-folding code when we actually have
multiple slots that need to be folded into one result.
Change-Id: I0bc88043d9a4aeea38ae24dc1a6d1a7430d3d7b0
Bug: oss-fuzz:45279, skia:13026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516676
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
If a function is called multiple times on one line, stepping over that
line does not show all of the function-call results. It only shows the
last result.
e.g. in this example, I have just stepped over the first line which
calls "get" three times. We should see three results, but we only see
one: http://screen/3WfJoZWm77cSexM
In this test you can see that all three calls to `get` are assigned to
the same slot, $15.
Change-Id: Id0c486ef349a1e527001efbcee2ed2b836f56e83
Bug: skia:13011
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514577
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The `break_loop` test causes LLVM to get confused and crash when
compiled on some GPUs. The crash goes away if we pass a literal 5
instead of a 5 that is computed at runtime. This also results in a
simpler test for SkVM, for better or worse, but we still have
coverage for dynamic loop exits in other tests.
LLVM crash: https://paste.googleplex.com/4718583155261440
Dangerous shader: https://paste.googleplex.com/4776089520963584
Change-Id: Ic6cbd55a36d2de58e5dd3459d4dfd74acdbc9f91
Bug: skia:13005
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514538
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
MSL does not support the unary "-" operator on matrix types. Similarly
the SPIR-V OpFNegate/OpSNegate operations only work on scalar and vector
type.
* An expression such as "-<mat>" is now transformed to "-1.0 * <mat>" when
generating MSL.
* The same expression now generates a component-wise negation in SPIR-V,
matching what glslang outputs for GLSL.
* A unary "+" is now treated as NOP for MSL, matching the SPIR-V backend.
An expression such as "+<expr>" is now evaluated as "<expr>".
* The shared/Negation.sksl has been moved to folding/ as much of its
contents exercise constant-folding of comparison expressions.
* The shared/UnaryPositiveNegative.sksl test has been extended to
exercise scalar and matrix types.
NOTE: The SPIR-V backend changes have caused a minor re-ordering of SSA
IDs generated when writing out a prefix-expression. The affected gold
files have been updated.
Bug: skia:12627, skia:12992
Change-Id: Iec5cdafc591aed7e49b3b52bda42a02661380bab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/513976
Auto-Submit: Arman Uguray <armansito@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
Co-authored with Ben Wagner, bungeman@google.com.
Similar to how we allow configuration of variable font configurations,
provide additional SkFontArguments to select a base palette and a set
of potentially sparse color overrides.
This is required for implementing CSS font-palette.
Modify the more_samples-glyf_colr_1.ttf to have two additional palettes,
and two additional test glyphs, one that draws with COLRv0 logic, one
that draws with COLRv1 logic and has a foreground palette index dot
in the middle. See [1] & [2] for the additions to the test font.
Add a GM which tests this on the SkFontMgr_custom using makeClone() and
makeFromStreamArgs(). The test displays the two glyphs in default
palette on the left, then with palette overrides (as in the title of the
test) on the right. The first row uses a typeface created with
makeFromStreamArgs(), the second uses one created with makeClone().
[1] https://github.com/googlefonts/color-fonts/pull/91
[2] https://github.com/googlefonts/color-fonts/pull/92
Bug: skia:12730, chromium:1170794
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_NativeFonts,Test-Debian10-Clang-GCE-CPU-AVX2-x86_64-Debug-All-NativeFonts
Change-Id: Ia1334f069240edc78fd4791969914e8a6f4fbaf9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479616
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
The SkRuntimeEffect fuzzer no longer uses the final 256 bytes of each
shader as uniform data, making this corpus obsolete.
(Fuzzer corpus change: https://github.com/google/oss-fuzz/pull/7266 )
Change-Id: I3df9213520390249f401c83c13f0bca5c7f0dde4
Bug: skia:12781
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508036
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
I wasn't able to find any other test which exercised child color-filters
or child blenders. (SampleWithExplicitCoord evaluates from a shader.)
Change-Id: I58ecee3beca2d3dc11ded5de0eea031e1d7c3e1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507922
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
These all stemmed from the same root cause, but are interesting and
distinct enough to include in our error tests.
Bug: oss-fuzz:44555, oss-fuzz:44557, oss-fuzz:44559, oss-fuzz:44561, oss-fuzz:44565
Change-Id: I22c1798809754b4b38c77ffbe369a97c64a2f60e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507636
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>