Open ahmed605 opened 9 months ago
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