|
|
|
@ -30,7 +30,7 @@ namespace Avalonia.Skia |
|
|
|
private readonly Matrix? _postTransform; |
|
|
|
private double _currentOpacity = 1.0f; |
|
|
|
private readonly bool _disableSubpixelTextRendering; |
|
|
|
private Matrix _currentTransform; |
|
|
|
private Matrix? _currentTransform; |
|
|
|
private bool _disposed; |
|
|
|
private GRContext? _grContext; |
|
|
|
public GRContext? GrContext => _grContext; |
|
|
|
@ -466,7 +466,7 @@ namespace Avalonia.Skia |
|
|
|
Transform = oldTransform; |
|
|
|
} |
|
|
|
|
|
|
|
Canvas.Restore(); |
|
|
|
RestoreCanvas(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -509,7 +509,7 @@ namespace Avalonia.Skia |
|
|
|
using (var outerRRect = new SKRoundRect(outerRect)) |
|
|
|
Canvas.DrawRoundRectDifference(outerRRect, shadowRect, shadow.Paint); |
|
|
|
Transform = oldTransform; |
|
|
|
Canvas.Restore(); |
|
|
|
RestoreCanvas(); |
|
|
|
SKRoundRectCache.Shared.Return(shadowRect); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -672,11 +672,17 @@ namespace Avalonia.Skia |
|
|
|
Canvas.ClipRegion(r); |
|
|
|
} |
|
|
|
|
|
|
|
private void RestoreCanvas() |
|
|
|
{ |
|
|
|
_currentTransform = null; |
|
|
|
Canvas.Restore(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public void PopClip() |
|
|
|
{ |
|
|
|
CheckLease(); |
|
|
|
Canvas.Restore(); |
|
|
|
RestoreCanvas(); |
|
|
|
} |
|
|
|
|
|
|
|
public void PushLayer(Rect bounds) |
|
|
|
@ -688,7 +694,7 @@ namespace Avalonia.Skia |
|
|
|
public void PopLayer() |
|
|
|
{ |
|
|
|
CheckLease(); |
|
|
|
Canvas.Restore(); |
|
|
|
RestoreCanvas(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
@ -731,7 +737,7 @@ namespace Avalonia.Skia |
|
|
|
|
|
|
|
if (useOpacitySaveLayer) |
|
|
|
{ |
|
|
|
Canvas.Restore(); |
|
|
|
RestoreCanvas(); |
|
|
|
} |
|
|
|
|
|
|
|
_currentOpacity = _opacityStack.Pop(); |
|
|
|
@ -796,7 +802,7 @@ namespace Avalonia.Skia |
|
|
|
public void PopGeometryClip() |
|
|
|
{ |
|
|
|
CheckLease(); |
|
|
|
Canvas.Restore(); |
|
|
|
RestoreCanvas(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
@ -829,15 +835,15 @@ namespace Avalonia.Skia |
|
|
|
// Return the paint wrapper's paint less the reset since the paint is already reset in the Dispose method above.
|
|
|
|
SKPaintCache.Shared.Return(paintWrapper.Paint); |
|
|
|
|
|
|
|
Canvas.Restore(); |
|
|
|
RestoreCanvas(); |
|
|
|
|
|
|
|
Canvas.Restore(); |
|
|
|
RestoreCanvas(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public Matrix Transform |
|
|
|
{ |
|
|
|
get { return _currentTransform; } |
|
|
|
get { return _currentTransform ??= Canvas.TotalMatrix.ToAvaloniaMatrix(); } |
|
|
|
set |
|
|
|
{ |
|
|
|
CheckLease(); |
|
|
|
|