This reverts commit bbc4ee5e07.
Reason for revert: Not quite ready -- pref and gold regressions
Original change's description:
> Implement DashLinePathRenderer with a simple FP
>
> An SDF of the dash is implemented as a linear gradient, which is then
> converted to coverage by an inline runtime effect. Currently only
> non-perspective, non-hairline, AA butt caps are supported by the new
> FP. We can delete DashOp once the FP supports more types of strokes.
>
> Bug: skia:12872
> Change-Id: Ifb19fcc4a114aec1847de50aab7ee900f289ed33
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505476
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Christopher Dalton <csmartdalton@google.com>
Bug: skia:12872
Change-Id: Iaec22481ecbda55b37c32f5f7e223ed43a3da071
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508097
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Previously, we used a fixed portion of the fuzzer input for uniform
data, and assumed zero children. Now we synthesize uniform and child
inputs based on the needs of the input shader. We no longer need to
reserve the last 256 bytes of each shader for uniform data; a followup
CL will remove the special corpus that this fuzzer used.
The contents of each uniform/child is not particularly important, since
we don't care what the final paint looks like. Each uniform is filled in
with increasing values in each slot, starting at zero (0, 1, 2, 3, ...).
Each child is a simple built-in shader/filter/blender.
(Fuzzer corpus change: https://github.com/google/oss-fuzz/pull/7266 )
Change-Id: Idc8bfcb17c10a470ef35fafc1789b915495e1d67
Bug: skia:12781
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507924
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@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>
This CL adds the task driver and plumbing necessary to run CI tasks that upload build statistics to https://codesize.skia.org.
For now, a single CodeSize-dm-Debian10-Clang-x86_64-Release task is defined, which as the name suggests:
- Depends on Build-Debian10-Clang-x86_64-Release.
- Takes the "dm" binary built by the aforementioned job.
- Runs Bloaty against said binary.
- Uploads the Bloaty output, along with a JSON file with metadata, to the GCS bucket where https://codesize.skia.org gets its data from.
If one wishes to upload codesize statistics for another binary, the steps are as follows:
- Identify the target binary, for example "fm".
- Identify a compile task that builds said binary with the desired settings, for example "Build-Debian10-Clang-x86_64-Debug".
- Add a new job in //infra/bots/jobs.json named "CodeSize-<binary>-<compile task>", where <compile task> is the name of the compile task without the "Build-" prefix, for example "CodeSize-fm-Debian10-Clang-x86_64-Debug".
- Run "make train" from the //infra/bots directory.
Eventually the codesize.skia.org webserver will automatically pick up the output of any such CodeSize-* task and show it in the UI, with no additional steps needed.
One caveat is that the binary file name, and therefore the "<binary>" part of the task name, cannot contain dashes. This is due to how //infra/bots/gen_tasks_logic.go works. See comments in said Go file for ideas on how to work around this if we ever need to.
Bug: skia:12151
Change-Id: If406944ca7660c4dd15c8e6b8f34e48c65cbbe2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502788
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
An important part of serialization for slugs is maintaining the
translation of typefaceIDs from the renderer side to the GPU side.
Expose the translation code so that the slugs can use it.
Change-Id: I78ded1967759619a95fb13a1577cee3569927471
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Avoids inconsistency with SkMatrix::mapRect.
Change-Id: I5c361e447d4011b2f91881cdbd8b79388f92ef09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507839
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I409dbac3d8548551722e74e86e67bc7b3620f506
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507838
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
An SDF of the dash is implemented as a linear gradient, which is then
converted to coverage by an inline runtime effect. Currently only
non-perspective, non-hairline, AA butt caps are supported by the new
FP. We can delete DashOp once the FP supports more types of strokes.
Bug: skia:12872
Change-Id: Ifb19fcc4a114aec1847de50aab7ee900f289ed33
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505476
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Christopher Dalton <csmartdalton@google.com>
Harden MakeFromBuffer with respect to the array length value.
* Check that the array count is not too large.
Change-Id: I5b398be1690fafce5be5b90ba8aa7af0f12be317
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507637
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:12845
Change-Id: I8013b0068ab758e9a5e580344c62e4680f4fa48e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506176
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12643
Change-Id: Id5eecb3445082e747def8c87f99a16552857af3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506462
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12754
Change-Id: Ib4f1a9ac4ef16805cf8ca4e4c0eea0b3922ca28a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506465
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@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>
The fuzzer constructs a long, valid nonsense expression
(x+x+x-x+x-x, etc.) which exceeds parse depth. At that point, the token
stream points to a `+` token. The parser attempts to consume a new
statement but stops in `unaryExpression`; this fails again, due to the
max parse-depth, but doesn't consume a token. The parser continues
trying to parse the statement, but stopping in `unaryExpression`, making
no forward progress in an infinite loop.
I've made a couple of changes as a result.
- Exceeding the max parse depth now sets `fEncounteredFatalError`.
- Encountering a fatal error causes block() to immediately halt. This
actually undoes a few of the arbitrary changes from
http://review.skia.org/506463 but not in a bad way.
- `unaryExpression()` now consumes a token before checking parse-depth.
- `structDeclaration()` had a similar issue where it could potentially
fail without consuming any tokens; this is fixed as well.
- Some unnecessarily-nested logic in ternaryExpression() was flattened
while I tried to ensure that it always consumes a token.
Change-Id: I52c2161965ffbcef1185761ca6897ec1cba5df89
Bug: oss-fuzz:44551
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507436
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Serialize all the glyphID information for the different
sub runs.
Bug: chromium:1278340
Change-Id: I04387ffadcf5cb20fbaca17a02d7ca1faf883806
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507318
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Build with
./bin/gn gen out/wasm_debug '--args=target_cpu="wasm"'
or
./bin/gn gen out/wasm_release '--args=target_cpu="wasm" is_debug=false'
Change-Id: Ib74586bf8397d57064a3899eaa6da76f9bce9049
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502036
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Adds wangs_formula::quadratic_pow4, cubic_pow4, conic_pow2 overloads
that operate on float2 directly instead of having to load data from
SkPoints. This means that the fixed count tessellators now only load
their control points into float2s once (when creating a patch geometry)
and then evaluate Wang's formula on those points, vs. both patch
geometry and Wang's formula evaluation requiring reading from the
SkPoint[] data. Not sure how likely a compiler is to have automatically
reduced that work.
Change-Id: I18eeb3e81a7e4b38f3fdfe4cc652a468415857a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502058
Reviewed-by: Christopher Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit dec95f24e1.
Reason for revert: broke viewer build
The original CL was landed to keep upstream Skia the source of
truth when the changes were proposed directly in G3 in cl/414839941.
Original change's description:
> Migrate compat v4 classes to androidx
>
> Change-Id: I9dd1d4cbaaf0dc5c4dc8a7bd9155ae6334ab24af
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/480396
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
Change-Id: I660ba61a3a777e18154c52e8eda63937be4d7b4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507184
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
This to match the naming convention for skgpu::Device and the future
skgpu::Image.
Change-Id: Ide0448633f14cfcba583a24eaaceb24da8a58e90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507317
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I9c985a8c68efea0b24a51e87fa09569d927ae0c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506897
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This command is redundant now that we have kBuiltin_Symbol.
Change-Id: Ia41d80b6601bd47e9ec9a14777adf7e1c71fb610
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507316
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Extricate GlyphVector to test serialization which will be added to
it in the future.
Change-Id: I2baa01d92394b3f9af6fe4c3e14341ed453d572f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506885
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I4a37da74f9fc351cf62e9c028c38ac1f3f8c963a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506883
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This allows recorded pictures finished as drawables to be used for glyph
drawing.
Change-Id: I717626eda2bf4e1659c8941c3217cb61c1a16cf4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506882
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is a reland of 3225c8cc46
Original change's description:
> Add kR8_unorm_SkColorType
>
> Change-Id: I97b5bc7f90715664f233ca7b7c41c0ecbfc29ac4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505679
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I73fa17625d57e0e58da1b70e2e59ba200383cfe7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506460
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Osman <brianosman@google.com>
...based on conversation with jvanverth@ on 2022-02-04 in Skia GChat.
Change-Id: I463737e33e87f2052326f6231781a801ad5c320c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506877
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Erik Rose <erikrose@google.com>
Bug: skia:12643
Change-Id: I285d42c908c75532b78c9b80da7b6145e1b47fe7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506458
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
isinf() exists in GLSL 1.3 and above, but hardware without proper IEEE
support is allowed to always return false, so it's potentially
meaningless. In GLSL 3.3 and GLSL ES3+, isinf() is required to actually
identify infinite values. (GPUs are not required to _produce_ infinite
values via operations like `num / 0.0` until GLSL 4.1.)
Change-Id: I6d8cd70f47f653402d9eb2a0aed0773e54cfa61b
Bug: skia:12716
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506878
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Christopher Dalton <csmartdalton@google.com>
Commit-Queue: Christopher Dalton <csmartdalton@google.com>
Change-Id: I5147bea5b113d41e1d47fabca51dfbbc961fa70f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506836
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Previously, REPORTER_ASSERT/ERRORF relied on a helper function named
`reporter_string` which papered over zero-argument and one-argument
messages (where one-argument messages are assumed to ignore printf
formatting rules entirely, and just forward the message as-is).
Replacing this helper with a direct call to `SkStringPrintf` allows
the compiler to check format arguments for correctness, but sacrifices
the one-argument special case. In practice the one-argument special
case was very rarely used, so it's not a significant sacrifice,
and this did uncover several real errors in assertion format strings
(including some cases where the wrong number of arguments was passed).
Change-Id: I4378c43b16fd8fdbf4c78d849a9f2f0a254f7abc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506617
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>