SK_API bool sk_path_contains (const sk_path_t* cpath, float x, float y);
+SK_API sk_path_convexity_t sk_path_get_convexity (const sk_path_t* cpath);
+
+SK_API void sk_path_set_convexity (sk_path_t* cpath, sk_path_convexity_t convexity);
+
+SK_API bool sk_path_parse_svg_string (sk_path_t* cpath, const char* str);
+
+SK_API void sk_path_to_svg_string (const sk_path_t* cpath, sk_string_t* str);
+
SK_API bool sk_path_get_last_point (const sk_path_t* cpath, sk_point_t* point);
SK_API bool sk_pathop_op(const sk_path_t* one, const sk_path_t* two, sk_pathop_t op, sk_path_t* result);
typedef struct sk_opbuilder_t sk_opbuilder_t;
+typedef enum {
+ UNKNOWN_SK_PATH_CONVEXITY,
+ CONVEX_SK_PATH_CONVEXITY,
+ CONCAVE_SK_PATH_CONVEXITY,
+} sk_path_convexity_t;
+
SK_C_PLUS_PLUS_END_GUARD
#endif
static_assert ((int)SkPathOp::kXOR_SkPathOp == (int)XOR_SK_PATHOP, ASSERT_MSG(SkPathOp, sk_pathop_t));
static_assert ((int)SkPathOp::kReverseDifference_SkPathOp == (int)REVERSE_DIFFERENCE_SK_PATHOP, ASSERT_MSG(SkPathOp, sk_pathop_t));
+// sk_path_convexity_t
+static_assert ((int)SkPath::Convexity::kUnknown_Convexity == (int)UNKNOWN_SK_PATH_CONVEXITY, ASSERT_MSG(SkPath::Convexity, sk_path_convexity_t));
+static_assert ((int)SkPath::Convexity::kConvex_Convexity == (int)CONVEX_SK_PATH_CONVEXITY, ASSERT_MSG(SkPath::Convexity, sk_path_convexity_t));
+static_assert ((int)SkPath::Convexity::kConcave_Convexity == (int)CONCAVE_SK_PATH_CONVEXITY, ASSERT_MSG(SkPath::Convexity, sk_path_convexity_t));
+
#endif
#include "SkPath.h"
#include "SkPathOps.h"
+#include "SkParsePath.h"
#include "sk_path.h"
return AsPath(*cpath).contains(x, y);
}
+sk_path_convexity_t sk_path_get_convexity (const sk_path_t* cpath) {
+ return (sk_path_convexity_t)AsPath(*cpath).getConvexity();
+}
+
+void sk_path_set_convexity (sk_path_t* cpath, sk_path_convexity_t convexity) {
+ AsPath(cpath)->setConvexity((SkPath::Convexity)convexity);
+}
+
+SK_API bool sk_path_parse_svg_string (sk_path_t* cpath, const char* str) {
+ return SkParsePath::FromSVGString(str, AsPath(cpath));
+}
+
+SK_API void sk_path_to_svg_string (const sk_path_t* cpath, sk_string_t* str) {
+ SkParsePath::ToSVGString(AsPath(*cpath), AsString(str));
+}
+
bool sk_path_get_last_point (const sk_path_t* cpath, sk_point_t* point) {
if (point) {
return AsPath(*cpath).getLastPt(AsPoint(point));