2010-08-10 Dirk Schulze <krit@webkit.org>
[WebKit-https.git] / WebCore / svg / SVGPathByteStreamSource.cpp
index 684843f..e6a60e3 100644 (file)
@@ -41,27 +41,78 @@ bool SVGPathByteStreamSource::hasMoreData() const
     return m_streamCurrent < m_streamEnd;
 }
 
-bool SVGPathByteStreamSource::parseFloat(float& result)
+bool SVGPathByteStreamSource::parseSVGSegmentType(SVGPathSegType& pathSegType)
 {
-    result = readFloat();
+    pathSegType = static_cast<SVGPathSegType>(readSVGSegmentType());
     return true;
 }
 
-bool SVGPathByteStreamSource::parseFlag(bool& result)
+SVGPathSegType SVGPathByteStreamSource::nextCommand(SVGPathSegType)
 {
-    result = readFlag();
+    return static_cast<SVGPathSegType>(readSVGSegmentType());
+}
+
+bool SVGPathByteStreamSource::parseMoveToSegment(FloatPoint& targetPoint)
+{
+    targetPoint = readFloatPoint();
     return true;
 }
 
-bool SVGPathByteStreamSource::parseSVGSegmentType(SVGPathSegType& pathSegType)
+bool SVGPathByteStreamSource::parseLineToSegment(FloatPoint& targetPoint)
 {
-    pathSegType = static_cast<SVGPathSegType>(readSVGSegmentType());
+    targetPoint = readFloatPoint();
     return true;
 }
 
-SVGPathSegType SVGPathByteStreamSource::nextCommand(SVGPathSegType)
+bool SVGPathByteStreamSource::parseLineToHorizontalSegment(float& x)
 {
-    return static_cast<SVGPathSegType>(readSVGSegmentType());
+    x = readFloat();
+    return true;
+}
+
+bool SVGPathByteStreamSource::parseLineToVerticalSegment(float& y)
+{
+    y = readFloat();
+    return true;
+}
+
+bool SVGPathByteStreamSource::parseCurveToCubicSegment(FloatPoint& point1, FloatPoint& point2, FloatPoint& targetPoint)
+{
+    point1 = readFloatPoint();
+    point2 = readFloatPoint();
+    targetPoint = readFloatPoint();
+    return true;
+}
+
+bool SVGPathByteStreamSource::parseCurveToCubicSmoothSegment(FloatPoint& point2, FloatPoint& targetPoint)
+{
+    point2 = readFloatPoint();
+    targetPoint = readFloatPoint();
+    return true;
+}
+
+bool SVGPathByteStreamSource::parseCurveToQuadraticSegment(FloatPoint& point1, FloatPoint& targetPoint)
+{
+    point1 = readFloatPoint();
+    targetPoint = readFloatPoint();
+    return true;
+}
+
+bool SVGPathByteStreamSource::parseCurveToQuadraticSmoothSegment(FloatPoint& targetPoint)
+{
+    targetPoint = readFloatPoint();
+    return true;
+}
+
+bool SVGPathByteStreamSource::parseArcToSegment(float& rx, float& ry, float& angle, bool& largeArc, bool& sweep, FloatPoint& targetPoint)
+{
+    rx = readFloat();
+    ry = readFloat();
+    angle = readFloat();
+    largeArc = readFlag();
+    sweep = readFlag();
+    targetPoint = readFloatPoint();
+    return true;
 }
 
 }