Skip to content

Commit

Permalink
Throw if methods were not found
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkatz6 committed Jun 30, 2023
1 parent 1489fcc commit 6499bbd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Skia/Avalonia.Skia/Gpu/Metal/SkiaMetalApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@ public SkiaMetalApi()
_gr_direct_context_make_metal_with_options =
(delegate* unmanaged[Stdcall] <IntPtr, IntPtr, IntPtr, IntPtr>)address;
}
else
{
throw new InvalidOperationException(
"Unable to export gr_direct_context_make_metal_with_options. Make sure SkiaSharp is up to date.");
}

if(NativeLibraryEx.TryGetExport(dll, "gr_backendrendertarget_new_metal", out address))
{
_gr_backendrendertarget_new_metal =
(delegate* unmanaged[Stdcall]<int, int, int, GRMtlTextureInfoNative*, IntPtr>)address;
}
else
{
throw new InvalidOperationException(
"Unable to export gr_backendrendertarget_new_metal. Make sure SkiaSharp is up to date.");
}

_contextCtor = typeof(GRContext).GetConstructor(
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null,
Expand Down

0 comments on commit 6499bbd

Please sign in to comment.