From fa815050b023e6447cc1d30ee6f17ed8a6e2d451 Mon Sep 17 00:00:00 2001 From: Bill Holmes Date: Thu, 7 Apr 2016 21:39:13 -0400 Subject: [PATCH] Adding the 'R' methods to SKPath - RMoveTo - RLineTo - RQuadTo - RConicTo - RCubicTo rArcTo does not exist on this version of Skia. Will have to pick it up on the next bump. --- binding/Binding/SKPath.cs | 25 ++++++ binding/Binding/SkiaApi.cs | 10 +++ docs/en/SkiaSharp/SKPath.xml | 157 ++++++++++++++++++++++++++++++++--- skia | 2 +- 4 files changed, 183 insertions(+), 11 deletions(-) diff --git a/binding/Binding/SKPath.cs b/binding/Binding/SKPath.cs index ea75e1db..de9cc408 100644 --- a/binding/Binding/SKPath.cs +++ b/binding/Binding/SKPath.cs @@ -46,26 +46,51 @@ namespace SkiaSharp SkiaApi.sk_path_move_to (Handle, x, y); } + public void RMoveTo (float dx, float dy) + { + SkiaApi.sk_path_rmove_to (Handle, dx, dy); + } + public void LineTo (float x, float y) { SkiaApi.sk_path_line_to (Handle, x, y); } + public void RLineTo (float dx, float dy) + { + SkiaApi.sk_path_rline_to (Handle, dx, dy); + } + public void QuadTo (float x0, float y0, float x1, float y1) { SkiaApi.sk_path_quad_to (Handle, x0, y0, x1, y1); } + public void RQuadTo (float dx0, float dy0, float dx1, float dy1) + { + SkiaApi.sk_path_rquad_to (Handle, dx0, dy0, dx1, dy1); + } + public void ConicTo (float x0, float y0, float x1, float y1, float w) { SkiaApi.sk_path_conic_to (Handle, x0, y0, x1, y1, w); } + public void RConicTo (float dx0, float dy0, float dx1, float dy1, float w) + { + SkiaApi.sk_path_rconic_to (Handle, dx0, dy0, dx1, dy1, w); + } + public void CubicTo (float x0, float y0, float x1, float y1, float x2, float y2) { SkiaApi.sk_path_cubic_to (Handle, x0, y0, x1, y1, x2, y2); } + public void RCubicTo (float dx0, float dy0, float dx1, float dy1, float dx2, float dy2) + { + SkiaApi.sk_path_rcubic_to (Handle, dx0, dy0, dx1, dy1, dx2, dy2); + } + public void Close () { SkiaApi.sk_path_close (Handle); diff --git a/binding/Binding/SkiaApi.cs b/binding/Binding/SkiaApi.cs index 81a191db..123823dd 100755 --- a/binding/Binding/SkiaApi.cs +++ b/binding/Binding/SkiaApi.cs @@ -275,14 +275,24 @@ namespace SkiaSharp [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_path_move_to(sk_path_t t, float x, float y); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] + public extern static void sk_path_rmove_to(sk_path_t t, float dx, float dy); + [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_path_line_to(sk_path_t t, float x, float y); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] + public extern static void sk_path_rline_to(sk_path_t t, float dx, float dy); + [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_path_quad_to(sk_path_t t, float x0, float y0, float x1, float y1); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] + public extern static void sk_path_rquad_to(sk_path_t t, float dx0, float dy0, float dx1, float dy1); + [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_path_conic_to(sk_path_t t, float x0, float y0, float x1, float y1, float w); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] + public extern static void sk_path_rconic_to(sk_path_t t, float dx0, float dy0, float dx1, float dy1, float w); + [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_path_cubic_to(sk_path_t t, float x0, float y0, float x1, float y1, float x2, float y2); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] + public extern static void sk_path_rcubic_to(sk_path_t t, float dx0, float dy0, float dx1, float dy1, float dx2, float dy2); + [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_path_close(sk_path_t t); [DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)] public extern static void sk_path_add_rect(sk_path_t t, ref SKRect rect, SKPathDirection direction); diff --git a/docs/en/SkiaSharp/SKPath.xml b/docs/en/SkiaSharp/SKPath.xml index 494fba51..c3103d89 100644 --- a/docs/en/SkiaSharp/SKPath.xml +++ b/docs/en/SkiaSharp/SKPath.xml @@ -11,9 +11,11 @@ - Compound geometric paths. + + Same as but the coordinates are considered relative to the last point on this contour. + - The SkPath class encapsulates compound (multiple contour) geometric paths consisting of straight line segments, quadratic curves, and cubic curves. +  If no  call has been made for this contour, the first point is automatically set to (0,0). @@ -51,7 +53,7 @@ The direction to wind the oval's contour. Adds an oval to the current path. - + @@ -117,13 +119,16 @@ - To be added. - To be added. - To be added. - To be added. - To be added. + The x-coordinate of the control point of the conic curve. + The y-coordinate of the control point of the conic curve. + The x-coordinate of the end point of the conic curve. + The y-coordinate of the end point of the conic curve. + The weight of the conic curve. Add a conic path from the last point. - To be added. + +  If no  call has been made for this contour, the first point is automatically set to (0,0). + + @@ -271,7 +276,7 @@ The y-coordinate of the start of a new contour Set the beginning of the next contour to the point. - + @@ -303,5 +308,137 @@ + + + + Method + + 1.49.0.0 + + + System.Void + + + + + + + + + + The amount to add to the x-coordinate of the last point on this contour, to specify the control point of the conic curve. + The amount to add to the y-coordinate of the last point on this contour, to specify the control point of the conic curve. + The amount to add to the x-coordinate of the last point on this contour, to specify the end point of the conic curve. + The amount to add to the y-coordinate of the last point on this contour, to specify the end point of the conic curve. + The weight of the conic curve. + + Same as but the coordinates are considered relative to the last point on this contour. + + +  If no  call has been made for this contour, the first point is automatically set to (0,0). + + + + + + + Method + + 1.49.0.0 + + + System.Void + + + + + + + + + + + The amount to add to the x-coordinate of the last point on this contour, to specify the 1st control point on a cubic curve. + The amount to add to the y-coordinate of the last point on this contour, to specify the 1st control point on a cubic curve. + The amount to add to the x-coordinate of the last point on this contour, to specify the 2nd control point on a cubic curve. + The amount to add to the y-coordinate of the last point on this contour, to specify the 2nd control point on a cubic curve. + The amount to add to the x-coordinate of the last point on this contour, to specify the end point on a cubic curve. + The amount to add to the y-coordinate of the last point on this contour, to specify the end point on a cubic curve. + Same as  but the coordinates are considered relative to the last point on this contour. + +  If no  call has been made for this contour, the first point is automatically set to (0,0). + + + + + + + + Method + + 1.49.0.0 + + + System.Void + + + + + + + The amount to add to the x-coordinate of the last point on this contour, to specify the end of a line. + The amount to add to the y-coordinate of the last point on this contour, to specify the end of a line. + Same as  but the coordinates are considered relative to the last point on this contour. +  If no  call has been made for this contour, the first point is automatically set to (0,0). + + + + + + Method + + 1.49.0.0 + + + System.Void + + + + + + + The amount to add to the x-coordinate of the last point on this contour, to specify the start of a new contour. + The amount to add to the x-coordinate of the last point on this contour, to specify the start of a new contour. + Same as  but the coordinates are considered relative to the last point on this contour. + + + + + + + + + Method + + 1.49.0.0 + + + System.Void + + + + + + + + + The amount to add to the x-coordinate of the last point on this contour, to specify the control point on a quadratic curve. + The amount to add to the y-coordinate of the last point on this contour, to specify the control point on a quadratic curve. + The amount to add to the x-coordinate of the last point on this contour, to specify end point on a quadratic curve. + The amount to add to the y-coordinate of the last point on this contour, to specify end point on a quadratic curve. + Same as  but the coordinates are considered relative to the last point on this contour. +  If no  call has been made for this contour, the first point is automatically set to (0,0). + + diff --git a/skia b/skia index 7040874f..5f60ff4a 160000 --- a/skia +++ b/skia @@ -1 +1 @@ -Subproject commit 7040874fcbcfbfd7222d4ab57b365a29143c7e8d +Subproject commit 5f60ff4a1b531cc192c3b9a46e8f3ddc87d16c2c