Clean up drawGlyphRunList suggested in a previous CL. The main
serialized strikes, and serialized Slugs is getting large. So,
I broke it up.
Change-Id: I1d116bcf3b28d95e31b4eec7666c0856cea54a48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512159
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
With data with large values we can get into situations where clearly
degenerate quads are not giving a zero determinant, because of
errors when computing the additions and subtractions in sequence.
The solution is to compute the subtractions first, and then add them
together.
Bug: oss-fuzz:41445
Change-Id: I7febead4b020e11a137f1703b761af70c14e4e47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511796
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
If gn generates an otherwise harmless warning, find_headers.py will fail
to parse the gn-generated JSON because gn prints both the warning and
the JSON to stdout. Though find_headers.py prints the output of gn if
JSON parsing fails, a human investigating this failure is likely to
assume that the warning they see is from the build system, not from
find_headers.py, and is not related to the failure.
For example, this warning about an argument which has no effect breaks
the build:
WARNING at build arg file (use "gn args <out_dir>" to edit):36:36: Build argument has no effect.
skia_skqp_global_error_tolerance = 8
^
[...]
Change-Id: Iafa7252ba161e4def1438f5d9480b64fdaa887d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510536
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
gpuSetup() is responsible for calling skiagm::onGpuSetup() which is
responsible for initializing compressed images used in the following
SkQP tests:
- gl_compressed_textures
- gl_compressed_textures_nmof
- gl_compressed_textures_npot
- gles_compressed_textures
- gles_compressed_textures_nmof
- gles_compressed_textures_npot
- vk_compressed_textures
- vk_compressed_textures_nmof
- vk_compressed_textures_npot
Without this patch each of these tests crash. I suspect these tests were
broken by commit a84caa3a5f ("Make some GMs compatible with the *ooprddl
configs").
Change-Id: Iae864996b9b171084c8ceb5374765d510ff56b49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510056
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I51d3f94bcb483e6e3de6f54a2e10683b0ea6d3d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512162
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Erik Rose <erikrose@google.com>
Bug: skia:12701
Change-Id: I648948875a2e9401c0c73cdf4c9c8053c9ba69af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510227
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
These weren't used and added complexity to the dependency graph.
Change-Id: I7e97d73d520b7123e534485d7840538d6b468c48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512145
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>
In order to load CanvasKit, we need to add support for statically
served files. On the karma side, this is done by adding an
object [1] to the files list (example: [2]).
Then, we need to include canvaskit.js in with the karma test
files and use the callback to load canvaskit.wasm from the
correct file location.
[1] http://karma-runner.github.io/6.3/config/files.html
[2] 4f7b656012/modules/canvaskit/karma.conf.js (L13)
Change-Id: I7482d6e949a5e8efd0ca882efe5afbe0dc16c0e4
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510736
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Run the tests in headless mode and output the logs
bazel test :hello_world --test_output=all
Start up a visible web browser with the karma test driver
(need to go to Debug tab to actually run tests)
bazel run :hello_world
Suggested review order
- package.json to see the karma dependencies to run
jasmine tests on chrome and firefox.
- WORKSPACE.bazel to see how the packages listed in
package.json and package-lock.json are downloaded
into the Bazel sandbox/cache via the npm_install rule.
As mentioned in the package.json comment, the version
of build_bazel_rules_nodejs which emscripten uses [1]
is 4.4.1 and if we tried to install it ourselves, that
installation will be ignored. We also bring in hermetic
browsers via io_bazel_rules_webtesting.
- bazel/karma_test.bzl which defines a new rule _karma_test
and a macro karma_test which joins the new rule with
an existing web_test rule to run it on a hermetic browser
which Bazel downloads. This rule takes heavy inspiration
from @bazel/concatjs [2], but is much simpler and lets us
configure more things (e.g. proxies, so we can work with
test_on_env).
- karma.bazel.js, which is a pretty ordinary looking karma
configuration file [2] with effectively a JS macro
BAZEL_APPLY_SETTINGS. JS doesn't have a preprocessor or
actual macros, but this string will be replaced by the
JS code in karma_test.bzl which will set correct filepaths
for Bazel content.
- All other files.
[1] c33c7be17f/bazel/deps.bzl (L10)
[2] 700b7a3c5f/packages/concatjs/web_test/karma_web_test.bzl (L318)
[3] http://karma-runner.github.io/6.3/config/configuration-file.html
Change-Id: Id64c0a86d6be37d627762cef0beaaf23ad390ac1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509717
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
This reverts commit 10241484aa.
Reason for revert: Speculative revert for b/220676062
Original change's description:
> Fix dithering on drawImage[Rect] calls
>
> Bug: skia:12516
> Change-Id: Ibb68558e0f474143df3c6a5fb0fb3d4881529226
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508677
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12516
Change-Id: If496c6be355bbb026ffe478512f8a6334116bb66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511806
Commit-Queue: Brian Osman <brianosman@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This reverts commit 05a4b12dbd.
Reason for revert: Speculative fix for b/220676062
Original change's description:
> Don't dither const shaders that don't have a GP override
>
> https://gold.skia.org/detail?test=gradients_no_texture&digest=008c796df4da7fbb6718e96db2c36c90
>
> If paintFP was only non-null because it came from the main SkShader, we
> should defer to SkPaintPriv's check that the shader is not a constant.
> We don't have a isConstant() for FPs so this assumes that if the GP
> overrides it with a new FP it probably is doing something spatially
> interesting and does need the dithering.
>
> Bug: skia:12516
> Change-Id: I7935ba8f0baf91e7b7ba07280452871c60ffd3e8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509996
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12516
Change-Id: I9c45f457d42cd5890cc110617e1636ffa6669503
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511807
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Osman <brianosman@google.com>
SkTArray.h uses std::max() which is part of <algorithm>.
Some libc++ changes have stopped exporting <algorithm> from certain headers, causing skia to break with ToT libc++.
2e2f3158c6
Change-Id: Iee4e00b3b3a6cbe2c1881453d05c0658e95a767b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512016
Commit-Queue: Arthur Eubanks <aeubanks@google.com>
Auto-Submit: Arthur Eubanks <aeubanks@google.com>
Reviewed-by: Erik Rose <erikrose@google.com>
Commit-Queue: Erik Rose <erikrose@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Change-Id: I682e6cd5e02b7b43740c51caf59451da9e789a75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511799
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Switch to using the public API similar to SkTextBlob for
serialize/Deserialize. Add deserializeSlug to SkStrikeClient.
Bug: chromium:1278340
Change-Id: I91b93487859c662e3bfdfba49ba4758f13529cd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511601
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This fixes a build bot problem. Because this is run with
--nonativeFonts, we are building a descriptor that can't be
turned into a strike. Make failure to find the strike return
an error instead of asserting.
In addition, use the proper code idiom for checking condition in
other parts of the code.
Change-Id: I3fc4051bf93e8f5308ac55bebd4218c04b5a6620
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511797
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
All users have been updated. This flag and the code it guards can now be
removed.
Bug: skia:12956
Change-Id: I8115235fdbe12f8afa1973f43f0f2870447e5e01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511756
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Dominik Röttsches <drott@google.com>
Commit-Queue: Dominik Röttsches <drott@google.com>
Use the SkStrikeClient to do the TypefaceID translation if present
when creating a GrGlyphVector.
With this change, Chromium should be able to use the
flatten/MakeFromBuffer API. Currently, this will only
serialize DirectMask (the most common type) drawing.
Other SubRun type will follow soon.
Bug: chromium:1278340
Change-Id: I08a46c7e4e13f7bd899abfdad89c5b3db2548d6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511416
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This failure happens when using the SkRemoteGlyphCache system
*and* serializing slugs. The problem is that the origin from the
blob conversion was applied twice causing all the sub-pixel
positions to be off. This often pass because this position often
is {0, 0}.
Change-Id: I0384cfc1de5c32851381390661d1f4a8a6595ab2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510724
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Previously, FreeType was always instructed to hint or autohint the layer
glyphs of COLRv0 fonts. Instead, pass the appropriate loading flags
through so that the layer glyphs will be created similarly to how the
base glyph would be handled. The behavior change is gated on
SK_IGNORE_FREETYPE_COLRV0_LOAD_FLAGS_FIX because this will require
rebaselining some Blink layout tests.
Also ensure that COLRv1 subglyphs are never hinted or autohinted for
now. These are a bit more complex and allowing hinting will need to be
handled separately.
Bug: skia:12956
Change-Id: Ia69f7a0e207b1af885ed5039f9e53007125b707e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510876
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Dominik Röttsches <drott@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
writePatches() just calls into PatchWriter directly now.
Change-Id: Icbdbd554f04f7a609b199a709922cb63fce5c8f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502060
Reviewed-by: Christopher Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
In theory this shouldn't make a difference since copying the table
tags should be a super minimal operation (literally reading a few
bytes out of the font header). However, CoreText and CoreGraphics
work in mysterious ways and this may actually be an expensive
operation.
Bug: chromium:1297957
Bug: chromium:1297978
Change-Id: Ia640f4c7469d5d10b3243a5d0e939633a2b6ba7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510719
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This updates the key builder system so the builder can be used in a tight loop with the memory backing the key being reused.
Bug: skia:12701
Change-Id: I79a72ca26570dcfea9aa45b0fbad8e598688ee98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510016
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I3d1433fba70d5283cb76c960c2e5e7aab0b53ef5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510816
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This CL using GPU draws every TextBlob by converting it to a
Slug, flattening the Slug, unflattening the Slug to a dstSlug,
and then uses the dstSlug to draw the TextBlob.
Since only DirectMask sub runs are working I have disabled some
code to all empty sub runs. This will be restored in the final
version.
This adds a compile-time flag to control this behavior:
SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG_SERIALIZE
Bug: chromium:1278340
Change-Id: I7674593b0d6e1f871e1c526af76407a1977a8836
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510419
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I78fd07c10a8dd3ff76b6040109afdf4b47b69eb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510656
Reviewed-by: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Use the override index as intended instead of the index into the
override list as the palette entry index to override. Correct the bounds
check on the override index. Modify an existing test to exercise this.
Bug: skia:12576
Change-Id: Ide8327ff0536eee252c6a83e997ad540a98ba957
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510596
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
First, the convex check still had a bug when determining if we've
wrapped around more than once. If the delta between two coordinates was
0, then that doesn't trigger a sign change (as expected), but it
will get copied as the next value to check against. Instead we should
be checking against the previous non-zero value.
Second, the ActiveEdgeList for isSimple had a bug where two very large
segments were ending up with equal p0 and v values due to floating
point error. Added a check for this and we'll treat those edges as
effectively coincident.
Bug: oss-fuzz:44753
Change-Id: I84bccdf629e6173d14c040b0e6f6c997f4b48001
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510416
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
If an MSKP fails to load, fPlayer will be null, and viewer will crash
when switching backends.
Change-Id: I68b63da21c8f7c5726b3c5bbbdcb6c17018a63ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510209
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>