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>
Check that the required number of bytes exist for the length
given in the header.
Bug: oss-fuzz:44541
Change-Id: I6f0896fa50a032f97d3981b5f17cf99ef23144b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506779
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This enables the SkSL error testing logic for runtime effects. The core
logic is identical, only the ProgramKind differs.
(Error creation scripts: http://go/paste/6413797460803584 with some
light post-processing)
Change-Id: I877205b3cc1014b50ccccf6037a2f4034c07543e
Bug: skia:12665
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506538
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Previously, when the parser found a bad statement inside a Block, it
would stop processing that Block entirely. This caused our brace
matching to fall out of balance. block() would normally only return once
the Block's closing brace was consumed, but in this case, the closing
brace would still be in the parse stream awaiting consumption even
though block() had returned.
Now, when a bad statement is found inside a Block, we just ignore it and
continue processing. (I tried injecting a poisoned statement as well,
to see if it would affect the test results, but they were identical.)
This seems to generate somewhat better errors.
Change-Id: I8dc781d5602bf99d7610f8280cde8b7c1925cb65
Bug: skia:12868
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506463
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
To avoid ambiguity, the constructor only takes an SkString now instead
of accepting variadic arguments. This functionality was only used in one
place, so this doesn't affect the code in any meaningful way.
Change-Id: I33d2e880e3e1430cea80ca47270dd823221e5a2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506618
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
-Wformat-nonliteral does not work with variadic templates, and requires
a constant format string.
These changes uncovered one incorrect format string (%u -> %lu for a
DWORD in dm.cpp)
Change-Id: Id54a5d6cbcb607ff32c758f4a9d346a7aba70df3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506616
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bug: skia:12701
Change-Id: I743e4717f3716717bd35e1eea0f504a1f9ac6dc4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506536
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Namely:
we were always uploading uniforms to the front of the uniform buffer
the gradient colors are stored as float4s - not half4s
Bug: skia:12701
Change-Id: Ic7a669566454d2c00b499cabf8f659ba08b0cedc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506159
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
In the recently introduced FontConfigInterface_MatchStyleNamedInstance
test the highBitsExpectation vector was one bool too short. Because this
was a std::vector<bool> AddressSanitizer because as silent because all
the bits fit in one underlying storage unit. It isn't clear why
MemorySanitizer did not seem to catch this. In any event,
highBitsExpectation[6] was effectively a random causing the test to fail
about half the time.
Restructure these parallel arrays into a Test struct so that the
expectations are obvious and line up. Also make everything constexpr.
Bug: skia:12916
Change-Id: Iaaabb7aef5e041b551a9e2302f954c64509427f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506160
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Thoroughly exercise the new descriptor de-serializer.
Change-Id: If8208ec5b0f0a8e0db250d2cd723b6970c5f4ff2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506464
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:12643
Change-Id: I37e1718a20283dfb814c85260257d57bac2b7b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506211
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Takes the given texture data and destination rectangle, copies it into
a buffer, and stores the destination textureProxy, buffer, and
associated BufferTextureCopyData into an UploadCommand.
Bug: skia:12845
Change-Id: Icba8b9e56ac0d79083c54fe529bd7e35ddb6e23d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505798
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
PS 1 is re-generating existing BUILD.bazel files
PS 2 is generating BUILD.bazel files for tests/gms
PS 3+ makes modifications to build all of the gms and tests.
It is recommended to view this CL with just a diff between
PS 2 and the end, due to the large amount of generated changes
in PS 1 and 2.
We make a filegroup for the gms and tests because they need
to be compiled as one large blob in order for the registries
to work. Maybe in the future we will break these up, but at least
for WASM/JS, the overhead of starting a browser for each new
test would likely grind things to a halt, so we just group them
all together for now. It's also the most similar to what we
currently do.
In gm/BUILD.bazel and tests/BUILD.bazel, we add a cc_library
that encapsulates all of the deps of the tests, so we can
easily include that the build. These were discovered via
trial and error, not anything automatic or systematic.
The is_skia_dev_build config_setting is very similar to the
GN equivalent from which it was based.
The list of gms and tests to skip (e.g. which are incompatible
with WASM) was determined by building the wasm bundle:
modules/canvaskit$ make bazel_gms_release
tools/run-wasm-gm-tests$ make run_local_debug
# Don't forget to click the button on the screen after the
# browser loads
This way of invoking the tests will be replace soon with
`bazel test <something>`. As such, I didn't bother fully
documenting the current way.
Suggested review order:
- modules/canvaskit/BUILD.bazel taking note that we always
use profiling-funcs to make the stacktraces human readable.
- gm/BUILD.bazel and tests/BUILD.bazel to see the lists of
gms/tests. Notice the tests are roughly partitioned because
we don't support things like vulkan/PDF in the wasm build
and we will want a way to not build certain tests for
certain configurations
- tools/* noting some of the cc_libraries added to make
dependencies easier to add when needed.
- All other files.
Change-Id: I43059cd93c28af1c4c12b93d6ebd9c46a12d381f
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506256
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
SkVMSlotInfo now contains a "group index" field in each slot. The
group index starts at zero for the first slot of a variable and
increases by 1 for each slot associated with that variable.
For simple types, this group index will always match the component
index. (This is by far the common case, so the groupIndex field is
omitted from the JSON if the indices match.) For more complicated
types--structs, arrays, or nested combinations thereof--it gives us
a simple way to find the start and end slot of a variable. For a given
slot, we can identify the associated variable's initial slot by
subtracting its group index, and we can identify the last slot of any
variable by walking forward and looking for a group index of zero
(indicating the start of a new, different variable).
Change-Id: Iaa71c89ba470a4f9640206dab0774096a7467cce
Bug: skia:12906
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506317
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The `Typeface_glyph_to_char` test assumes that
`ToolUtils::emoji_typeface()` will always return an SkTypeface which
supports all the codepoints in `ToolUtils::emoji_sample_text()`.
However, it is possible in some configurations for there to be no
available emoji font. Detect this and provide a better massage about why
the test failed.
Correct the preprocessor directives in TestFontMgr.cpp so that the
"Emoji" and "Planet" test fonts are consistently defined and used.
Change-Id: Ibc18b03b272d9cb1187bd012a843e550af954565
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506209
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
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>
- Remove the isOpaque parameter from all makeShader calls
- Add some folding to emphasize important parts of fiddles
Bug: skia:12643
Change-Id: Iaae5d61b63b409a8754b5144dc2baf5927a14848
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506316
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Create canonical flattening for SkDescriptor and unflattening
for SkAutoDescriptor.
Eventually Slug serialization and the remote glyphs cache will use
this method for SkDescriptor serialization.
Change-Id: Ia4b6be43058aeca19fbfdcf3c5cdd8d703935775
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505681
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>