[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

krit at webkit.org krit at webkit.org
Wed Dec 22 12:03:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 63d61060319a1ddcc954e842a8406934ae83ac76
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 13 10:15:24 2010 +0000

    2010-08-13  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Use SVGPathByteStream to animate SVGPath
            https://bugs.webkit.org/show_bug.cgi?id=43929
    
            Use SVGPathByteStream to perform animations of Paths. SVGPathBlender blends
            the starting point to the end point according to the current progress value.
            Cleanup SVGPathSegList, by removing the unnecessary legacy blending code.
    
            No new tests because no functional changes.
    
            * Android.mk:
            * CMakeLists.txt:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * svg/SVGAllInOne.cpp:
            * svg/SVGAnimateElement.cpp:
            (WebCore::SVGAnimateElement::SVGAnimateElement):
            (WebCore::SVGAnimateElement::calculateAnimatedValue):
            (WebCore::SVGAnimateElement::calculateFromAndToValues):
            (WebCore::SVGAnimateElement::resetToBaseValue):
            (WebCore::SVGAnimateElement::applyResultsToTarget):
            * svg/SVGAnimateElement.h:
            * svg/SVGPathBlender.cpp: Added.
            (WebCore::SVGPathBlender::SVGPathBlender):
            (WebCore::SVGPathBlender::~SVGPathBlender):
            (WebCore::SVGPathBlender::blendAnimatedFloat):
            (WebCore::SVGPathBlender::blendAnimatedFloatPoint):
            (WebCore::SVGPathBlender::blendMoveToSegment):
            (WebCore::SVGPathBlender::blendLineToSegment):
            (WebCore::SVGPathBlender::blendLineToHorizontalSegment):
            (WebCore::SVGPathBlender::blendLineToVerticalSegment):
            (WebCore::SVGPathBlender::blendCurveToCubicSegment):
            (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment):
            (WebCore::SVGPathBlender::blendCurveToQuadraticSegment):
            (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment):
            (WebCore::SVGPathBlender::blendArcToSegment):
            (WebCore::SVGPathBlender::blendAnimatedPath):
            (WebCore::SVGPathBlender::cleanup):
            * svg/SVGPathBlender.h: Added.
            * svg/SVGPathParserFactory.cpp:
            (WebCore::globalSVGPathBlender):
            (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream):
            * svg/SVGPathParserFactory.h:
            * svg/SVGPathSegList.cpp:
            (WebCore::SVGPathSegList::getPathSegAtLength):
            * svg/SVGPathSegList.h:
            (WebCore::SVGPathSegList::create):
            * svg/SVGPointList.cpp:
            (WebCore::adjustAnimatedValue):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 90ad111..a1aba1f 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -873,6 +873,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
 	svg/SVGNumberList.cpp \
 	svg/SVGPaint.cpp \
 	svg/SVGParserUtilities.cpp \
+	svg/SVGPathBlender.cpp \
 	svg/SVGPathBuilder.cpp \
 	svg/SVGPathByteStreamBuilder.cpp \
 	svg/SVGPathByteStreamSource.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index ac64f66..437de23 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1680,6 +1680,7 @@ IF (ENABLE_SVG)
         svg/SVGNumberList.cpp
         svg/SVGPaint.cpp
         svg/SVGParserUtilities.cpp
+        svg/SVGPathBlender.cpp
         svg/SVGPathBuilder.cpp
         svg/SVGPathByteStreamBuilder.cpp
         svg/SVGPathByteStreamSource.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d049493..dd689ba 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,59 @@
+2010-08-13  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Use SVGPathByteStream to animate SVGPath
+        https://bugs.webkit.org/show_bug.cgi?id=43929
+
+        Use SVGPathByteStream to perform animations of Paths. SVGPathBlender blends
+        the starting point to the end point according to the current progress value.
+        Cleanup SVGPathSegList, by removing the unnecessary legacy blending code.
+
+        No new tests because no functional changes.
+
+        * Android.mk:
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * svg/SVGAllInOne.cpp:
+        * svg/SVGAnimateElement.cpp:
+        (WebCore::SVGAnimateElement::SVGAnimateElement):
+        (WebCore::SVGAnimateElement::calculateAnimatedValue):
+        (WebCore::SVGAnimateElement::calculateFromAndToValues):
+        (WebCore::SVGAnimateElement::resetToBaseValue):
+        (WebCore::SVGAnimateElement::applyResultsToTarget):
+        * svg/SVGAnimateElement.h:
+        * svg/SVGPathBlender.cpp: Added.
+        (WebCore::SVGPathBlender::SVGPathBlender):
+        (WebCore::SVGPathBlender::~SVGPathBlender):
+        (WebCore::SVGPathBlender::blendAnimatedFloat):
+        (WebCore::SVGPathBlender::blendAnimatedFloatPoint):
+        (WebCore::SVGPathBlender::blendMoveToSegment):
+        (WebCore::SVGPathBlender::blendLineToSegment):
+        (WebCore::SVGPathBlender::blendLineToHorizontalSegment):
+        (WebCore::SVGPathBlender::blendLineToVerticalSegment):
+        (WebCore::SVGPathBlender::blendCurveToCubicSegment):
+        (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment):
+        (WebCore::SVGPathBlender::blendCurveToQuadraticSegment):
+        (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment):
+        (WebCore::SVGPathBlender::blendArcToSegment):
+        (WebCore::SVGPathBlender::blendAnimatedPath):
+        (WebCore::SVGPathBlender::cleanup):
+        * svg/SVGPathBlender.h: Added.
+        * svg/SVGPathParserFactory.cpp:
+        (WebCore::globalSVGPathBlender):
+        (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream):
+        * svg/SVGPathParserFactory.h:
+        * svg/SVGPathSegList.cpp:
+        (WebCore::SVGPathSegList::getPathSegAtLength):
+        * svg/SVGPathSegList.h:
+        (WebCore::SVGPathSegList::create):
+        * svg/SVGPointList.cpp:
+        (WebCore::adjustAnimatedValue):
+
 2010-08-12  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Reviewed by Dirk Schulze.
@@ -547,7 +603,7 @@
 
 2010-08-12  Dirk Schulze  <krit at webkit.org>
 
-        Unreviewed sort of XCode project file.
+        Unreviewed sort of Xcode project file.
 
         * WebCore.xcodeproj/project.pbxproj:
 
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index bca2aae..adab026 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -4081,6 +4081,8 @@ webcore_sources += \
 	WebCore/svg/SVGPaint.h \
 	WebCore/svg/SVGParserUtilities.cpp \
 	WebCore/svg/SVGParserUtilities.h \
+	WebCore/svg/SVGPathBlender.cpp \
+	WebCore/svg/SVGPathBlender.h \
 	WebCore/svg/SVGPathBuilder.cpp \
 	WebCore/svg/SVGPathBuilder.h \
 	WebCore/svg/SVGPathByteStream.h \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 74e8126..69f3f99 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3830,6 +3830,8 @@
             'svg/SVGPaint.h',
             'svg/SVGParserUtilities.cpp',
             'svg/SVGParserUtilities.h',
+            'svg/SVGPathBlender.cpp',
+            'svg/SVGPathBlender.h',
             'svg/SVGPathBuilder.cpp',
             'svg/SVGPathBuilder.h',
             'svg/SVGPathByteStream.h',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 4ca9fd0..f82f8f6 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -2863,6 +2863,7 @@ contains(DEFINES, ENABLE_SVG=1) {
         svg/SVGNumberList.cpp \
         svg/SVGPaint.cpp \
         svg/SVGParserUtilities.cpp \
+        svg/SVGPathBlender.cpp \
         svg/SVGPathBuilder.cpp \
         svg/SVGPathByteStreamBuilder.cpp \
         svg/SVGPathByteStreamSource.cpp \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 5ff4250..d47bb23 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -49357,6 +49357,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\svg\SVGPathBlender.h"
+				>
+			</File>
+			<File
 				RelativePath="..\svg\SVGPathBuilder.h"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index f9ed1b4..f12bcc2 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1499,6 +1499,8 @@
 		84B6B978120F13E500B8EFAF /* SVGPathSegListSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */; };
 		84BDA16B11358D2A00DBF64C /* RenderSVGResourceClipper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */; };
 		84BDA16C11358D2A00DBF64C /* RenderSVGResourceClipper.h in Headers */ = {isa = PBXBuildFile; fileRef = 84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */; };
+		84C6784C1214814700A92902 /* SVGPathBlender.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C6784A1214814700A92902 /* SVGPathBlender.cpp */; };
+		84C6784D1214814700A92902 /* SVGPathBlender.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C6784B1214814700A92902 /* SVGPathBlender.h */; };
 		84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D0C4031115F1D40018AA34 /* AffineTransform.cpp */; };
 		84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D0C4051115F1EA0018AA34 /* AffineTransform.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		85004D940ACEEAEF00C438F6 /* DOMSVGDefsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85004D880ACEEAEF00C438F6 /* DOMSVGDefsElement.h */; };
@@ -7348,6 +7350,8 @@
 		84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListSource.h; sourceTree = "<group>"; };
 		84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceClipper.cpp; sourceTree = "<group>"; };
 		84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceClipper.h; sourceTree = "<group>"; };
+		84C6784A1214814700A92902 /* SVGPathBlender.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathBlender.cpp; sourceTree = "<group>"; };
+		84C6784B1214814700A92902 /* SVGPathBlender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathBlender.h; sourceTree = "<group>"; };
 		84D0C4031115F1D40018AA34 /* AffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AffineTransform.cpp; path = transforms/AffineTransform.cpp; sourceTree = "<group>"; };
 		84D0C4051115F1EA0018AA34 /* AffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AffineTransform.h; path = transforms/AffineTransform.h; sourceTree = "<group>"; };
 		85004D880ACEEAEF00C438F6 /* DOMSVGDefsElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGDefsElement.h; sourceTree = "<group>"; };
@@ -15333,6 +15337,8 @@
 				B22278BF0D00BF200071B782 /* SVGPaint.idl */,
 				B22278C00D00BF200071B782 /* SVGParserUtilities.cpp */,
 				B22278C10D00BF200071B782 /* SVGParserUtilities.h */,
+				84C6784A1214814700A92902 /* SVGPathBlender.cpp */,
+				84C6784B1214814700A92902 /* SVGPathBlender.h */,
 				8476C9E711DF6A2900555B02 /* SVGPathBuilder.cpp */,
 				8476C9E811DF6A2900555B02 /* SVGPathBuilder.h */,
 				8419D2A4120D92D000141F8F /* SVGPathByteStream.h */,
@@ -19853,6 +19859,7 @@
 				B2227A510D00BF220071B782 /* SVGNumberList.h in Headers */,
 				B2227A540D00BF220071B782 /* SVGPaint.h in Headers */,
 				B2227A570D00BF220071B782 /* SVGParserUtilities.h in Headers */,
+				84C6784D1214814700A92902 /* SVGPathBlender.h in Headers */,
 				8476C9EB11DF6A2900555B02 /* SVGPathBuilder.h in Headers */,
 				8419D2A7120D92D000141F8F /* SVGPathByteStream.h in Headers */,
 				8419D2A9120D92D000141F8F /* SVGPathByteStreamBuilder.h in Headers */,
@@ -22324,6 +22331,7 @@
 				B2227A500D00BF220071B782 /* SVGNumberList.cpp in Sources */,
 				B2227A530D00BF220071B782 /* SVGPaint.cpp in Sources */,
 				B2227A560D00BF220071B782 /* SVGParserUtilities.cpp in Sources */,
+				84C6784C1214814700A92902 /* SVGPathBlender.cpp in Sources */,
 				8476C9EA11DF6A2900555B02 /* SVGPathBuilder.cpp in Sources */,
 				8419D2A8120D92D000141F8F /* SVGPathByteStreamBuilder.cpp in Sources */,
 				8419D2AC120D92FC00141F8F /* SVGPathByteStreamSource.cpp in Sources */,
diff --git a/WebCore/svg/SVGAllInOne.cpp b/WebCore/svg/SVGAllInOne.cpp
index 6bcf945..df8b916 100644
--- a/WebCore/svg/SVGAllInOne.cpp
+++ b/WebCore/svg/SVGAllInOne.cpp
@@ -107,6 +107,7 @@
 #include "SVGNumberList.cpp"
 #include "SVGPaint.cpp"
 #include "SVGParserUtilities.cpp"
+#include "SVGPathBlender.cpp"
 #include "SVGPathBuilder.cpp"
 #include "SVGPathByteStreamBuilder.cpp"
 #include "SVGPathByteStreamSource.cpp"
diff --git a/WebCore/svg/SVGAnimateElement.cpp b/WebCore/svg/SVGAnimateElement.cpp
index 2723804..df0c3bc 100644
--- a/WebCore/svg/SVGAnimateElement.cpp
+++ b/WebCore/svg/SVGAnimateElement.cpp
@@ -42,6 +42,7 @@ SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* doc
     , m_fromNumber(0)
     , m_toNumber(0)
     , m_animatedNumber(numeric_limits<double>::infinity())
+    , m_animatedPathPointer(0)
 {
 }
 
@@ -131,19 +132,31 @@ void SVGAnimateElement::calculateAnimatedValue(float percentage, unsigned repeat
     }
     AnimationMode animationMode = this->animationMode();
     if (m_propertyType == PathProperty) {
-        if (percentage == 0)
-            results->m_animatedPath = m_fromPath;
-        else if (percentage == 1.f)
-            results->m_animatedPath = m_toPath;
-        else {
-            if (m_fromPath && m_toPath)
-                results->m_animatedPath = SVGPathSegList::createAnimated(m_fromPath.get(), m_toPath.get(), percentage);
-            else
-                results->m_animatedPath.clear();
+        if (!percentage) {
+            ASSERT(m_fromPath);
+            ASSERT(percentage >= 0);
+            results->m_animatedPathPointer = m_fromPath.get();
+        } else if (percentage == 1.f) {
+            ASSERT(m_toPath);
+            results->m_animatedPathPointer = m_toPath.get();
+        } else {
+            if (m_fromPath && m_toPath) {
+                SVGPathParserFactory* factory = SVGPathParserFactory::self();
+                if (!factory->buildAnimatedSVGPathByteStream(m_fromPath.get(), m_toPath.get(), results->m_animatedPath, percentage)) {
+                    results->m_animatedPath.clear();
+                    results->m_animatedPathPointer = 0;
+                } else
+                    results->m_animatedPathPointer = results->m_animatedPath.get();
+            } else
+                results->m_animatedPathPointer = 0;
             // Fall back to discrete animation if the paths are not compatible
-            if (!results->m_animatedPath)
-                results->m_animatedPath = ((animationMode == FromToAnimation && percentage > 0.5f) || animationMode == ToAnimation || percentage == 1.0f) 
-                    ? m_toPath : m_fromPath;
+            if (!results->m_animatedPathPointer) {
+                ASSERT(m_fromPath);
+                ASSERT(m_toPath);
+                ASSERT(!results->m_animatedPath);
+                results->m_animatedPathPointer = ((animationMode == FromToAnimation && percentage > 0.5f) || animationMode == ToAnimation || percentage == 1.0f) 
+                    ? m_toPath.get() : m_fromPath.get();
+            }
         }
         return;
     } else if (m_propertyType == PointsProperty) {
@@ -189,11 +202,9 @@ bool SVGAnimateElement::calculateFromAndToValues(const String& fromString, const
                 return true;
         }
     } else if (m_propertyType == PathProperty) {
-        m_fromPath = SVGPathSegList::create(SVGNames::dAttr);
         SVGPathParserFactory* factory = SVGPathParserFactory::self();
-        if (factory->buildSVGPathSegListFromString(fromString, m_fromPath.get(), UnalteredParsing)) {
-            m_toPath = SVGPathSegList::create(SVGNames::dAttr);
-            if (factory->buildSVGPathSegListFromString(toString, m_toPath.get(), UnalteredParsing))
+        if (factory->buildSVGPathByteStreamFromString(fromString, m_fromPath, UnalteredParsing)) {
+            if (factory->buildSVGPathByteStreamFromString(toString, m_toPath, UnalteredParsing))
                 return true;
         }
         m_fromPath.clear();
@@ -256,6 +267,7 @@ void SVGAnimateElement::resetToBaseValue(const String& baseString)
             return;
     } else if (m_propertyType == PathProperty) {
         m_animatedPath.clear();
+        m_animatedPathPointer = 0;
         return;
     } else if (m_propertyType == PointsProperty) {
         m_animatedPoints.clear();
@@ -272,7 +284,7 @@ void SVGAnimateElement::applyResultsToTarget()
     else if (m_propertyType == NumberProperty)
         valueToApply = String::number(m_animatedNumber) + m_numberUnit;
     else if (m_propertyType == PathProperty) {
-        if (!m_animatedPath || !m_animatedPath->numberOfItems())
+        if (!m_animatedPathPointer || m_animatedPathPointer->isEmpty())
             valueToApply = m_animatedString;
         else {
             // We need to keep going to string and back because we are currently only able to paint
@@ -280,7 +292,7 @@ void SVGAnimateElement::applyResultsToTarget()
             // morphing needs to be done with unprocessed paths.
             // FIXME: This could be optimized if paths were not processed at parse time.
             SVGPathParserFactory* factory = SVGPathParserFactory::self();
-            factory->buildStringFromSVGPathSegList(m_animatedPath.get(), valueToApply, UnalteredParsing);
+            factory->buildStringFromByteStream(m_animatedPathPointer, valueToApply, UnalteredParsing);
         }
     } else if (m_propertyType == PointsProperty) {
         if (!m_animatedPoints || !m_animatedPoints->numberOfItems())
diff --git a/WebCore/svg/SVGAnimateElement.h b/WebCore/svg/SVGAnimateElement.h
index 5c8d1e5..43522a7 100644
--- a/WebCore/svg/SVGAnimateElement.h
+++ b/WebCore/svg/SVGAnimateElement.h
@@ -26,6 +26,8 @@
 
 #include "Color.h"
 #include "SVGAnimationElement.h"
+#include "SVGPathByteStream.h"
+#include <wtf/OwnPtr.h>
 
 namespace WebCore {
     class SVGPathSegList;
@@ -59,9 +61,10 @@ namespace WebCore {
         String m_fromString;
         String m_toString;
         String m_animatedString;
-        RefPtr<SVGPathSegList> m_fromPath;
-        RefPtr<SVGPathSegList> m_toPath;
-        RefPtr<SVGPathSegList> m_animatedPath;
+        OwnPtr<SVGPathByteStream> m_fromPath;
+        OwnPtr<SVGPathByteStream> m_toPath;
+        OwnPtr<SVGPathByteStream> m_animatedPath;
+        SVGPathByteStream* m_animatedPathPointer;
         RefPtr<SVGPointList> m_fromPoints;
         RefPtr<SVGPointList> m_toPoints;
         RefPtr<SVGPointList> m_animatedPoints;
diff --git a/WebCore/svg/SVGPathBlender.cpp b/WebCore/svg/SVGPathBlender.cpp
new file mode 100644
index 0000000..8320890
--- /dev/null
+++ b/WebCore/svg/SVGPathBlender.cpp
@@ -0,0 +1,292 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "SVGPathBlender.h"
+
+#include "SVGPathSeg.h"
+
+namespace WebCore {
+
+SVGPathBlender::SVGPathBlender()
+    : m_fromSource(0)
+    , m_toSource(0)
+    , m_consumer(0)
+    , m_progress(0)
+{
+}
+
+SVGPathBlender::~SVGPathBlender()
+{
+}
+
+float SVGPathBlender::blendAnimatedFloat(float from, float to)
+{
+    return (to - from) * m_progress + from;
+}
+
+FloatPoint SVGPathBlender::blendAnimatedFloatPoint(FloatPoint& from, FloatPoint& to)
+{
+    return FloatPoint((to.x() - from.x()) * m_progress + from.x(), (to.y() - from.y()) * m_progress + from.y());
+}
+
+bool SVGPathBlender::blendMoveToSegment()
+{
+    FloatPoint fromTargetPoint;
+    FloatPoint toTargetPoint;
+    if (!m_fromSource->parseMoveToSegment(fromTargetPoint)
+        || !m_toSource->parseMoveToSegment(toTargetPoint))
+        return false;
+
+    m_consumer->moveTo(blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint), false, m_mode);
+    return true;
+}
+
+bool SVGPathBlender::blendLineToSegment()
+{
+    FloatPoint fromTargetPoint;
+    FloatPoint toTargetPoint;
+    if (!m_fromSource->parseLineToSegment(fromTargetPoint)
+        || !m_toSource->parseLineToSegment(toTargetPoint))
+        return false;
+
+    m_consumer->lineTo(blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint), m_mode);
+    return true;
+}
+
+bool SVGPathBlender::blendLineToHorizontalSegment()
+{
+    float fromX;
+    float toX;
+    if (!m_fromSource->parseLineToHorizontalSegment(fromX)
+        || !m_toSource->parseLineToHorizontalSegment(toX))
+        return false;
+
+    m_consumer->lineToHorizontal(blendAnimatedFloat(fromX, toX), m_mode);
+    return true;
+}
+
+bool SVGPathBlender::blendLineToVerticalSegment()
+{
+    float fromY;
+    float toY;
+    if (!m_fromSource->parseLineToVerticalSegment(fromY)
+        || !m_toSource->parseLineToVerticalSegment(toY))
+        return false;
+
+    m_consumer->lineToVertical(blendAnimatedFloat(fromY, toY), m_mode);
+    return true;
+}
+
+bool SVGPathBlender::blendCurveToCubicSegment()
+{
+    FloatPoint fromTargetPoint;
+    FloatPoint fromPoint1;
+    FloatPoint fromPoint2;
+    FloatPoint toTargetPoint;
+    FloatPoint toPoint1;
+    FloatPoint toPoint2;
+    if (!m_fromSource->parseCurveToCubicSegment(fromPoint1, fromPoint2, fromTargetPoint)
+        || !m_toSource->parseCurveToCubicSegment(toPoint1, toPoint2, toTargetPoint))
+        return false;
+
+    m_consumer->curveToCubic(blendAnimatedFloatPoint(fromPoint1, toPoint1),
+                             blendAnimatedFloatPoint(fromPoint2, toPoint2),
+                             blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint),
+                             m_mode);
+    return true;
+}
+
+bool SVGPathBlender::blendCurveToCubicSmoothSegment()
+{
+    FloatPoint fromTargetPoint;
+    FloatPoint fromPoint2;
+    FloatPoint toTargetPoint;
+    FloatPoint toPoint2;
+    if (!m_fromSource->parseCurveToCubicSmoothSegment(fromPoint2, fromTargetPoint)
+        || !m_toSource->parseCurveToCubicSmoothSegment(toPoint2, toTargetPoint))
+        return false;
+
+    m_consumer->curveToCubicSmooth(blendAnimatedFloatPoint(fromPoint2, toPoint2),
+                                   blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint),
+                                   m_mode);
+    return true;
+}
+
+bool SVGPathBlender::blendCurveToQuadraticSegment()
+{
+    FloatPoint fromTargetPoint;
+    FloatPoint fromPoint1;
+    FloatPoint toTargetPoint;
+    FloatPoint toPoint1;
+    if (!m_fromSource->parseCurveToQuadraticSegment(fromPoint1, fromTargetPoint)
+        || !m_toSource->parseCurveToQuadraticSegment(toPoint1, toTargetPoint))
+        return false;
+
+    m_consumer->curveToQuadratic(blendAnimatedFloatPoint(fromPoint1, toPoint1),
+                                 blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint),
+                                 m_mode);
+    return true;
+}
+
+bool SVGPathBlender::blendCurveToQuadraticSmoothSegment()
+{
+    FloatPoint fromTargetPoint;
+    FloatPoint toTargetPoint;
+    if (!m_fromSource->parseCurveToQuadraticSmoothSegment(fromTargetPoint)
+        || !m_toSource->parseCurveToQuadraticSmoothSegment(toTargetPoint))
+        return false;
+
+    m_consumer->curveToQuadraticSmooth(blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint), m_mode);
+    return true;
+}
+
+bool SVGPathBlender::blendArcToSegment()
+{
+    float fromRx;
+    float fromRy;
+    float fromAngle;
+    bool fromLargeArc;
+    bool fromSweep;
+    FloatPoint fromTargetPoint;
+    float toRx;
+    float toRy;
+    float toAngle;
+    bool toLargeArc;
+    bool toSweep;
+    FloatPoint toTargetPoint;
+    if (!m_fromSource->parseArcToSegment(fromRx, fromRy, fromAngle, fromLargeArc, fromSweep, fromTargetPoint)
+        || !m_toSource->parseArcToSegment(toRx, toRy, toAngle, toLargeArc, toSweep, toTargetPoint))
+        return false;
+
+    m_consumer->arcTo(blendAnimatedFloat(fromRx, toRx),
+                      blendAnimatedFloat(fromRy, toRy),
+                      blendAnimatedFloat(fromAngle, toAngle),
+                      m_progress < 0.5 ? fromLargeArc : toLargeArc,
+                      m_progress < 0.5 ? fromSweep : toSweep,
+                      blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint),
+                      m_mode);
+    return true;
+}
+
+bool SVGPathBlender::blendAnimatedPath(float progress, SVGPathSource* fromSource, SVGPathSource* toSource, SVGPathConsumer* consumer)
+{
+    ASSERT(fromSource);
+    ASSERT(toSource);
+    ASSERT(consumer);
+    m_fromSource = fromSource;
+    m_toSource = toSource;
+    m_consumer = consumer;
+
+    m_progress = progress;
+    while (true) {
+        SVGPathSegType fromCommand;
+        SVGPathSegType toCommand;
+        if (!m_fromSource->parseSVGSegmentType(fromCommand) || !m_toSource->parseSVGSegmentType(toCommand))
+            return false;
+        if (fromCommand != toCommand)
+            return false;
+
+        m_mode = AbsoluteCoordinates;
+        switch (fromCommand) {
+        case PathSegMoveToRel:
+            m_mode = RelativeCoordinates;
+        case PathSegMoveToAbs:
+            if (!blendMoveToSegment())
+                return false;
+            break;
+        case PathSegLineToRel:
+            m_mode = RelativeCoordinates;
+        case PathSegLineToAbs:
+            if (!blendLineToSegment())
+                return false;
+            break;
+        case PathSegLineToHorizontalRel:
+            m_mode = RelativeCoordinates;
+        case PathSegLineToHorizontalAbs:
+            if (!blendLineToHorizontalSegment())
+                return false;
+            break;
+        case PathSegLineToVerticalRel:
+            m_mode = RelativeCoordinates;
+        case PathSegLineToVerticalAbs:
+            if (!blendLineToVerticalSegment())
+                return false;
+            break;
+        case PathSegClosePath:
+            m_consumer->closePath();
+            break;
+        case PathSegCurveToCubicRel:
+            m_mode = RelativeCoordinates;
+        case PathSegCurveToCubicAbs:
+            if (!blendCurveToCubicSegment())
+                return false;
+            break;
+        case PathSegCurveToCubicSmoothRel:
+            m_mode = RelativeCoordinates;
+        case PathSegCurveToCubicSmoothAbs:
+            if (!blendCurveToCubicSmoothSegment())
+                return false;
+            break;
+        case PathSegCurveToQuadraticRel:
+            m_mode = RelativeCoordinates;
+        case PathSegCurveToQuadraticAbs:
+            if (!blendCurveToQuadraticSegment())
+                return false;
+            break;
+        case PathSegCurveToQuadraticSmoothRel:
+            m_mode = RelativeCoordinates;
+        case PathSegCurveToQuadraticSmoothAbs:
+            if (!blendCurveToQuadraticSmoothSegment())
+                return false;
+            break;
+        case PathSegArcRel:
+            m_mode = RelativeCoordinates;
+        case PathSegArcAbs:
+            if (!blendArcToSegment())
+                return false;
+            break;
+        default:
+            return false;
+        }
+        if (m_fromSource->hasMoreData() != m_toSource->hasMoreData())
+            return false;
+        if (!m_fromSource->hasMoreData() || !m_toSource->hasMoreData())
+            break;
+    }
+    return true;
+}
+
+void SVGPathBlender::cleanup()
+{
+    ASSERT(m_toSource);
+    ASSERT(m_fromSource);
+    ASSERT(m_consumer);
+
+    m_consumer->cleanup();
+    m_toSource = 0;
+    m_fromSource = 0;
+    m_consumer = 0;
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGPathBlender.h b/WebCore/svg/SVGPathBlender.h
new file mode 100644
index 0000000..a15c0ad
--- /dev/null
+++ b/WebCore/svg/SVGPathBlender.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGPathBlender_h
+#define SVGPathBlender_h
+
+#if ENABLE(SVG)
+#include "SVGPathConsumer.h"
+#include "SVGPathSource.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class SVGPathBlender : public Noncopyable {
+public:
+    SVGPathBlender();
+    ~SVGPathBlender();
+
+    bool blendAnimatedPath(float, SVGPathSource*, SVGPathSource*, SVGPathConsumer*);
+    void cleanup();
+
+private:
+    bool blendMoveToSegment();
+    bool blendLineToSegment();
+    bool blendLineToHorizontalSegment();
+    bool blendLineToVerticalSegment();
+    bool blendCurveToCubicSegment();
+    bool blendCurveToCubicSmoothSegment();
+    bool blendCurveToQuadraticSegment();
+    bool blendCurveToQuadraticSmoothSegment();
+    bool blendArcToSegment();
+
+    float blendAnimatedFloat(float, float);
+    FloatPoint blendAnimatedFloatPoint(FloatPoint&, FloatPoint&);
+
+    SVGPathSource* m_fromSource;
+    SVGPathSource* m_toSource;
+    SVGPathConsumer* m_consumer;
+    PathCoordinateMode m_mode;
+    float m_progress;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif // SVGPathBlender_h
diff --git a/WebCore/svg/SVGPathParserFactory.cpp b/WebCore/svg/SVGPathParserFactory.cpp
index cf1a888..737e529 100644
--- a/WebCore/svg/SVGPathParserFactory.cpp
+++ b/WebCore/svg/SVGPathParserFactory.cpp
@@ -22,7 +22,7 @@
 #if ENABLE(SVG)
 #include "SVGPathParserFactory.h"
 
-#include "StringBuilder.h"
+#include "SVGPathBlender.h"
 #include "SVGPathBuilder.h"
 #include "SVGPathByteStreamBuilder.h"
 #include "SVGPathByteStreamSource.h"
@@ -31,6 +31,7 @@
 #include "SVGPathSegListSource.h"
 #include "SVGPathStringBuilder.h"
 #include "SVGPathStringSource.h"
+#include "StringBuilder.h"
 
 namespace WebCore {
 
@@ -84,6 +85,15 @@ static SVGPathParser* globalSVGPathParser(SVGPathSource* source, SVGPathConsumer
     return s_parser;
 }
 
+static SVGPathBlender* globalSVGPathBlender()
+{
+    static SVGPathBlender* s_blender = 0;
+    if (!s_blender)
+        s_blender = new SVGPathBlender;
+
+    return s_blender;
+}
+
 SVGPathParserFactory* SVGPathParserFactory::self()
 {
     static SVGPathParserFactory* s_instance = 0;
@@ -224,6 +234,25 @@ bool SVGPathParserFactory::buildSVGPathByteStreamFromString(const String& d, Own
     return ok;
 }
 
+bool SVGPathParserFactory::buildAnimatedSVGPathByteStream(SVGPathByteStream* fromStream, SVGPathByteStream* toStream, OwnPtr<SVGPathByteStream>& result, float progress)
+{
+    ASSERT(fromStream);
+    ASSERT(toStream);
+    if (fromStream->isEmpty() || toStream->isEmpty())
+        return false;
+
+    OwnPtr<SVGPathByteStream> stream = SVGPathByteStream::create();
+    SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(stream.get());
+
+    OwnPtr<SVGPathByteStreamSource> fromSource = SVGPathByteStreamSource::create(fromStream);
+    OwnPtr<SVGPathByteStreamSource> toSource = SVGPathByteStreamSource::create(toStream);
+    SVGPathBlender* blender = globalSVGPathBlender();
+    bool ok = blender->blendAnimatedPath(progress, fromSource.get(), toSource.get(), builder);
+    result = stream.release();
+    blender->cleanup();
+    return ok;
+}
+
 }
 
 #endif
diff --git a/WebCore/svg/SVGPathParserFactory.h b/WebCore/svg/SVGPathParserFactory.h
index 37418d4..64131c0 100644
--- a/WebCore/svg/SVGPathParserFactory.h
+++ b/WebCore/svg/SVGPathParserFactory.h
@@ -46,6 +46,8 @@ public:
 
     bool buildSVGPathByteStreamFromString(const String&, OwnPtr<SVGPathByteStream>&, PathParsingMode);
 
+    bool buildAnimatedSVGPathByteStream(SVGPathByteStream*, SVGPathByteStream*, OwnPtr<SVGPathByteStream>&, float);
+
 private:
     SVGPathParserFactory();
     ~SVGPathParserFactory();
diff --git a/WebCore/svg/SVGPathSegList.cpp b/WebCore/svg/SVGPathSegList.cpp
index b445d3e..b1397ba 100644
--- a/WebCore/svg/SVGPathSegList.cpp
+++ b/WebCore/svg/SVGPathSegList.cpp
@@ -26,19 +26,11 @@
 
 #include "FloatConversion.h"
 #include "FloatPoint.h"
-#include "FloatSize.h"
-#include "Path.h"
 #include "PathTraversalState.h"
-#include "SVGPathSegArc.h"
 #include "SVGPathSegClosePath.h"
 #include "SVGPathSegMoveto.h"
 #include "SVGPathSegLineto.h"
-#include "SVGPathSegLinetoHorizontal.h"
-#include "SVGPathSegLinetoVertical.h"
 #include "SVGPathSegCurvetoCubic.h"
-#include "SVGPathSegCurvetoCubicSmooth.h"
-#include "SVGPathSegCurvetoQuadratic.h"
-#include "SVGPathSegCurvetoQuadraticSmooth.h"
 
 namespace WebCore {
 
@@ -103,126 +95,6 @@ unsigned SVGPathSegList::getPathSegAtLength(double length, ExceptionCode& ec)
     // WebKit/Opera/FF all return the last path segment if the distance exceeds the actual path length:
     return traversalState.m_segmentIndex ? traversalState.m_segmentIndex - 1 : 0;
 }
-    
-float adjustAnimatedValue(float from, float to, float progress)
-{
-    return (to - from) * progress + from;
-}
-    
-#define BLENDPATHSEG1(class, attr1) \
-    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress))
-    
-#define BLENDPATHSEG2(class, attr1, attr2) \
-    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
-                    adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress))
-    
-#define BLENDPATHSEG4(class, attr1, attr2, attr3, attr4) \
-    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress))
-    
-#define BLENDPATHSEG6(class, attr1, attr2, attr3, attr4, attr5, attr6) \
-    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr5(), static_cast<class*>(to)->attr5(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr6(), static_cast<class*>(to)->attr6(), progress))
-
-#define BLENDPATHSEG7(class, attr1, attr2, attr3, attr4, attr5, bool1, bool2) \
-    class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress), \
-                adjustAnimatedValue(static_cast<class*>(from)->attr5(), static_cast<class*>(to)->attr5(), progress), \
-                static_cast<bool>(adjustAnimatedValue(static_cast<class*>(from)->bool1(), static_cast<class*>(to)->bool1(), progress)), \
-                static_cast<bool>(adjustAnimatedValue(static_cast<class*>(from)->bool2(), static_cast<class*>(to)->bool2(), progress)))
-
-PassRefPtr<SVGPathSegList> SVGPathSegList::createAnimated(const SVGPathSegList* fromList, const SVGPathSegList* toList, float progress)
-{
-    unsigned itemCount = fromList->numberOfItems();
-    if (!itemCount || itemCount != toList->numberOfItems())
-        return 0;
-    RefPtr<SVGPathSegList> result = create(fromList->associatedAttributeName());
-    ExceptionCode ec = 0;
-    for (unsigned n = 0; n < itemCount; ++n) {
-        SVGPathSeg* from = fromList->getItem(n, ec).get();
-        if (ec)
-            return 0;
-        SVGPathSeg* to = toList->getItem(n, ec).get();
-        if (ec)
-            return 0;
-        if (from->pathSegType() == PathSegUnknown || from->pathSegType() != to->pathSegType())
-            return 0;
-        RefPtr<SVGPathSeg> segment = 0;
-        switch (static_cast<SVGPathSegType>(from->pathSegType())) {
-        case PathSegClosePath:
-            segment = SVGPathSegClosePath::create();
-            break;
-        case PathSegLineToHorizontalAbs:
-            segment = BLENDPATHSEG1(SVGPathSegLinetoHorizontalAbs, x);
-            break;
-        case PathSegLineToHorizontalRel:
-            segment = BLENDPATHSEG1(SVGPathSegLinetoHorizontalRel, x);
-            break;   
-        case PathSegLineToVerticalAbs:
-            segment = BLENDPATHSEG1(SVGPathSegLinetoVerticalAbs, y);
-            break;
-        case PathSegLineToVerticalRel:
-            segment = BLENDPATHSEG1(SVGPathSegLinetoVerticalRel, y);
-            break;        
-        case PathSegMoveToAbs:
-            segment = BLENDPATHSEG2(SVGPathSegMovetoAbs, x, y);
-            break;
-        case PathSegMoveToRel:
-            segment = BLENDPATHSEG2(SVGPathSegMovetoRel, x, y);
-            break;
-        case PathSegLineToAbs:
-            segment = BLENDPATHSEG2(SVGPathSegLinetoAbs, x, y);
-            break;
-        case PathSegLineToRel:
-            segment = BLENDPATHSEG2(SVGPathSegLinetoRel, x, y);
-            break;
-        case PathSegCurveToCubicAbs:
-            segment = BLENDPATHSEG6(SVGPathSegCurvetoCubicAbs, x, y, x1, y1, x2, y2);
-            break;
-        case PathSegCurveToCubicRel:
-            segment = BLENDPATHSEG6(SVGPathSegCurvetoCubicRel, x, y, x1, y1, x2, y2);
-            break;
-        case PathSegCurveToCubicSmoothAbs:
-            segment = BLENDPATHSEG4(SVGPathSegCurvetoCubicSmoothAbs, x, y, x2, y2);
-            break;
-        case PathSegCurveToCubicSmoothRel:
-            segment = BLENDPATHSEG4(SVGPathSegCurvetoCubicSmoothRel, x, y, x2, y2);
-            break;
-        case PathSegCurveToQuadraticAbs:
-            segment = BLENDPATHSEG4(SVGPathSegCurvetoQuadraticAbs, x, y, x1, y1);
-            break;
-        case PathSegCurveToQuadraticRel:
-            segment = BLENDPATHSEG4(SVGPathSegCurvetoQuadraticRel, x, y, x1, y1);
-            break;
-        case PathSegCurveToQuadraticSmoothAbs:
-            segment = BLENDPATHSEG2(SVGPathSegCurvetoQuadraticSmoothAbs, x, y);
-            break;
-        case PathSegCurveToQuadraticSmoothRel:
-            segment = BLENDPATHSEG2(SVGPathSegCurvetoQuadraticSmoothRel, x, y);
-            break;
-        case PathSegArcAbs:
-            segment = BLENDPATHSEG7(SVGPathSegArcAbs, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
-            break;
-        case PathSegArcRel:
-            segment = BLENDPATHSEG7(SVGPathSegArcRel, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
-            break;
-        case PathSegUnknown:
-            ASSERT_NOT_REACHED();
-        }
-        result->appendItem(segment, ec);
-        if (ec)
-            return 0;
-    }
-    return result.release();
-}
 
 }
 
diff --git a/WebCore/svg/SVGPathSegList.h b/WebCore/svg/SVGPathSegList.h
index 7e7134f..d3be215 100644
--- a/WebCore/svg/SVGPathSegList.h
+++ b/WebCore/svg/SVGPathSegList.h
@@ -26,23 +26,18 @@
 
 namespace WebCore {
 
-    class Path;
-    class SVGElement;
- 
-    class SVGPathSegList : public SVGList<RefPtr<SVGPathSeg> > {
-    public:
-        static PassRefPtr<SVGPathSegList> create(const QualifiedName& attributeName) { return adoptRef(new SVGPathSegList(attributeName)); }
-        virtual ~SVGPathSegList();
-
-        unsigned getPathSegAtLength(double, ExceptionCode&);
-        
-        static PassRefPtr<SVGPathSegList> createAnimated(const SVGPathSegList* fromList, const SVGPathSegList* toList, float progress);
-        
-    private:
-        SVGPathSegList(const QualifiedName&);
-    };
-
-    float adjustAnimatedValue(float from, float to, float progress);
+class SVGElement;
+
+class SVGPathSegList : public SVGList<RefPtr<SVGPathSeg> > {
+public:
+    static PassRefPtr<SVGPathSegList> create(const QualifiedName& attributeName) { return adoptRef(new SVGPathSegList(attributeName)); }
+    virtual ~SVGPathSegList();
+
+    unsigned getPathSegAtLength(double, ExceptionCode&);
+
+private:
+    SVGPathSegList(const QualifiedName&);
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/SVGPointList.cpp b/WebCore/svg/SVGPointList.cpp
index 3be16ea..8a3d870 100644
--- a/WebCore/svg/SVGPointList.cpp
+++ b/WebCore/svg/SVGPointList.cpp
@@ -54,6 +54,11 @@ String SVGPointList::valueAsString() const
     return result;
 }
 
+float inline adjustAnimatedValue(float from, float to, float progress)
+{
+    return (to - from) * progress + from;
+}
+
 PassRefPtr<SVGPointList> SVGPointList::createAnimated(const SVGPointList* fromList, const SVGPointList* toList, float progress)
 {
     unsigned itemCount = fromList->numberOfItems();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list