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

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

Issue 665253003: Remove SVGTextMetrics::m_glyph (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop WTFString.h include. Created 6 years, 2 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/SVGTextMetrics.h ('k') | Source/core/rendering/svg/SVGTextMetricsBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGTextMetrics.cpp
diff --git a/Source/core/rendering/svg/SVGTextMetrics.cpp b/Source/core/rendering/svg/SVGTextMetrics.cpp
index 21638f34d878b0b09de9028e91ed6aafda992e95..a376aedfafa4b1018eadb219df3b7251c00f078c 100644
--- a/Source/core/rendering/svg/SVGTextMetrics.cpp
+++ b/Source/core/rendering/svg/SVGTextMetrics.cpp
@@ -29,7 +29,6 @@ SVGTextMetrics::SVGTextMetrics()
: m_width(0)
, m_height(0)
, m_length(0)
- , m_glyph(0)
{
}
@@ -37,7 +36,6 @@ SVGTextMetrics::SVGTextMetrics(SVGTextMetrics::MetricsType)
: m_width(0)
, m_height(0)
, m_length(1)
- , m_glyph(0)
{
}
@@ -49,14 +47,13 @@ SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* textRenderer, const TextRun&
ASSERT(scalingFactor);
const Font& scaledFont = textRenderer->scaledFont();
- int length = 0;
// Calculate width/height using the scaled font, divide this result by the scalingFactor afterwards.
- m_width = scaledFont.width(run, length, m_glyph) / scalingFactor;
+ m_width = scaledFont.width(run) / scalingFactor;
m_height = scaledFont.fontMetrics().floatHeight() / scalingFactor;
- ASSERT(length >= 0);
- m_length = static_cast<unsigned>(length);
+ ASSERT(run.length() >= 0);
+ m_length = static_cast<unsigned>(run.length());
}
TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, unsigned position, unsigned length)
@@ -106,7 +103,7 @@ SVGTextMetrics SVGTextMetrics::measureCharacterRange(RenderSVGInlineText* text,
return SVGTextMetrics(text, constructTextRun(text, position, length));
}
-SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* text, unsigned position, unsigned length, float width, Glyph glyphNameGlyphId)
+SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* text, unsigned position, unsigned length, float width)
{
ASSERT(text);
@@ -115,7 +112,6 @@ SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* text, unsigned position, uns
m_width = width / scalingFactor;
m_height = text->scaledFont().fontMetrics().floatHeight() / scalingFactor;
- m_glyph = 0;
m_length = length;
}
« no previous file with comments | « Source/core/rendering/svg/SVGTextMetrics.h ('k') | Source/core/rendering/svg/SVGTextMetricsBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698