| Index: Source/core/rendering/svg/SVGTextMetrics.cpp
|
| diff --git a/Source/core/rendering/svg/SVGTextMetrics.cpp b/Source/core/rendering/svg/SVGTextMetrics.cpp
|
| index 26c82dbec27c168bde69ded737f9409546fb1dbf..e9bacb475efa3bb09d4aff152610f9d86a10aad6 100644
|
| --- a/Source/core/rendering/svg/SVGTextMetrics.cpp
|
| +++ b/Source/core/rendering/svg/SVGTextMetrics.cpp
|
| @@ -30,6 +30,7 @@ SVGTextMetrics::SVGTextMetrics()
|
| : m_width(0)
|
| , m_height(0)
|
| , m_length(0)
|
| + , m_glyph(0)
|
| {
|
| }
|
|
|
| @@ -37,6 +38,7 @@ SVGTextMetrics::SVGTextMetrics(SVGTextMetrics::MetricsType)
|
| : m_width(0)
|
| , m_height(0)
|
| , m_length(1)
|
| + , m_glyph(0)
|
| {
|
| }
|
|
|
| @@ -51,12 +53,9 @@ SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* textRenderer, const TextRun&
|
| 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.name) / scalingFactor;
|
| + m_width = scaledFont.width(run, length, m_glyph) / scalingFactor;
|
| m_height = scaledFont.fontMetrics().floatHeight() / scalingFactor;
|
|
|
| - m_glyph.unicodeString = run.is8Bit() ? String(run.characters8(), length) : String(run.characters16(), length);
|
| - m_glyph.isValid = true;
|
| -
|
| ASSERT(length >= 0);
|
| m_length = static_cast<unsigned>(length);
|
| }
|
| @@ -101,7 +100,7 @@ SVGTextMetrics SVGTextMetrics::measureCharacterRange(RenderSVGInlineText* text,
|
| return SVGTextMetrics(text, constructTextRun(text, position, length));
|
| }
|
|
|
| -SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* text, unsigned position, unsigned length, float width, const String& glyphName)
|
| +SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* text, unsigned position, unsigned length, float width, Glyph glyphNameGlyphId)
|
| {
|
| ASSERT(text);
|
|
|
| @@ -111,11 +110,7 @@ SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText* text, unsigned position, uns
|
|
|
| m_width = width / scalingFactor;
|
| m_height = text->scaledFont().fontMetrics().floatHeight() / scalingFactor;
|
| - if (needsContext) {
|
| - m_glyph.isValid = true;
|
| - m_glyph.unicodeString = text->substring(position, length);
|
| - m_glyph.name = glyphName;
|
| - }
|
| + m_glyph = needsContext ? glyphNameGlyphId : 0;
|
|
|
| m_length = length;
|
| }
|
|
|