aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleArc.cpp
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-05 16:21:03 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-05 16:21:03 +0000
commitbbff1d507aa3f470139e2df409e94074a2f9425f (patch)
tree1c58cdd9211057604ad3b3c804637e784f83ce3c /samplecode/SampleArc.cpp
parentec3d6e5a2fada32dfc762ed82ca6155746f664a3 (diff)
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
Diffstat (limited to 'samplecode/SampleArc.cpp')
-rw-r--r--samplecode/SampleArc.cpp14
1 files changed, 14 insertions, 0 deletions
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);
}