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

Update skia to milestone 117 #3047

Merged
merged 7 commits into from
Oct 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More API changes
  • Loading branch information
mattleibow committed Oct 28, 2024
commit d5471135ec2bf43fb673d7ddb2cefea16563799f
7 changes: 7 additions & 0 deletions binding/SkiaSharp/SKCanvas.cs
Original file line number Diff line number Diff line change
@@ -711,6 +711,13 @@ public void DrawTextOnPath (string text, SKPath path, SKPoint offset, bool warpG
}
}

// Surface

#nullable enable
public SKSurface? Surface =>
SKSurface.GetObject (SkiaApi.sk_get_surface (Handle), owns: false, unrefExisting: false);
#nullable disable

// Context

#nullable enable
6 changes: 3 additions & 3 deletions binding/SkiaSharp/SKSurface.cs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

namespace SkiaSharp
{
public unsafe class SKSurface : SKObject, ISKReferenceCounted, ISKSkipObjectRegistration
public unsafe class SKSurface : SKObject, ISKReferenceCounted
{
internal SKSurface (IntPtr h, bool owns)
: base (h, owns)
@@ -329,7 +329,7 @@ public void Flush (bool submit, bool synchronous = false)
grContext.Flush ();
}

internal static SKSurface GetObject (IntPtr handle) =>
handle == IntPtr.Zero ? null : new SKSurface (handle, true);
internal static SKSurface GetObject (IntPtr handle, bool owns = true, bool unrefExisting = true) =>
GetOrAddObject (handle, owns, unrefExisting, (h, o) => new SKSurface (h, o));
}
}
19 changes: 19 additions & 0 deletions binding/SkiaSharp/SkiaApi.generated.cs
Original file line number Diff line number Diff line change
@@ -3183,6 +3183,25 @@ internal static gr_recording_context_t sk_get_recording_context (sk_canvas_t can
(sk_get_recording_context_delegate ??= GetSymbol<Delegates.sk_get_recording_context> ("sk_get_recording_context")).Invoke (canvas);
#endif

// sk_surface_t* sk_get_surface(sk_canvas_t* canvas)
#if !USE_DELEGATES
#if USE_LIBRARY_IMPORT
[LibraryImport (SKIA)]
internal static partial sk_surface_t sk_get_surface (sk_canvas_t canvas);
#else // !USE_LIBRARY_IMPORT
[DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)]
internal static extern sk_surface_t sk_get_surface (sk_canvas_t canvas);
#endif
#else
private partial class Delegates {
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
internal delegate sk_surface_t sk_get_surface (sk_canvas_t canvas);
}
private static Delegates.sk_get_surface sk_get_surface_delegate;
internal static sk_surface_t sk_get_surface (sk_canvas_t canvas) =>
(sk_get_surface_delegate ??= GetSymbol<Delegates.sk_get_surface> ("sk_get_surface")).Invoke (canvas);
#endif

// void sk_nodraw_canvas_destroy(sk_nodraw_canvas_t* t)
#if !USE_DELEGATES
#if USE_LIBRARY_IMPORT
2 changes: 1 addition & 1 deletion externals/skia