From bbff1d507aa3f470139e2df409e94074a2f9425f Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Fri, 5 Jun 2009 16:21:03 +0000 Subject: add SkParsePath to go to/from SVG strings (e.g. "M0,0 L10,20") git-svn-id: http://skia.googlecode.com/svn/trunk@203 2bbb7eff-a529-9590-31e7-b0007b416f81 --- samplecode/SampleArc.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'samplecode/SampleArc.cpp') diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp index ada1d0a7cf..9deec8193a 100644 --- a/samplecode/SampleArc.cpp +++ b/samplecode/SampleArc.cpp @@ -16,10 +16,24 @@ #include "SkPorterDuff.h" #include "SkLayerRasterizer.h" +#include "SkParsePath.h" +static void testparse() { + SkRect r; + r.set(0, 0, SkFloatToScalar(10), SkFloatToScalar(10.5)); + SkPath p, p2; + SkString str, str2; + + p.addRect(r); + SkParsePath::ToSVGString(p, &str); + SkParsePath::FromSVGString(str.c_str(), &p2); + SkParsePath::ToSVGString(p2, &str2); +} + class ArcsView : public SkView { public: ArcsView() { + testparse(); fSweep = SkIntToScalar(100); } -- cgit v1.2.3