Browse Source

disable optimizations for method.

pull/3890/head
Dan Walmsley 6 years ago
parent
commit
4dbaaf4b1f
  1. 6
      src/Skia/Avalonia.Skia/ImmutableBitmap.cs

6
src/Skia/Avalonia.Skia/ImmutableBitmap.cs

@ -54,10 +54,8 @@ namespace Avalonia.Skia
Dpi = new Vector(96, 96);
}
// NOTE, putting the stream before options in the parameters, causes an exception
// inside SKCodec.Create with optimized code. Probably a bug in .net compiler.
// Other option is to have the argument order as desired and use PreserveSig options.
[MethodImpl(MethodImplOptions.PreserveSig)]
//NOTE: SKCodec.Create randomly crashes when optimizations are enabled.
[MethodImpl(MethodImplOptions.NoOptimization)]
public ImmutableBitmap(Stream stream, int decodeSize, bool horizontal, BitmapInterpolationMode interpolationMode)
{
// create the codec

Loading…
Cancel
Save