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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp

Issue 1838363004: Pass LineLayoutSVGInlineText to SVGTextMetricsCalculator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
index 79f1bd3fe6d76be63f781241025adecc7fe44c2e..355c8eb90c0356a5efdc739edce709a3c0a964b0 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
@@ -38,7 +38,7 @@ namespace {
class SVGTextMetricsCalculator {
public:
- SVGTextMetricsCalculator(LayoutSVGInlineText*);
+ SVGTextMetricsCalculator(LineLayoutSVGInlineText);
~SVGTextMetricsCalculator();
bool advancePosition();
@@ -114,9 +114,9 @@ TextRun SVGTextMetricsCalculator::constructTextRun(LineLayoutSVGInlineText textL
return run;
}
-SVGTextMetricsCalculator::SVGTextMetricsCalculator(LayoutSVGInlineText* text)
+SVGTextMetricsCalculator::SVGTextMetricsCalculator(LineLayoutSVGInlineText text)
: m_currentPosition(0)
- , m_text(LineLayoutSVGInlineText(text))
+ , m_text(text)
, m_fontScalingFactor(m_text.scalingFactor())
, m_cachedFontHeight(m_text.scaledFont().getFontMetrics().floatHeight() / m_fontScalingFactor)
, m_run(constructTextRun(m_text, 0, m_text.textLength(), m_text.styleRef().direction()))
@@ -258,17 +258,18 @@ struct UpdateAttributes {
void walkInlineText(LayoutSVGInlineText* text, TreeWalkTextState& textState, UpdateAttributes* attributesToUpdate = nullptr)
{
+ LineLayoutSVGInlineText textLayoutItem(text);
if (attributesToUpdate)
attributesToUpdate->clearExistingAttributes();
- if (!text->textLength())
+ if (!textLayoutItem.textLength())
return;
// TODO(pdr): This loop is too tightly coupled to SVGTextMetricsCalculator.
// We should refactor SVGTextMetricsCalculator to be a simple bidi run
// iterator and move all subrun logic to a single function.
- SVGTextMetricsCalculator calculator(text);
- bool preserveWhiteSpace = text->style()->whiteSpace() == PRE;
+ SVGTextMetricsCalculator calculator(textLayoutItem);
+ bool preserveWhiteSpace = textLayoutItem.styleRef().whiteSpace() == PRE;
unsigned surrogatePairCharacters = 0;
unsigned skippedWhitespace = 0;
do {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698