Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Unified Diff: Source/core/svg/SVGPathBuilder.cpp

Issue 1013753003: Drop SVGPathBuilder::m_current (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGPathBuilder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGPathBuilder.cpp
diff --git a/Source/core/svg/SVGPathBuilder.cpp b/Source/core/svg/SVGPathBuilder.cpp
index 962cd989a33c6a5a37efb96bf0e23e975c01f832..f708c2f5196246f6e17e5b748e31487ef53fcb51 100644
--- a/Source/core/svg/SVGPathBuilder.cpp
+++ b/Source/core/svg/SVGPathBuilder.cpp
@@ -30,27 +30,22 @@ namespace blink {
void SVGPathBuilder::moveTo(const FloatPoint& targetPoint, bool closed, PathCoordinateMode mode)
{
- m_current = mode == AbsoluteCoordinates ? targetPoint : m_current + targetPoint;
+ ASSERT(mode == AbsoluteCoordinates);
if (closed && !m_path.isEmpty())
m_path.closeSubpath();
- m_path.moveTo(m_current);
+ m_path.moveTo(targetPoint);
}
void SVGPathBuilder::lineTo(const FloatPoint& targetPoint, PathCoordinateMode mode)
{
- m_current = mode == AbsoluteCoordinates ? targetPoint : m_current + targetPoint;
- m_path.addLineTo(m_current);
+ ASSERT(mode == AbsoluteCoordinates);
+ m_path.addLineTo(targetPoint);
}
void SVGPathBuilder::curveToCubic(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& targetPoint, PathCoordinateMode mode)
{
- if (mode == RelativeCoordinates) {
- m_path.addBezierCurveTo(m_current + point1, m_current + point2, m_current + targetPoint);
- m_current += targetPoint;
- } else {
- m_current = targetPoint;
- m_path.addBezierCurveTo(point1, point2, m_current);
- }
+ ASSERT(mode == AbsoluteCoordinates);
+ m_path.addBezierCurveTo(point1, point2, targetPoint);
}
void SVGPathBuilder::closePath()
« no previous file with comments | « Source/core/svg/SVGPathBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698