diff --git a/binding/Binding/SKCanvas.cs b/binding/Binding/SKCanvas.cs index b93e1ddc..e7db3fb0 100644 --- a/binding/Binding/SKCanvas.cs +++ b/binding/Binding/SKCanvas.cs @@ -19,6 +19,14 @@ namespace SkiaSharp { } + public SKCanvas (SKBitmap bitmap) + : this (IntPtr.Zero, true) + { + if (bitmap == null) + throw new ArgumentNullException (nameof (bitmap)); + Handle = SkiaApi.sk_canvas_new_from_bitmap (bitmap.Handle); + } + public int Save () { if (Handle == IntPtr.Zero) diff --git a/binding/Binding/SkiaApi.cs b/binding/Binding/SkiaApi.cs index e75cbba6..03e903d9 100755 --- a/binding/Binding/SkiaApi.cs +++ b/binding/Binding/SkiaApi.cs @@ -175,6 +175,8 @@ namespace SkiaSharp [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] public extern static bool sk_canvas_get_clip_bounds(sk_canvas_t t, ref SKRect cbounds); + [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] + public extern static sk_canvas_t sk_canvas_new_from_bitmap(sk_bitmap_t bitmap); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static sk_paint_t sk_paint_new(); diff --git a/skia b/skia index 4c78a3f6..e059dab9 160000 --- a/skia +++ b/skia @@ -1 +1 @@ -Subproject commit 4c78a3f640ba324ac0fc8609f3e7870dd7dae202 +Subproject commit e059dab91769c3de9e15133ec1d855a93d40c693