-
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
Sweep gradient can only easily be implemented in Skia #5
Comments
(FWIW, PaintSweepGradient has now been implemented in the Skia backend.) |
For the other backend/canvases, we can probably do an approximation with a triangle fan (say ≈360 triangles), with a constant color in each triangle. Generate triangle -> clip/cull against clip-extent -> draw. |
In fact, mesh patterns seems the way to go, in order to get better approx. |
Ah great, I see Cairo supports mesh patterns, so that may be a good solution there. For SVG, a triangle approximation is probably best. SVG to me is more a reference, so I wouldn't be bothered much about effiency. I wonder if for CoreGraphics, CGShading could be an option (although I can imagine that being performant in Python, if that API is supported at all by the Python bridge). I have never used that API. In the worst case we just don't support sweep gradients in some backends. |
Should that issue be closed? |
Yes, let's continue in #17. |
Skia has GradientShader.MakeSweep but the other libraries and SVG don't have native support for it, as far as I know.
The text was updated successfully, but these errors were encountered: