Browse Source
Merge pull request #6374 from wieslawsoltes/GeometryClipAntialiasing
Enable antialiasing for PushGeometryClip
pull/6429/head
Dan Walmsley
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
3 additions and
2 deletions
-
src/Skia/Avalonia.Skia/DrawingContextImpl.cs
-
src/Windows/Avalonia.Direct2D1/Media/DrawingContextImpl.cs
-
BIN
tests/TestFiles/Skia/Controls/CustomRender/GeometryClip.expected.png
-
BIN
tests/TestFiles/Skia/GeometryClipping/Geometry_Clip_Clips_Path.expected.png
|
|
|
@ -506,7 +506,7 @@ namespace Avalonia.Skia |
|
|
|
public void PushGeometryClip(IGeometryImpl clip) |
|
|
|
{ |
|
|
|
Canvas.Save(); |
|
|
|
Canvas.ClipPath(((GeometryImpl)clip).EffectivePath); |
|
|
|
Canvas.ClipPath(((GeometryImpl)clip).EffectivePath, SKClipOperation.Intersect, true); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
|
|
|
@ -541,7 +541,8 @@ namespace Avalonia.Direct2D1.Media |
|
|
|
ContentBounds = PrimitiveExtensions.RectangleInfinite, |
|
|
|
MaskTransform = PrimitiveExtensions.Matrix3x2Identity, |
|
|
|
Opacity = 1, |
|
|
|
GeometricMask = ((GeometryImpl)clip).Geometry |
|
|
|
GeometricMask = ((GeometryImpl)clip).Geometry, |
|
|
|
MaskAntialiasMode = AntialiasMode.PerPrimitive |
|
|
|
}; |
|
|
|
var layer = _layerPool.Count != 0 ? _layerPool.Pop() : new Layer(_deviceContext); |
|
|
|
_deviceContext.PushLayer(ref parameters, layer); |
|
|
|
|
Width:
|
Height:
|
Size: 2.2 KiB
Width:
|
Height:
|
Size: 4.0 KiB
|
Width:
|
Height:
|
Size: 728 B
Width:
|
Height:
|
Size: 660 B
|