summaryrefslogtreecommitdiffstats
path: root/WebCore/svg/SVGPathSegListSource.cpp
diff options
context:
space:
mode:
authorShimeng (Simon) Wang <swang@google.com>2010-12-07 17:22:45 -0800
committerShimeng (Simon) Wang <swang@google.com>2010-12-22 14:15:40 -0800
commit4576aa36e9a9671459299c7963ac95aa94beaea9 (patch)
tree3863574e050f168c0126ecb47c83319fab0972d8 /WebCore/svg/SVGPathSegListSource.cpp
parent55323ac613cc31553107b68603cb627264d22bb0 (diff)
downloadexternal_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.zip
external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.tar.gz
external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.tar.bz2
Merge WebKit at r73109: Initial merge by git.
Change-Id: I61f1a66d9642e3d8405d3ac6ccab2a53421c75d8
Diffstat (limited to 'WebCore/svg/SVGPathSegListSource.cpp')
-rw-r--r--WebCore/svg/SVGPathSegListSource.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/WebCore/svg/SVGPathSegListSource.cpp b/WebCore/svg/SVGPathSegListSource.cpp
index 2378743..5526cd6 100644
--- a/WebCore/svg/SVGPathSegListSource.cpp
+++ b/WebCore/svg/SVGPathSegListSource.cpp
@@ -31,12 +31,11 @@
namespace WebCore {
-SVGPathSegListSource::SVGPathSegListSource(SVGPathSegList* pathSegList)
+SVGPathSegListSource::SVGPathSegListSource(const SVGPathSegList& pathSegList)
: m_pathSegList(pathSegList)
{
- ASSERT(m_pathSegList);
m_itemCurrent = 0;
- m_itemEnd = m_pathSegList->numberOfItems();
+ m_itemEnd = m_pathSegList.size();
}
bool SVGPathSegListSource::hasMoreData() const
@@ -46,11 +45,7 @@ bool SVGPathSegListSource::hasMoreData() const
bool SVGPathSegListSource::parseSVGSegmentType(SVGPathSegType& pathSegType)
{
- ASSERT(m_pathSegList);
- ExceptionCode ec = 0;
- m_segment = m_pathSegList->getItem(m_itemCurrent, ec);
- if (ec)
- return false;
+ m_segment = m_pathSegList.at(m_itemCurrent);
pathSegType = static_cast<SVGPathSegType>(m_segment->pathSegType());
++m_itemCurrent;
return true;
@@ -58,11 +53,7 @@ bool SVGPathSegListSource::parseSVGSegmentType(SVGPathSegType& pathSegType)
SVGPathSegType SVGPathSegListSource::nextCommand(SVGPathSegType)
{
- ASSERT(m_pathSegList);
- ExceptionCode ec = 0;
- m_segment = m_pathSegList->getItem(m_itemCurrent, ec);
- if (ec)
- return PathSegUnknown;
+ m_segment = m_pathSegList.at(m_itemCurrent);
SVGPathSegType pathSegType = static_cast<SVGPathSegType>(m_segment->pathSegType());
++m_itemCurrent;
return pathSegType;
@@ -72,7 +63,7 @@ bool SVGPathSegListSource::parseMoveToSegment(FloatPoint& targetPoint)
{
ASSERT(m_segment);
ASSERT(m_segment->pathSegType() == PathSegMoveToAbs || m_segment->pathSegType() == PathSegMoveToRel);
- SVGPathSegSingleCoord* moveTo = static_cast<SVGPathSegSingleCoord*>(m_segment.get());
+ SVGPathSegSingleCoordinate* moveTo = static_cast<SVGPathSegSingleCoordinate*>(m_segment.get());
targetPoint = FloatPoint(moveTo->x(), moveTo->y());
return true;
}
@@ -81,7 +72,7 @@ bool SVGPathSegListSource::parseLineToSegment(FloatPoint& targetPoint)
{
ASSERT(m_segment);
ASSERT(m_segment->pathSegType() == PathSegLineToAbs || m_segment->pathSegType() == PathSegLineToRel);
- SVGPathSegSingleCoord* lineTo = static_cast<SVGPathSegSingleCoord*>(m_segment.get());
+ SVGPathSegSingleCoordinate* lineTo = static_cast<SVGPathSegSingleCoordinate*>(m_segment.get());
targetPoint = FloatPoint(lineTo->x(), lineTo->y());
return true;
}
@@ -139,7 +130,7 @@ bool SVGPathSegListSource::parseCurveToQuadraticSmoothSegment(FloatPoint& target
{
ASSERT(m_segment);
ASSERT(m_segment->pathSegType() == PathSegCurveToQuadraticSmoothAbs || m_segment->pathSegType() == PathSegCurveToQuadraticSmoothRel);
- SVGPathSegSingleCoord* quadraticSmooth = static_cast<SVGPathSegSingleCoord*>(m_segment.get());
+ SVGPathSegSingleCoordinate* quadraticSmooth = static_cast<SVGPathSegSingleCoordinate*>(m_segment.get());
targetPoint = FloatPoint(quadraticSmooth->x(), quadraticSmooth->y());
return true;
}