|
|
@@ -1,5 +1,4 @@
|
|
|
-using System;
|
|
|
-using Avalonia.Platform;
|
|
|
+using Avalonia.Platform;
|
|
|
using Avalonia.Rendering;
|
|
|
using SkiaSharp;
|
|
|
|
|
|
@@ -29,72 +28,5 @@ namespace Avalonia.Skia.Helpers
|
|
|
return new DrawingContextImpl(createInfo);
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// Unsupported - Wraps a GPU Backed SkiaSurface in an Avalonia DrawingContext.
|
|
|
- /// </summary>
|
|
|
- [Obsolete]
|
|
|
- public static IDrawingContextImpl WrapSkiaSurface(this SKSurface surface, GRContext grContext, Vector dpi, params IDisposable[] disposables)
|
|
|
- {
|
|
|
- var createInfo = new DrawingContextImpl.CreateInfo
|
|
|
- {
|
|
|
- GrContext = grContext,
|
|
|
- Surface = surface,
|
|
|
- Dpi = dpi,
|
|
|
- DisableTextLcdRendering = false,
|
|
|
- };
|
|
|
-
|
|
|
- return new DrawingContextImpl(createInfo, disposables);
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Unsupported - Wraps a non-GPU Backed SkiaSurface in an Avalonia DrawingContext.
|
|
|
- /// </summary>
|
|
|
- [Obsolete]
|
|
|
- public static IDrawingContextImpl WrapSkiaSurface(this SKSurface surface, Vector dpi, params IDisposable[] disposables)
|
|
|
- {
|
|
|
- var createInfo = new DrawingContextImpl.CreateInfo
|
|
|
- {
|
|
|
- Surface = surface,
|
|
|
- Dpi = dpi,
|
|
|
- DisableTextLcdRendering = false,
|
|
|
- };
|
|
|
-
|
|
|
- return new DrawingContextImpl(createInfo, disposables);
|
|
|
- }
|
|
|
-
|
|
|
- [Obsolete]
|
|
|
- public static IDrawingContextImpl CreateDrawingContext(Size size, Vector dpi, GRContext grContext = null)
|
|
|
- {
|
|
|
- if (grContext is null)
|
|
|
- {
|
|
|
- var surface = SKSurface.Create(
|
|
|
- new SKImageInfo(
|
|
|
- (int)Math.Ceiling(size.Width),
|
|
|
- (int)Math.Ceiling(size.Height),
|
|
|
- SKImageInfo.PlatformColorType,
|
|
|
- SKAlphaType.Premul));
|
|
|
-
|
|
|
- return WrapSkiaSurface(surface, dpi, surface);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var surface = SKSurface.Create(grContext, false,
|
|
|
- new SKImageInfo(
|
|
|
- (int)Math.Ceiling(size.Width),
|
|
|
- (int)Math.Ceiling(size.Height),
|
|
|
- SKImageInfo.PlatformColorType,
|
|
|
- SKAlphaType.Premul));
|
|
|
-
|
|
|
- return WrapSkiaSurface(surface, grContext, dpi, surface);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- [Obsolete]
|
|
|
- public static void DrawTo(this IDrawingContextImpl source, IDrawingContextImpl destination, SKPaint paint = null)
|
|
|
- {
|
|
|
- var src = (DrawingContextImpl)source;
|
|
|
- var dst = (DrawingContextImpl)destination;
|
|
|
- dst.Canvas.DrawSurface(src.Surface, new SKPoint(0, 0), paint);
|
|
|
- }
|
|
|
}
|
|
|
}
|