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

Unified Diff: Source/core/rendering/svg/SVGTextLayoutEngine.cpp

Issue 390373004: Pass references to SVGTextLayoutEngine::layoutTextOnLineOrPath (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/rendering/svg/SVGTextLayoutEngine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGTextLayoutEngine.cpp
diff --git a/Source/core/rendering/svg/SVGTextLayoutEngine.cpp b/Source/core/rendering/svg/SVGTextLayoutEngine.cpp
index 4cf1c55e0fd47baf1b175e42aa5967219dbcc351..426544059bfb8d37fc5d9fd6f1e6f3842f2b205e 100644
--- a/Source/core/rendering/svg/SVGTextLayoutEngine.cpp
+++ b/Source/core/rendering/svg/SVGTextLayoutEngine.cpp
@@ -250,7 +250,7 @@ void SVGTextLayoutEngine::layoutInlineTextBox(SVGInlineTextBox* textBox)
textBox->clearTextFragments();
m_isVerticalText = style->svgStyle().isVerticalWritingMode();
- layoutTextOnLineOrPath(textBox, &text, style);
+ layoutTextOnLineOrPath(textBox, text, *style);
if (m_inPathLayout) {
m_pathLayoutBoxes.append(textBox);
@@ -423,27 +423,27 @@ void SVGTextLayoutEngine::advanceToNextVisualCharacter(const SVGTextMetrics& vis
m_visualCharacterOffset += visualMetrics.length();
}
-void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, RenderSVGInlineText* text, const RenderStyle* style)
+void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, const RenderSVGInlineText& text, const RenderStyle& style)
{
if (m_inPathLayout && !m_textPathCalculator)
return;
- SVGElement* lengthContext = toSVGElement(text->parent()->node());
+ SVGElement* lengthContext = toSVGElement(text.parent()->node());
- RenderObject* textParent = text->parent();
+ RenderObject* textParent = text.parent();
bool definesTextLength = textParent ? parentDefinesTextLength(textParent) : false;
- const SVGRenderStyle& svgStyle = style->svgStyle();
+ const SVGRenderStyle& svgStyle = style.svgStyle();
m_visualMetricsListOffset = 0;
m_visualCharacterOffset = 0;
- const Vector<SVGTextMetrics>& visualMetricsValues = text->layoutAttributes()->textMetricsValues();
+ const Vector<SVGTextMetrics>& visualMetricsValues = text.layoutAttributes()->textMetricsValues();
ASSERT(!visualMetricsValues.isEmpty());
- const Font& font = style->font();
+ const Font& font = style.font();
- SVGTextLayoutEngineSpacing spacingLayout(font, style->effectiveZoom());
+ SVGTextLayoutEngineSpacing spacingLayout(font, style.effectiveZoom());
SVGTextLayoutEngineBaseline baselineLayout(font);
bool didStartTextFragment = false;
@@ -451,7 +451,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, Rend
float lastAngle = 0;
float baselineShift = baselineLayout.calculateBaselineShift(svgStyle, lengthContext);
- baselineShift -= baselineLayout.calculateAlignmentBaselineShift(m_isVerticalText, text);
+ baselineShift -= baselineLayout.calculateAlignmentBaselineShift(m_isVerticalText, &text);
// Main layout algorithm.
while (true) {
@@ -491,7 +491,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, Rend
float angle = data.rotate == SVGTextLayoutAttributes::emptyValue() ? 0 : data.rotate;
// Calculate glyph orientation angle.
- UChar currentCharacter = text->characterAt(m_visualCharacterOffset);
+ UChar currentCharacter = text.characterAt(m_visualCharacterOffset);
float orientationAngle = baselineLayout.calculateGlyphOrientationAngle(m_isVerticalText, svgStyle, currentCharacter);
// Calculate glyph advance & x/y orientation shifts.
« no previous file with comments | « Source/core/rendering/svg/SVGTextLayoutEngine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698