Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the docs and other doc-y stuff #644

Merged
merged 10 commits into from
Sep 28, 2018
  •  
  •  
  •  
18 changes: 1 addition & 17 deletions binding/Binding/Definitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,29 +330,13 @@ public enum SKTransferFunctionBehavior {
}


[StructLayout(LayoutKind.Sequential)]
[StructLayout (LayoutKind.Sequential)]
internal unsafe struct SKCodecOptionsInternal {
public SKZeroInitialized fZeroInitialized;
public SKRectI* fSubset;
public int fFrameIndex;
public int fPriorFrame;
public SKTransferFunctionBehavior fPremulBehavior;

public static unsafe SKCodecOptionsInternal FromManaged (ref SKCodecOptions managed)
{
var nativeOptions = new SKCodecOptionsInternal {
fZeroInitialized = managed.ZeroInitialized,
fSubset = null,
fFrameIndex = managed.FrameIndex,
fPriorFrame = managed.PriorFrame,
fPremulBehavior = managed.PremulBehavior,
};
if (managed.HasSubset) {
var subset = managed.Subset.Value;
nativeOptions.fSubset = ⊂
}
return nativeOptions;
}
}

public struct SKCodecOptions {
Expand Down
50 changes: 44 additions & 6 deletions binding/Binding/SKCodec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,22 @@ public SKCodecResult GetPixels (SKImageInfo info, IntPtr pixels, int rowBytes, S
if (pixels == IntPtr.Zero)
throw new ArgumentNullException (nameof (pixels));

var nOptions = SKCodecOptionsInternal.FromManaged (ref options);
var nInfo = SKImageInfoNative.FromManaged (ref info);

return SkiaApi.sk_codec_get_pixels (Handle, ref nInfo, pixels, (IntPtr)rowBytes, ref nOptions);
unsafe {
var nOptions = new SKCodecOptionsInternal {
fZeroInitialized = options.ZeroInitialized,
fSubset = null,
fFrameIndex = options.FrameIndex,
fPriorFrame = options.PriorFrame,
fPremulBehavior = options.PremulBehavior,
};
if (options.HasSubset) {
var subset = options.Subset.Value;
nOptions.fSubset = ⊂
}
return SkiaApi.sk_codec_get_pixels (Handle, ref nInfo, pixels, (IntPtr)rowBytes, ref nOptions);
}
}

[Obsolete ("The Index8 color type and color table is no longer supported. Use GetPixels(SKImageInfo, IntPtr, int, SKCodecOptions) instead.")]
Expand Down Expand Up @@ -176,10 +188,23 @@ public SKCodecResult StartIncrementalDecode (SKImageInfo info, IntPtr pixels, in
if (pixels == IntPtr.Zero)
throw new ArgumentNullException (nameof (pixels));

var nOptions = SKCodecOptionsInternal.FromManaged (ref options);
var nInfo = SKImageInfoNative.FromManaged (ref info);

return SkiaApi.sk_codec_start_incremental_decode (Handle, ref nInfo, pixels, (IntPtr)rowBytes, ref nOptions);
unsafe {
var nOptions = new SKCodecOptionsInternal {
fZeroInitialized = options.ZeroInitialized,
fSubset = null,
fFrameIndex = options.FrameIndex,
fPriorFrame = options.PriorFrame,
fPremulBehavior = options.PremulBehavior,
};
if (options.HasSubset) {
var subset = options.Subset.Value;
nOptions.fSubset = ⊂
}

return SkiaApi.sk_codec_start_incremental_decode (Handle, ref nInfo, pixels, (IntPtr)rowBytes, ref nOptions);
}
}

public SKCodecResult StartIncrementalDecode (SKImageInfo info, IntPtr pixels, int rowBytes)
Expand Down Expand Up @@ -212,10 +237,23 @@ public SKCodecResult StartScanlineDecode (SKImageInfo info, SKCodecOptions optio

public SKCodecResult StartScanlineDecode (SKImageInfo info, SKCodecOptions options)
{
var nOptions = SKCodecOptionsInternal.FromManaged (ref options);
var nInfo = SKImageInfoNative.FromManaged (ref info);

return SkiaApi.sk_codec_start_scanline_decode (Handle, ref nInfo, ref nOptions);
unsafe {
var nOptions = new SKCodecOptionsInternal {
fZeroInitialized = options.ZeroInitialized,
fSubset = null,
fFrameIndex = options.FrameIndex,
fPriorFrame = options.PriorFrame,
fPremulBehavior = options.PremulBehavior,
};
if (options.HasSubset) {
var subset = options.Subset.Value;
nOptions.fSubset = ⊂
}

return SkiaApi.sk_codec_start_scanline_decode (Handle, ref nInfo, ref nOptions);
}
}

public SKCodecResult StartScanlineDecode (SKImageInfo info)
Expand Down
5 changes: 3 additions & 2 deletions cake/BuildExternals.cake
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,9 @@ Task ("externals-angle-uwp")
.WithCriteria (!FileExists (ANGLE_PATH.CombineWithFilePath ("uwp/ANGLE.WindowsStore.nuspec")))
.Does (() =>
{
var version = GetVersion ("ANGLE.WindowsStore", "release");
var angleUrl = $"https://www.nuget.org/api/v2/package/ANGLE.WindowsStore/{version}";
var id = "ANGLE.WindowsStore";
var version = GetVersion (id, "release");
var angleUrl = $"https://api.nuget.org/v3-flatcontainer/{id.ToLower ()}/{version}/{id.ToLower ()}.{version}.nupkg";
var angleRoot = ANGLE_PATH.Combine ("uwp");
var angleNupkg = angleRoot.CombineWithFilePath ($"angle_{version}.nupkg");

Expand Down
8 changes: 5 additions & 3 deletions cake/UpdateDocs.cake
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ Task ("docs-api-diff")
Information ($"Comparing the assemblies in '{id}'...");

var version = GetVersion (id);
var latestVersion = (await NuGetVersions.GetLatestAsync (id)).ToNormalizedString ();
var latestVersion = (await NuGetVersions.GetLatestAsync (id))?.ToNormalizedString ();
Debug ($"Version '{latestVersion}' is the latest version of '{id}'...");

// pre-cache so we can have better logs
Debug ($"Caching version '{latestVersion}' of '{id}'...");
await comparer.ExtractCachedPackageAsync (id, latestVersion);
if (!string.IsNullOrEmpty (latestVersion)) {
Debug ($"Caching version '{latestVersion}' of '{id}'...");
await comparer.ExtractCachedPackageAsync (id, latestVersion);
}

// generate the diff and copy to the changelogs
Debug ($"Running a diff on '{latestVersion}' vs '{version}' of '{id}'...");
Expand Down
5 changes: 5 additions & 0 deletions changelogs/HarfBuzzSharp/1.4.6.2/HarfBuzzSharp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# API diff: HarfBuzzSharp.dll

## HarfBuzzSharp.dll

> No changes.
35 changes: 35 additions & 0 deletions changelogs/SkiaSharp.Views.Forms/1.68.0/SkiaSharp.Views.Forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,38 @@

> Assembly Version Changed: 1.68.0.0 vs 1.60.0.0

### Namespace SkiaSharp.Views.Forms

#### Type Changed: SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs

Obsoleted constructors:

```diff
[Obsolete ("Use SKPaintGLSurfaceEventArgs(SKSurface, GRBackendRenderTarget, SKColorType, GRSurfaceOrigin) instead.")]
public SKPaintGLSurfaceEventArgs (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget);
```

Added constructors:

```csharp
public SKPaintGLSurfaceEventArgs (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTarget renderTarget);
public SKPaintGLSurfaceEventArgs (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTarget renderTarget, SkiaSharp.GRSurfaceOrigin origin, SkiaSharp.SKColorType colorType);
```

Obsoleted properties:

```diff
[Obsolete ("Use BackendRenderTarget instead.")]
public SkiaSharp.GRBackendRenderTargetDesc RenderTarget { get; }
```

Added properties:

```csharp
public SkiaSharp.GRBackendRenderTarget BackendRenderTarget { get; }
public SkiaSharp.SKColorType ColorType { get; }
public SkiaSharp.GRSurfaceOrigin Origin { get; }
```



4 changes: 2 additions & 2 deletions changelogs/SkiaSharp.Views/1.55.0/SkiaSharp.Views.iOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class SKCanvasLayer : CoreAnimation.CALayer, CoreAnimation.ICAMediaTiming
#### New Type: SkiaSharp.Views.iOS.SKCanvasView

```csharp
public class SKCanvasView : UIKit.UIView, CoreAnimation.ICALayerDelegate, Foundation.INSCoding, Foundation.INSObjectProtocol, ObjCRuntime.INativeObject, System.Collections.IEnumerable, System.ComponentModel.IComponent, System.IDisposable, System.IEquatable<Foundation.NSObject>, UIKit.IUIAccessibilityIdentification, UIKit.IUIAppearance, UIKit.IUIAppearanceContainer, UIKit.IUICoordinateSpace, UIKit.IUIDynamicItem, UIKit.IUIFocusEnvironment, UIKit.IUIFocusItem, UIKit.IUIPasteConfigurationSupporting, UIKit.IUITraitEnvironment {
public class SKCanvasView : UIKit.UIView, CoreAnimation.ICALayerDelegate, Foundation.INSCoding, Foundation.INSObjectProtocol, ObjCRuntime.INativeObject, System.Collections.IEnumerable, System.ComponentModel.IComponent, System.IDisposable, System.IEquatable<Foundation.NSObject>, UIKit.IUIAccessibilityIdentification, UIKit.IUIAppearance, UIKit.IUIAppearanceContainer, UIKit.IUICoordinateSpace, UIKit.IUIDynamicItem, UIKit.IUIFocusEnvironment, UIKit.IUIFocusItem, UIKit.IUIFocusItemContainer, UIKit.IUIPasteConfigurationSupporting, UIKit.IUITraitEnvironment, UIKit.IUIUserActivityRestoring {
// constructors
public SKCanvasView ();
public SKCanvasView (CoreGraphics.CGRect frame);
Expand Down Expand Up @@ -125,7 +125,7 @@ public class SKGLLayer : CoreAnimation.CAEAGLLayer, CoreAnimation.ICAMediaTiming
#### New Type: SkiaSharp.Views.iOS.SKGLView

```csharp
public class SKGLView : GLKit.GLKView, CoreAnimation.ICALayerDelegate, Foundation.INSCoding, Foundation.INSObjectProtocol, GLKit.IGLKViewDelegate, ObjCRuntime.INativeObject, System.Collections.IEnumerable, System.ComponentModel.IComponent, System.IDisposable, System.IEquatable<Foundation.NSObject>, UIKit.IUIAccessibilityIdentification, UIKit.IUIAppearance, UIKit.IUIAppearanceContainer, UIKit.IUICoordinateSpace, UIKit.IUIDynamicItem, UIKit.IUIFocusEnvironment, UIKit.IUIFocusItem, UIKit.IUIPasteConfigurationSupporting, UIKit.IUITraitEnvironment {
public class SKGLView : GLKit.GLKView, CoreAnimation.ICALayerDelegate, Foundation.INSCoding, Foundation.INSObjectProtocol, GLKit.IGLKViewDelegate, ObjCRuntime.INativeObject, System.Collections.IEnumerable, System.ComponentModel.IComponent, System.IDisposable, System.IEquatable<Foundation.NSObject>, UIKit.IUIAccessibilityIdentification, UIKit.IUIAppearance, UIKit.IUIAppearanceContainer, UIKit.IUICoordinateSpace, UIKit.IUIDynamicItem, UIKit.IUIFocusEnvironment, UIKit.IUIFocusItem, UIKit.IUIFocusItemContainer, UIKit.IUIPasteConfigurationSupporting, UIKit.IUITraitEnvironment, UIKit.IUIUserActivityRestoring {
// constructors
public SKGLView ();
public SKGLView (CoreGraphics.CGRect frame);
Expand Down
4 changes: 2 additions & 2 deletions changelogs/SkiaSharp.Views/1.55.0/SkiaSharp.Views.tvOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class SKCanvasLayer : CoreAnimation.CALayer, CoreAnimation.ICAMediaTiming
#### New Type: SkiaSharp.Views.tvOS.SKCanvasView

```csharp
public class SKCanvasView : UIKit.UIView, CoreAnimation.ICALayerDelegate, Foundation.INSCoding, Foundation.INSObjectProtocol, ObjCRuntime.INativeObject, System.Collections.IEnumerable, System.ComponentModel.IComponent, System.IDisposable, System.IEquatable<Foundation.NSObject>, UIKit.IUIAccessibilityIdentification, UIKit.IUIAppearance, UIKit.IUIAppearanceContainer, UIKit.IUICoordinateSpace, UIKit.IUIDynamicItem, UIKit.IUIFocusEnvironment, UIKit.IUIFocusItem, UIKit.IUITraitEnvironment {
public class SKCanvasView : UIKit.UIView, CoreAnimation.ICALayerDelegate, Foundation.INSCoding, Foundation.INSObjectProtocol, ObjCRuntime.INativeObject, System.Collections.IEnumerable, System.ComponentModel.IComponent, System.IDisposable, System.IEquatable<Foundation.NSObject>, UIKit.IUIAccessibilityIdentification, UIKit.IUIAppearance, UIKit.IUIAppearanceContainer, UIKit.IUICoordinateSpace, UIKit.IUIDynamicItem, UIKit.IUIFocusEnvironment, UIKit.IUIFocusItem, UIKit.IUIFocusItemContainer, UIKit.IUITraitEnvironment, UIKit.IUIUserActivityRestoring {
// constructors
public SKCanvasView ();
public SKCanvasView (CoreGraphics.CGRect frame);
Expand Down Expand Up @@ -125,7 +125,7 @@ public class SKGLLayer : CoreAnimation.CAEAGLLayer, CoreAnimation.ICAMediaTiming
#### New Type: SkiaSharp.Views.tvOS.SKGLView

```csharp
public class SKGLView : GLKit.GLKView, CoreAnimation.ICALayerDelegate, Foundation.INSCoding, Foundation.INSObjectProtocol, GLKit.IGLKViewDelegate, ObjCRuntime.INativeObject, System.Collections.IEnumerable, System.ComponentModel.IComponent, System.IDisposable, System.IEquatable<Foundation.NSObject>, UIKit.IUIAccessibilityIdentification, UIKit.IUIAppearance, UIKit.IUIAppearanceContainer, UIKit.IUICoordinateSpace, UIKit.IUIDynamicItem, UIKit.IUIFocusEnvironment, UIKit.IUIFocusItem, UIKit.IUITraitEnvironment {
public class SKGLView : GLKit.GLKView, CoreAnimation.ICALayerDelegate, Foundation.INSCoding, Foundation.INSObjectProtocol, GLKit.IGLKViewDelegate, ObjCRuntime.INativeObject, System.Collections.IEnumerable, System.ComponentModel.IComponent, System.IDisposable, System.IEquatable<Foundation.NSObject>, UIKit.IUIAccessibilityIdentification, UIKit.IUIAppearance, UIKit.IUIAppearanceContainer, UIKit.IUICoordinateSpace, UIKit.IUIDynamicItem, UIKit.IUIFocusEnvironment, UIKit.IUIFocusItem, UIKit.IUIFocusItemContainer, UIKit.IUITraitEnvironment, UIKit.IUIUserActivityRestoring {
// constructors
public SKGLView ();
public SKGLView (CoreGraphics.CGRect frame);
Expand Down
141 changes: 141 additions & 0 deletions changelogs/SkiaSharp.Views/1.68.0/SkiaSharp.Views.Android.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,144 @@

> Assembly Version Changed: 1.68.0.0 vs 1.60.0.0

### Namespace SkiaSharp.Views.Android

#### Type Changed: SkiaSharp.Views.Android.SKCanvasView

Obsoleted methods:

```diff
[Obsolete ("Use OnPaintSurface(SKPaintSurfaceEventArgs) instead.")]
protected virtual void OnDraw (SkiaSharp.SKSurface surface, SkiaSharp.SKImageInfo info);
```

Added method:

```csharp
protected virtual void OnPaintSurface (SKPaintSurfaceEventArgs e);
```


#### Type Changed: SkiaSharp.Views.Android.SKGLSurfaceView

Added event:

```csharp
public event System.EventHandler<SKPaintGLSurfaceEventArgs> PaintSurface;
```

Obsoleted methods:

```diff
[Obsolete ("Use PaintSurface instead.")]
public virtual void SetRenderer (SKGLSurfaceView.ISKRenderer renderer);
```

Added method:

```csharp
protected virtual void OnPaintSurface (SKPaintGLSurfaceEventArgs e);
```


#### Type Changed: SkiaSharp.Views.Android.SKGLSurfaceViewRenderer

Obsoleted methods:

```diff
[Obsolete ("Use OnPaintSurface(SKPaintGLSurfaceEventArgs) instead.")]
protected virtual void OnDrawFrame (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget);
```

Modified methods:

```diff
-protected abstract void OnDrawFrame (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget)
+protected virtual void OnDrawFrame (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget)
```

Added method:

```csharp
protected virtual void OnPaintSurface (SKPaintGLSurfaceEventArgs e);
```


#### Type Changed: SkiaSharp.Views.Android.SKGLTextureView

Added event:

```csharp
public event System.EventHandler<SKPaintGLSurfaceEventArgs> PaintSurface;
```

Obsoleted methods:

```diff
[Obsolete ("Use PaintSurface instead.")]
public virtual void SetRenderer (SKGLTextureView.ISKRenderer renderer);
```

Added method:

```csharp
protected virtual void OnPaintSurface (SKPaintGLSurfaceEventArgs e);
```


#### Type Changed: SkiaSharp.Views.Android.SKGLTextureViewRenderer

Obsoleted methods:

```diff
[Obsolete ("Use OnPaintSurface(SKPaintGLSurfaceEventArgs) instead.")]
protected virtual void OnDrawFrame (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget);
```

Modified methods:

```diff
-protected abstract void OnDrawFrame (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget)
+protected virtual void OnDrawFrame (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget)
```

Added method:

```csharp
protected virtual void OnPaintSurface (SKPaintGLSurfaceEventArgs e);
```


#### Type Changed: SkiaSharp.Views.Android.SKPaintGLSurfaceEventArgs

Obsoleted constructors:

```diff
[Obsolete ("Use SKPaintGLSurfaceEventArgs(SKSurface, GRBackendRenderTarget, SKColorType, GRSurfaceOrigin) instead.")]
public SKPaintGLSurfaceEventArgs (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget);
```

Added constructors:

```csharp
public SKPaintGLSurfaceEventArgs (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTarget renderTarget);
public SKPaintGLSurfaceEventArgs (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTarget renderTarget, SkiaSharp.GRSurfaceOrigin origin, SkiaSharp.SKColorType colorType);
```

Obsoleted properties:

```diff
[Obsolete ("Use BackendRenderTarget instead.")]
public SkiaSharp.GRBackendRenderTargetDesc RenderTarget { get; }
```

Added properties:

```csharp
public SkiaSharp.GRBackendRenderTarget BackendRenderTarget { get; }
public SkiaSharp.SKColorType ColorType { get; }
public SkiaSharp.GRSurfaceOrigin Origin { get; }
```



Loading