Browse Source

Use latest SkiaSharp api

pull/638/head
Wiesław Šoltés 10 years ago
parent
commit
241f8c01e7
  1. 2
      src/Skia/Avalonia.Skia/BitmapImpl.cs
  2. 4
      src/Skia/Avalonia.Skia/PlatformRenderInterface.cs
  3. 2
      src/Skia/Avalonia.Skia/RenderTarget.cs

2
src/Skia/Avalonia.Skia/BitmapImpl.cs

@ -24,7 +24,7 @@ namespace Avalonia.Skia
{
PixelHeight = height;
PixelWidth = width;
Bitmap = new SKBitmap(width, height, SKColorType.N_32, SKAlphaType.Premul);
Bitmap = new SKBitmap(width, height, SKImageInfo.PlatformColorType, SKAlphaType.Premul);
}
public void Dispose()

4
src/Skia/Avalonia.Skia/PlatformRenderInterface.cs

@ -30,8 +30,8 @@ namespace Avalonia.Skia
IBitmapImpl LoadBitmap(byte[] data)
{
var bitmap = new SKBitmap();
if (!SKImageDecoder.DecodeMemory(data, bitmap))
var bitmap = SKBitmap.Decode(data);
if (bitmap == null)
{
throw new ArgumentException("Unable to load bitmap from provided data");
}

2
src/Skia/Avalonia.Skia/RenderTarget.cs

@ -87,7 +87,7 @@ namespace Avalonia.Skia
_bitmap.Dispose();
}
_bitmap = new SKBitmap(width, height, SKColorType.N_32, SKAlphaType.Premul);
_bitmap = new SKBitmap(width, height, SKImageInfo.PlatformColorType, SKAlphaType.Premul);
IntPtr length;
var pixels = _bitmap.GetPixels(out length);

Loading…
Cancel
Save