aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/skotty/SkottyPriv.h
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/skotty/SkottyPriv.h')
-rw-r--r--experimental/skotty/SkottyPriv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/experimental/skotty/SkottyPriv.h b/experimental/skotty/SkottyPriv.h
index 35b1e847a3..e39994100c 100644
--- a/experimental/skotty/SkottyPriv.h
+++ b/experimental/skotty/SkottyPriv.h
@@ -9,6 +9,7 @@
#define SkottyPriv_DEFINED
#include "SkJSONCPP.h"
+#include "SkPoint.h"
#include "SkScalar.h"
#include "SkString.h"
@@ -36,6 +37,13 @@ static inline bool ParseBool(const Json::Value& v, bool defaultValue) {
? v.asBool() : defaultValue;
}
+static inline SkPoint ParsePoint(const Json::Value& v, const SkPoint& defaultValue) {
+ return v.isObject()
+ ? SkPoint::Make(ParseScalar(v["x"], defaultValue.x()),
+ ParseScalar(v["y"], defaultValue.y()))
+ : defaultValue;
+}
+
} // namespace
#endif // SkottyPriv_DEFINED