From ad75683a54eb8e3001d28fd316b6fd9a6be8d3ae Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Sat, 14 Jan 2017 21:06:42 +0200 Subject: [PATCH] Updated the C# API to match the changed C API --- binding/Binding/SKPicture.cs | 12 +++++++++++- binding/Binding/SKPictureRecorder.cs | 4 ++-- binding/Binding/SKRegion.cs | 8 +++++++- binding/Binding/SkiaApi.cs | 4 ++-- docs/en/SkiaSharp/SKPictureRecorder.xml | 8 ++++---- externals/skia | 2 +- 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/binding/Binding/SKPicture.cs b/binding/Binding/SKPicture.cs index d897ab07..2b227926 100644 --- a/binding/Binding/SKPicture.cs +++ b/binding/Binding/SKPicture.cs @@ -29,7 +29,17 @@ namespace SkiaSharp } public uint UniqueId => SkiaApi.sk_picture_get_unique_id (Handle); - public SKRect Bounds => SkiaApi.sk_picture_get_bounds (Handle); + + [Obsolete("Use CullRect instead.")] + public SKRect Bounds => CullRect; + + public SKRect CullRect { + get { + SKRect rect = SKRect.Empty; + SkiaApi.sk_picture_get_cull_rect (Handle, ref rect); + return rect; + } + } } } diff --git a/binding/Binding/SKPictureRecorder.cs b/binding/Binding/SKPictureRecorder.cs index 4b35a8a3..78ba18a2 100644 --- a/binding/Binding/SKPictureRecorder.cs +++ b/binding/Binding/SKPictureRecorder.cs @@ -36,9 +36,9 @@ namespace SkiaSharp } } - public SKCanvas BeginRecording (SKRect rect) + public SKCanvas BeginRecording (SKRect cullRect) { - return GetObject (SkiaApi.sk_picture_recorder_begin_recording (Handle, ref rect), false); + return GetObject (SkiaApi.sk_picture_recorder_begin_recording (Handle, ref cullRect), false); } public SKPicture EndRecording () diff --git a/binding/Binding/SKRegion.cs b/binding/Binding/SKRegion.cs index d533b9a9..551f5e2a 100755 --- a/binding/Binding/SKRegion.cs +++ b/binding/Binding/SKRegion.cs @@ -33,7 +33,13 @@ namespace SkiaSharp { } - public SKRectI Bounds => SkiaApi.sk_region_get_bounds(Handle); + public SKRectI Bounds { + get { + SKRectI rect = SKRectI.Empty; + SkiaApi.sk_region_get_bounds(Handle, ref rect); + return rect; + } + } public bool Contains(SKRegion src) { diff --git a/binding/Binding/SkiaApi.cs b/binding/Binding/SkiaApi.cs index 62d8d1b3..98012924 100755 --- a/binding/Binding/SkiaApi.cs +++ b/binding/Binding/SkiaApi.cs @@ -763,7 +763,7 @@ namespace SkiaSharp [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static uint sk_picture_get_unique_id(sk_picture_t p); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] - public extern static SKRect sk_picture_get_bounds(sk_picture_t p); + public extern static void sk_picture_get_cull_rect(sk_picture_t p, ref SKRect rect); // SkShader [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] @@ -1305,7 +1305,7 @@ namespace SkiaSharp [return: MarshalAs(UnmanagedType.I1)] public extern static bool sk_region_op2(sk_region_t r, sk_region_t src, SKRegionOperation op); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] - public extern static SKRectI sk_region_get_bounds(sk_region_t r); + public extern static void sk_region_get_bounds(sk_region_t r, ref SKRectI rect); } } diff --git a/docs/en/SkiaSharp/SKPictureRecorder.xml b/docs/en/SkiaSharp/SKPictureRecorder.xml index a80cafd6..efc63aa2 100644 --- a/docs/en/SkiaSharp/SKPictureRecorder.xml +++ b/docs/en/SkiaSharp/SKPictureRecorder.xml @@ -46,8 +46,8 @@ - - + + Method 1.0.0.0 @@ -63,10 +63,10 @@ SkiaSharp.SKCanvas - + - The culling rectangle for the new picture. + The culling rectangle for the new picture. Start the recording process and return the recording canvas. Returns the current recording canvas. The same can be retrieved usingĀ . diff --git a/externals/skia b/externals/skia index 4c50de37..9c8be5a3 160000 --- a/externals/skia +++ b/externals/skia @@ -1 +1 @@ -Subproject commit 4c50de3780c86e24326d95898304398b0b002a05 +Subproject commit 9c8be5a39d3f884562e0fe0344772c3bc92413f5