-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sweep gradients: they were buggy, and the spec is changing #17
Comments
Also: the Skia backend doesn't currently implement the sweep extend mode correctly: the extend mode should not extend before the start angle and after end angle (???). |
First of all, big thanks @justvanrossum for the report on Chromium/Skia using the incorrect start axis (vertical up instead of horizontal right). I filed the following issues after further investigation: https://bugs.chromium.org/p/skia/issues/detail?id=13208, https://bugs.chromium.org/p/skia/issues/detail?id=13209, https://bugs.chromium.org/p/skia/issues/detail?id=13210. So the start angle was wrong, repeat modes didn't work, the sector was cut, and sectors crossing 0 did not work. To fix this, I increased test coverage and improved the Skia implementation. In the following I try to break down some observations of what I am seeing in BlackRenderer to hopefully get to a common understanding and help with debugging issues in BlackRenderer for sweeps. New Test Glyphsgooglefonts/color-fonts#98 contains additional test glyphs for sweep (now merged to main) Skia Fix and ResultsMy fix CL for Skia is in: With that I get the following, in our opinion correct results (rows are extend modes pad, reflect, repeat respectively). Please do comment if you think some interpretations/renderings are still wrong as that may well be possible. BlackRenderer resultsExtend mode pad:
The tests glyphs are:
This shows:
Extend mode reflect
Issues, as much as I can tell:
Extend mode repeat
Issues, as much as I can tell, similar to reflect:
|
I think I have the
For the
test shown in my second row, second image from the left, there's an implicit "pad" that fills the 0-90 degree angle, which is incorrect. I'll update this report after fixing that. |
With WIP Skia CL #532057 we are getting closer but we still need some clarifications on what happens at the 0 / 360 degree boundary. Extend mode pad:Test glyphs
Extend mode reflectTest glyphs
Similarly quite well aligned, not sure what happens in BlackRenderer on the 6th and 8th glyph, which should IMO be equivalent to 5th and 7th respectively. Extend mode repeatTest glyphs
Similarly quite well aligned, not sure what happens in BlackRenderer on the 6th and 8th glyph, which should IMO be equivalent to 5th and 7th respectively. |
Also relevant: fonttools/fonttools#2743 |
New, wider set of tests in googlefonts/color-fonts#119, Chrome rendering with https://skia-review.googlesource.com/c/skia/+/566416 |
In particular, extend modes seem to behave differently, in the spec, for sweep gradient than for linear and radial ones.
For example, normalizing the colorLine seems unwated for sweeps, but more processing of the color linee be required, for simulating repeat, pad, mirror.
Solutions will be different for Skia on one hand, and the other backends on the other hand.
The text was updated successfully, but these errors were encountered: