-
Notifications
You must be signed in to change notification settings - Fork 542
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
[FEATURE] Expose SkCanvas::SaveLayerRec API #2773
Comments
This is also needed to make ClearType work with layering. Otherwise parameters like pixel geometry or sub pixel text are not preserved for the created layer. |
@mattleibow What are the chances we can have this in SkiaSharp 3? |
It does not require too much work. The native layer needs to expose the missing API and a new struct needs to be mapped. |
@Gillibald @Youssef1313 @ahmed605 I have updated the PRs, let me know if the class-based API will work. Do you see any issues with this? |
Is your feature request related to a problem?
SkCanvas::SaveLayerRec
is missing from SkiaSharp's API surface, this API is very useful for implementing backdrop effects/filters, we need this API in order to implement CompositionBackdropBrush properly in Uno Platform.Describe the solution you would like
It would be great if
SkCanvas::SaveLayerRec
got exposed in SkiaSharpDescribe alternatives you have considered
We currently use a combination of
SKCanvas.SaveLayer(SKPaint)
,SKCanvas.DrawSurface(SKSurface, SKRect)
, andSKCanvas.Restore()
as a workaround, but it isn't ideal and has few issues (e.g. need to downscale the canvas manually, no custom clipping, slower since it's not optimized for backdrop effects unlikeSkCanvas::SaveLayerRec
, image filter of SKPaint isn't fully applied to the saved region (due to scaling miscalculations?), etc...)Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: