diff --git a/VERSIONS.txt b/VERSIONS.txt index 154113b1..c3017ae2 100644 --- a/VERSIONS.txt +++ b/VERSIONS.txt @@ -31,7 +31,7 @@ Xamarin.Forms reference 4.4.0.991757 # - milestone: the skia milestone determined by Google/Chromium # - increment: the C API version increment caused by new APIs libSkiaSharp milestone 80 -libSkiaSharp increment 0 +libSkiaSharp increment 1 # native sonames libSkiaSharp soname 80.0.0 diff --git a/binding/Binding/SKFont.cs b/binding/Binding/SKFont.cs index 2e4bc7e7..b9604220 100644 --- a/binding/Binding/SKFont.cs +++ b/binding/Binding/SKFont.cs @@ -315,7 +315,9 @@ namespace SkiaSharp if (!ValidateTextArgs (text, length, encoding)) return 0; - return SkiaApi.sk_font_measure_text (Handle, text, (IntPtr)length, encoding, bounds, paint?.Handle ?? IntPtr.Zero); + float measuredWidth; + SkiaApi.sk_font_measure_text_no_return (Handle, text, (IntPtr)length, encoding, bounds, paint?.Handle ?? IntPtr.Zero, &measuredWidth); + return measuredWidth; } // MeasureText (glyphs) diff --git a/binding/Binding/SkiaApi.generated.cs b/binding/Binding/SkiaApi.generated.cs index 2881983b..285c7f97 100644 --- a/binding/Binding/SkiaApi.generated.cs +++ b/binding/Binding/SkiaApi.generated.cs @@ -3945,6 +3945,20 @@ namespace SkiaSharp (sk_font_measure_text_delegate ??= GetSymbol ("sk_font_measure_text")).Invoke (font, text, byteLength, encoding, bounds, paint); #endif + // void sk_font_measure_text_no_return(const sk_font_t* font, const void* text, size_t byteLength, sk_text_encoding_t encoding, sk_rect_t* bounds, const sk_paint_t* paint, float* measuredWidth) + #if !USE_DELEGATES + [DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)] + internal static extern void sk_font_measure_text_no_return (sk_font_t font, void* text, /* size_t */ IntPtr byteLength, SKTextEncoding encoding, SKRect* bounds, sk_paint_t paint, Single* measuredWidth); + #else + private partial class Delegates { + [UnmanagedFunctionPointer (CallingConvention.Cdecl)] + internal delegate void sk_font_measure_text_no_return (sk_font_t font, void* text, /* size_t */ IntPtr byteLength, SKTextEncoding encoding, SKRect* bounds, sk_paint_t paint, Single* measuredWidth); + } + private static Delegates.sk_font_measure_text_no_return sk_font_measure_text_no_return_delegate; + internal static void sk_font_measure_text_no_return (sk_font_t font, void* text, /* size_t */ IntPtr byteLength, SKTextEncoding encoding, SKRect* bounds, sk_paint_t paint, Single* measuredWidth) => + (sk_font_measure_text_no_return_delegate ??= GetSymbol ("sk_font_measure_text_no_return")).Invoke (font, text, byteLength, encoding, bounds, paint, measuredWidth); + #endif + // sk_font_t* sk_font_new() #if !USE_DELEGATES [DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)] diff --git a/externals/skia b/externals/skia index 4fa635eb..e85c747b 160000 --- a/externals/skia +++ b/externals/skia @@ -1 +1 @@ -Subproject commit 4fa635eb7f02f95ef846642cff42c0f138b849ec +Subproject commit e85c747b9bb4232435b994d5e286ca689ce3ea88