Skip to content

Commit

Permalink
Remove the [Preserve] attribute (#1229)
Browse files Browse the repository at this point in the history
Since #1209, we no longer use reflection and the linker can go ahead and start removing things.
  • Loading branch information
mattleibow authored Apr 13, 2020
1 parent 2191818 commit cef01f1
Show file tree
Hide file tree
Showing 45 changed files with 0 additions and 62 deletions.
1 change: 0 additions & 1 deletion binding/Binding/GRBackendRenderTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace SkiaSharp
{
public unsafe class GRBackendRenderTarget : SKObject
{
[Preserve]
internal GRBackendRenderTarget (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/GRBackendTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace SkiaSharp
{
public unsafe class GRBackendTexture : SKObject
{
[Preserve]
internal GRBackendTexture (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/GRContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace SkiaSharp
{
public unsafe class GRContext : SKObject, ISKReferenceCounted
{
[Preserve]
internal GRContext (IntPtr h, bool owns)
: base (h, owns)
{
Expand Down
2 changes: 0 additions & 2 deletions binding/Binding/GRGlInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace SkiaSharp
{
public unsafe class GRGlInterface : SKObject, ISKReferenceCounted
{
[Preserve]
internal GRGlInterface (IntPtr h, bool owns)
: base (h, owns)
{
Expand Down Expand Up @@ -234,7 +233,6 @@ public IntPtr GetFunctionPointer(string name)
}

// this structure is initialized from a native pointer
[Preserve (AllMembers = true)]
private struct EvasGlApi
{
// DO NOT change the order, needs to be as specified in struct _Evas_GL_API (/platform/upstream/efl/src/lib/evas/Evas_GL.h)
Expand Down
11 changes: 0 additions & 11 deletions binding/Binding/PreserveAttribute.cs

This file was deleted.

1 change: 0 additions & 1 deletion binding/Binding/SK3dView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SK3dView : SKObject
{
[Preserve]
internal SK3dView (IntPtr x, bool owns)
: base (x, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKBitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public unsafe class SKBitmap : SKObject
private const string UnsupportedColorTypeMessage = "Setting the ColorTable is only supported for bitmaps with ColorTypes of Index8.";
private const string UnableToAllocatePixelsMessage = "Unable to allocate pixels for the bitmap.";

[Preserve]
internal SKBitmap (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public unsafe class SKCanvas : SKObject
private const int PatchCornerCount = 4;
private const int PatchCubicsCount = 12;

[Preserve]
internal SKCanvas (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKCodec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace SkiaSharp

public unsafe class SKCodec : SKObject
{
[Preserve]
internal SKCodec (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKColorFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public unsafe class SKColorFilter : SKObject, ISKReferenceCounted
public const int ColorMatrixSize = 20;
public const int TableMaxLength = 256;

[Preserve]
internal SKColorFilter(IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKColorSpace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ internal static void EnsureStaticInstanceAreInitialized ()
// are initialized before any access is made to them
}

[Preserve]
internal SKColorSpace (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKColorTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public unsafe class SKColorTable : SKObject, ISKReferenceCounted
{
public const int MaxLength = 256;

[Preserve]
internal SKColorTable (IntPtr x, bool owns)
: base (x, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ internal static void EnsureStaticInstanceAreInitialized ()
// are initialized before any access is made to them
}

[Preserve]
internal SKData (IntPtr x, bool owns)
: base (x, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public unsafe class SKDocument : SKObject, ISKReferenceCounted
{
public const float DefaultRasterDpi = 72.0f;

[Preserve]
internal SKDocument (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKDrawable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ protected SKDrawable (bool owns)
}
}

[Preserve]
internal SKDrawable (IntPtr x, bool owns)
: base (x, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKFontManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ internal static void EnsureStaticInstanceAreInitialized ()
// are initialized before any access is made to them
}

[Preserve]
internal SKFontManager (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKFontStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ static SKFontStyle ()
boldItalic = new SKFontStyleStatic (SKFontStyleWeight.Bold, SKFontStyleWidth.Normal, SKFontStyleSlant.Italic);
}

[Preserve]
internal SKFontStyle (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKFontStyleSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace SkiaSharp
{
public class SKFontStyleSet : SKObject, ISKReferenceCounted, IEnumerable<SKFontStyle>, IReadOnlyCollection<SKFontStyle>, IReadOnlyList<SKFontStyle>
{
[Preserve]
internal SKFontStyleSet (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace SkiaSharp

public unsafe class SKImage : SKObject, ISKReferenceCounted
{
[Preserve]
internal SKImage (IntPtr x, bool owns)
: base (x, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKImageFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace SkiaSharp

public unsafe class SKImageFilter : SKObject, ISKReferenceCounted
{
[Preserve]
internal SKImageFilter(IntPtr handle, bool owns)
: base(handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKMaskFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public unsafe class SKMaskFilter : SKObject, ISKReferenceCounted
private const float BlurSigmaScale = 0.57735f;
public const int TableMaxLength = 256;

[Preserve]
internal SKMaskFilter (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKMatrix44.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace SkiaSharp
{
public unsafe class SKMatrix44 : SKObject
{
[Preserve]
internal SKMatrix44 (IntPtr x, bool owns)
: base (x, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKNWayCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public class SKNWayCanvas : SKNoDrawCanvas
{
[Preserve]
internal SKNWayCanvas (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKNoDrawCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public class SKNoDrawCanvas : SKCanvas
{
[Preserve]
internal SKNoDrawCanvas (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ static SKObject ()
SKTypeface.EnsureStaticInstanceAreInitialized ();
}

[Preserve]
internal SKObject (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKOverdrawCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public class SKOverdrawCanvas : SKNWayCanvas
{
[Preserve]
internal SKOverdrawCanvas (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKPaint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SKPaint : SKObject
{
[Preserve]
internal SKPaint (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace SkiaSharp
{
public unsafe class SKPath : SKObject
{
[Preserve]
internal SKPath (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKPathEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SKPathEffect : SKObject, ISKReferenceCounted
{
[Preserve]
internal SKPathEffect (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKPathMeasure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SKPathMeasure : SKObject
{
[Preserve]
internal SKPathMeasure (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKPicture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SKPicture : SKObject, ISKReferenceCounted
{
[Preserve]
internal SKPicture (IntPtr h, bool owns)
: base (h, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKPictureRecorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SKPictureRecorder : SKObject
{
[Preserve]
internal SKPictureRecorder (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKPixmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public unsafe class SKPixmap : SKObject
// this is not meant to be anything but a GC reference to keep the actual pixel data alive
internal SKObject pixelSource;

[Preserve]
internal SKPixmap (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKRegion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SKRegion : SKObject
{
[Preserve]
internal SKRegion (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKRoundRect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SKRoundRect : SKObject
{
[Preserve]
internal SKRoundRect (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKShader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SKShader : SKObject, ISKReferenceCounted
{
[Preserve]
internal SKShader (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
6 changes: 0 additions & 6 deletions binding/Binding/SKStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ internal static SKStream GetObject (IntPtr handle) =>

internal class SKStreamImplementation : SKStream
{
[Preserve]
internal SKStreamImplementation (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down Expand Up @@ -238,7 +237,6 @@ internal SKStreamAsset (IntPtr handle, bool owns)

internal class SKStreamAssetImplementation : SKStreamAsset
{
[Preserve]
internal SKStreamAssetImplementation (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand All @@ -261,7 +259,6 @@ internal SKStreamMemory (IntPtr handle, bool owns)

public unsafe class SKFileStream : SKStreamAsset
{
[Preserve]
internal SKFileStream (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down Expand Up @@ -306,7 +303,6 @@ public static SKStreamAsset OpenStream (string path)

public unsafe class SKMemoryStream : SKStreamMemory
{
[Preserve]
internal SKMemoryStream (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down Expand Up @@ -476,7 +472,6 @@ public static int GetSizeOfPackedUInt32 (UInt32 value)

public unsafe class SKFileWStream : SKWStream
{
[Preserve]
internal SKFileWStream (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down Expand Up @@ -521,7 +516,6 @@ public static SKWStream OpenStream (string path)

public unsafe class SKDynamicMemoryWStream : SKWStream
{
[Preserve]
internal SKDynamicMemoryWStream (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace SkiaSharp
{
internal unsafe class SKString : SKObject
{
[Preserve]
internal SKString (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public unsafe class SKSurface : SKObject, ISKReferenceCounted
[Obsolete ("Use Create(SKImageInfo, IntPtr, int, SKSurfaceProperties) instead.")]
public static SKSurface Create (int width, int height, SKColorType colorType, SKAlphaType alphaType, IntPtr pixels, int rowBytes, SKSurfaceProps props) => Create (new SKImageInfo (width, height, colorType, alphaType), pixels, rowBytes, props);

[Preserve]
internal SKSurface (IntPtr h, bool owns)
: base (h, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKSurfaceProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace SkiaSharp
{
public class SKSurfaceProperties : SKObject
{
[Preserve]
internal SKSurfaceProperties (IntPtr h, bool owns)
: base (h, owns)
{
Expand Down
2 changes: 0 additions & 2 deletions binding/Binding/SKTextBlob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace SkiaSharp
{
public unsafe class SKTextBlob : SKObject, ISKNonVirtualReferenceCounted
{
[Preserve]
internal SKTextBlob (IntPtr x, bool owns)
: base (x, owns)
{
Expand Down Expand Up @@ -33,7 +32,6 @@ internal static SKTextBlob GetObject (IntPtr handle) =>

public unsafe class SKTextBlobBuilder : SKObject
{
[Preserve]
internal SKTextBlobBuilder (IntPtr x, bool owns)
: base (x, owns)
{
Expand Down
1 change: 0 additions & 1 deletion binding/Binding/SKTypeface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ internal static void EnsureStaticInstanceAreInitialized ()
// are initialized before any access is made to them
}

[Preserve]
internal SKTypeface (IntPtr handle, bool owns)
: base (handle, owns)
{
Expand Down
Loading

0 comments on commit cef01f1

Please sign in to comment.