[Skia/C] Add bindings for SKPath Reset/Rewind
authorMiguel de Icaza <miguel@gnome.org>
Sat, 2 Jul 2016 02:47:24 +0000 (22:47 -0400)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 2 Jul 2016 02:47:35 +0000 (22:47 -0400)
include/c/sk_path.h
src/c/xamarin/sk_x_path.cpp

index 6b4e83d3b2a69c4bfd2149a599265610a28ff3cc..a508cd8b0b076481fee52c80fb21b0f1c4fbf6f5 100644 (file)
@@ -79,6 +79,21 @@ SK_API void sk_path_add_oval(sk_path_t*, const sk_rect_t*, sk_path_direction_t);
  */
 SK_API bool sk_path_get_bounds(const sk_path_t*, sk_rect_t*);
 
+/**
+   Clear any lines and curves from the path, making it empty. This frees up
+   internal storage associated with those segments.
+   On Android, does not change fSourcePath.
+ */
+SK_API void sk_path_reset (sk_path_t* cpath);
+
+/**
+   Similar to sk_path_reset (), in that all lines and curves are removed from the
+   path. However, any internal storage for those lines/curves is retained,
+   making reuse of the path potentially faster.
+   On Android, does not change fSourcePath.   
+ */
+SK_API void sk_path_rewind (sk_path_t* cpath);
+
 SK_C_PLUS_PLUS_END_GUARD
 
 #endif
index 83c7c46e367766d088d3312eb62c441f5a3ec8a3..93f6066ca2ded9ee2d34fabceebe159bab5bd4c9 100644 (file)
@@ -74,3 +74,12 @@ sk_path_t* sk_path_clone(const sk_path_t* cpath)
     return (sk_path_t*)new SkPath(AsPath(*cpath));
 }
 
+void sk_path_rewind (sk_path_t* cpath)
+{
+    as_path (cpath)->rewind ();
+}
+
+void sk_path_reset (sk_path_t* cpath)
+{
+    as_path (cpath)->reset ();
+}