Browse Source

Merge pull request #873 from kekekeks/skia-linux-workaround

Workaround for invalid SKImageInfo.PlatformColorType on Linux
pull/876/head
danwalmsley 10 years ago
committed by GitHub
parent
commit
89a11eaf2b
  1. 6
      src/Skia/Avalonia.Skia/BitmapImpl.cs

6
src/Skia/Avalonia.Skia/BitmapImpl.cs

@ -24,7 +24,11 @@ namespace Avalonia.Skia
{
PixelHeight = height;
PixelWidth = width;
Bitmap = new SKBitmap(width, height, SKImageInfo.PlatformColorType, SKAlphaType.Premul);
var colorType = SKImageInfo.PlatformColorType;
var runtime = AvaloniaLocator.Current?.GetService<IRuntimePlatform>()?.GetRuntimeInfo();
if (runtime?.IsDesktop == true && runtime?.OperatingSystem == OperatingSystemType.Linux)
colorType = SKColorType.Bgra8888;
Bitmap = new SKBitmap(width, height, colorType, SKAlphaType.Premul);
}
public void Dispose()

Loading…
Cancel
Save