Commit 8e13c23b authored by fs@opera.com's avatar fs@opera.com

Minor optimization of SVG <textPath> layout

Path::pointAtLength and Path::normalAngleAtLength both call
Path::pointAndNormalAtLength to do the work.
SVGTextLayoutEngine::layoutTextOnLineOrPath call the two former, which
means it'll setup and process the path twice.

Change the two calls into one call to pointAndNormalAtLength to reduce
the work required.

BUG=135310

Review URL: https://codereview.chromium.org/135853005

git-svn-id: svn://svn.chromium.org/blink/trunk@165078 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8d3cad36
......@@ -555,14 +555,11 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, Rend
if (textPathOffset > m_textPathLength)
break;
bool ok = false;
FloatPoint point = m_textPath.pointAtLength(textPathOffset, ok);
ASSERT(ok);
FloatPoint point;
bool ok = m_textPath.pointAndNormalAtLength(textPathOffset, point, angle);
ASSERT_UNUSED(ok, ok);
x = point.x();
y = point.y();
angle = m_textPath.normalAngleAtLength(textPathOffset, ok);
ASSERT(ok);
// For vertical text on path, the actual angle has to be rotated 90 degrees anti-clockwise, not the orientation angle!
if (m_isVerticalText)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment