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

Unified Diff: third_party/WebKit/Source/platform/graphics/Path.cpp

Issue 1418663004: SVG animateMotion paths that only cause offsets are no longer ignored (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « third_party/WebKit/Source/platform/graphics/Path.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/Path.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Path.cpp b/third_party/WebKit/Source/platform/graphics/Path.cpp
index f88cc53d3ffba8d47cd445043fcf1ebb86f0eb1f..9cccb4951d2c1f917e04904c9f3ec1cd07be0101 100644
--- a/third_party/WebKit/Source/platform/graphics/Path.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Path.cpp
@@ -172,11 +172,11 @@ float Path::length() const
return SkScalarToFloat(length);
}
-FloatPoint Path::pointAtLength(float length, bool& ok) const
+FloatPoint Path::pointAtLength(float length) const
{
FloatPoint point;
float normal;
- ok = pointAndNormalAtLength(length, point, normal);
+ pointAndNormalAtLength(length, point, normal);
return point;
}
@@ -201,16 +201,15 @@ static bool calculatePointAndNormalOnPath(SkPathMeasure& measure, SkScalar lengt
return false;
}
-bool Path::pointAndNormalAtLength(float length, FloatPoint& point, float& normal) const
+void Path::pointAndNormalAtLength(float length, FloatPoint& point, float& normal) const
{
SkPathMeasure measure(m_path, false);
-
if (calculatePointAndNormalOnPath(measure, WebCoreFloatToSkScalar(length), point, normal))
- return true;
+ return;
+ SkPoint position = m_path.getPoint(0);
+ point = FloatPoint(SkScalarToFloat(position.fX), SkScalarToFloat(position.fY));
normal = 0;
- point = FloatPoint(0, 0);
- return false;
}
Path::PositionCalculator::PositionCalculator(const Path& path)
@@ -220,7 +219,7 @@ Path::PositionCalculator::PositionCalculator(const Path& path)
{
}
-bool Path::PositionCalculator::pointAndNormalAtLength(float length, FloatPoint& point, float& normalAngle)
+void Path::PositionCalculator::pointAndNormalAtLength(float length, FloatPoint& point, float& normalAngle)
{
SkScalar skLength = WebCoreFloatToSkScalar(length);
if (skLength >= 0) {
@@ -233,12 +232,13 @@ bool Path::PositionCalculator::pointAndNormalAtLength(float length, FloatPoint&
}
if (calculatePointAndNormalOnPath(m_pathMeasure, skLength, point, normalAngle, &m_accumulatedLength))
- return true;
+ return;
}
+ SkPoint position = m_path.getPoint(0);
+ point = FloatPoint(SkScalarToFloat(position.fX), SkScalarToFloat(position.fY));
normalAngle = 0;
- point = FloatPoint(0, 0);
- return false;
+ return;
}
void Path::clear()
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/Path.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698