From 975df659a051dfd8bf0047a8ac59c102395c593a Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Wed, 24 Aug 2016 01:45:49 +0200 Subject: [PATCH] Make sure to marshal the SKMatrix as a reference closes #142 --- binding/Binding/SKPathEffect.cs | 4 ++-- binding/Binding/SkiaApi.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/binding/Binding/SKPathEffect.cs b/binding/Binding/SKPathEffect.cs index ec23f01090..47ee32d505 100644 --- a/binding/Binding/SKPathEffect.cs +++ b/binding/Binding/SKPathEffect.cs @@ -71,14 +71,14 @@ public static SKPathEffect Create1DPath(SKPath path, float advance, float phase, public static SKPathEffect Create2DLine(float width, SKMatrix matrix) { - return GetObject(SkiaApi.sk_path_effect_create_2d_line(width, matrix)); + return GetObject(SkiaApi.sk_path_effect_create_2d_line(width, ref matrix)); } public static SKPathEffect Create2DPath(SKMatrix matrix, SKPath path) { if (path == null) throw new ArgumentNullException(nameof(path)); - return GetObject(SkiaApi.sk_path_effect_create_2d_path(matrix, path.Handle)); + return GetObject(SkiaApi.sk_path_effect_create_2d_path(ref matrix, path.Handle)); } public static SKPathEffect CreateDash(float[] intervals, float phase) diff --git a/binding/Binding/SkiaApi.cs b/binding/Binding/SkiaApi.cs index 3b8b2c3ada..4cf926b061 100755 --- a/binding/Binding/SkiaApi.cs +++ b/binding/Binding/SkiaApi.cs @@ -985,9 +985,9 @@ internal static class SkiaApi [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static sk_path_effect_t sk_path_effect_create_1d_path(sk_path_t path, float advance, float phase, SkPath1DPathEffectStyle style); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] - public extern static sk_path_effect_t sk_path_effect_create_2d_line(float width, SKMatrix matrix); + public extern static sk_path_effect_t sk_path_effect_create_2d_line(float width, ref SKMatrix matrix); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] - public extern static sk_path_effect_t sk_path_effect_create_2d_path(SKMatrix matrix, sk_path_t path); + public extern static sk_path_effect_t sk_path_effect_create_2d_path(ref SKMatrix matrix, sk_path_t path); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static sk_path_effect_t sk_path_effect_create_dash(float[] intervals, int count, float phase);