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>
A number of scaler contexts are created (like for paths) which are never
used in a way that forces the port to create the image. Delay the
(seemingly expensive) work of creating the color space and color until
they are actually needed.
Bug: chromium:1297957
Bug: chromium:1297978
Change-Id: Ibf55d18432b9be7deea9d3bc28dd5b4c1e5b9da5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510206
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This will leave the PaintParamsKeys more clearly immutable and manage more of the cruft of key creation (e.g., beginBlock/endBlock pairing).
Bug: skia:12701
Change-Id: I1944397465f845e974e950f47cedb90c3f1895b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506881
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
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>
This reverts commit ee45d92013.
Reason for revert: missed declaring PRECISION in the tessellation shader stages
Original change's description:
> Use VectorXform to determine parametric segments for stroke curves
>
> Change-Id: I088119d01d31d58b154e49479aa071ac68938cb4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502059
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: I2aeb6d8f2dfc403cd556d130f8a50a0cae8568cb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510204
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Change-Id: I088119d01d31d58b154e49479aa071ac68938cb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502059
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12845
Change-Id: I2cf5074f85242f51b3798c59d4450c043a99afee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509916
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit f436cf2343.
Reason for revert: May need to be behind flag or more
suppressions. Breaking linux-rel vulkan_swiftshader_blink_web_tests
css3/filters/effect-blur-hw.html .
Original change's description:
> Preserve base device origin on saveLayer and image filters
>
> SaveLayerOriginTest taken from https://skia-review.googlesource.com/c/skia/+/277977
>
> Bug: skia:12732
> Change-Id: I5ce75355bb16237043c229e1cbc7a106eb636d18
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508919
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12732
Change-Id: I74cc8dc279d22c4fbd313ae3caeb4d0748daf003
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510196
Auto-Submit: Ben Wagner <bungeman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.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>