|
|
|
@ -534,7 +534,11 @@ namespace Avalonia.Skia |
|
|
|
public void PushOpacityMask(IBrush mask, Rect bounds) |
|
|
|
{ |
|
|
|
// TODO: This should be disposed
|
|
|
|
var paint = new SKPaint(); |
|
|
|
var paint = new SKPaint() |
|
|
|
{ |
|
|
|
IsAntialias = true, |
|
|
|
Style = SKPaintStyle.StrokeAndFill |
|
|
|
}; |
|
|
|
|
|
|
|
Canvas.SaveLayer(paint); |
|
|
|
_maskStack.Push(CreatePaint(paint, mask, bounds, true)); |
|
|
|
@ -543,7 +547,14 @@ namespace Avalonia.Skia |
|
|
|
/// <inheritdoc />
|
|
|
|
public void PopOpacityMask() |
|
|
|
{ |
|
|
|
using (var paint = new SKPaint { BlendMode = SKBlendMode.DstIn }) |
|
|
|
using (var paint = new SKPaint |
|
|
|
{ |
|
|
|
IsAntialias = true, |
|
|
|
Style = SKPaintStyle.StrokeAndFill, |
|
|
|
BlendMode = SKBlendMode.DstIn, |
|
|
|
Color = new SKColor(0, 0, 0, 255), |
|
|
|
ColorFilter = SKColorFilter.CreateLumaColor() |
|
|
|
}) |
|
|
|
{ |
|
|
|
Canvas.SaveLayer(paint); |
|
|
|
using (var paintWrapper = _maskStack.Pop()) |
|
|
|
|