Bläddra i källkod

Use latest SkiaSharp api

Wiesław Šoltés 9 år sedan
förälder
incheckning
241f8c01e7

+ 1 - 1
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()

+ 2 - 2
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");
             }

+ 1 - 1
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);