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

Side by Side Diff: Source/core/rendering/svg/SVGTextMetricsBuilder.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/svg/SVGTextMetrics.cpp ('k') | Source/platform/fonts/Font.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 SVGTextMetrics SVGTextMetricsCalculator::computeMetricsForCharacterSimple(unsign ed textPosition) 117 SVGTextMetrics SVGTextMetricsCalculator::computeMetricsForCharacterSimple(unsign ed textPosition)
118 { 118 {
119 GlyphBuffer glyphBuffer; 119 GlyphBuffer glyphBuffer;
120 unsigned metricsLength = m_simpleShaper->advance(textPosition + 1, &glyphBuf fer); 120 unsigned metricsLength = m_simpleShaper->advance(textPosition + 1, &glyphBuf fer);
121 if (!metricsLength) 121 if (!metricsLength)
122 return SVGTextMetrics(); 122 return SVGTextMetrics();
123 123
124 float currentWidth = m_simpleShaper->runWidthSoFar() - m_totalWidth; 124 float currentWidth = m_simpleShaper->runWidthSoFar() - m_totalWidth;
125 m_totalWidth = m_simpleShaper->runWidthSoFar(); 125 m_totalWidth = m_simpleShaper->runWidthSoFar();
126 126
127 Glyph glyphId = glyphBuffer.glyphAt(0); 127 return SVGTextMetrics(m_text, textPosition, metricsLength, currentWidth);
128 return SVGTextMetrics(m_text, textPosition, metricsLength, currentWidth, gly phId);
129 } 128 }
130 129
131 SVGTextMetrics SVGTextMetricsCalculator::computeMetricsForCharacterComplex(unsig ned textPosition) 130 SVGTextMetrics SVGTextMetricsCalculator::computeMetricsForCharacterComplex(unsig ned textPosition)
132 { 131 {
133 unsigned metricsLength = characterStartsSurrogatePair(textPosition) ? 2 : 1; 132 unsigned metricsLength = characterStartsSurrogatePair(textPosition) ? 2 : 1;
134 SVGTextMetrics metrics = SVGTextMetrics::measureCharacterRange(m_text, textP osition, metricsLength, m_textDirection); 133 SVGTextMetrics metrics = SVGTextMetrics::measureCharacterRange(m_text, textP osition, metricsLength, m_textDirection);
135 ASSERT(metrics.length() == metricsLength); 134 ASSERT(metrics.length() == metricsLength);
136 135
137 unsigned startPosition = m_bidiRun ? m_bidiRun->start() : 0; 136 unsigned startPosition = m_bidiRun ? m_bidiRun->start() : 0;
138 ASSERT(startPosition <= textPosition); 137 ASSERT(startPosition <= textPosition);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 269 }
271 270
272 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText* textR oot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap) 271 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText* textR oot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap)
273 { 272 {
274 ASSERT(textRoot); 273 ASSERT(textRoot);
275 MeasureTextData data(&allCharactersMap); 274 MeasureTextData data(&allCharactersMap);
276 walkTree(textRoot, stopAtLeaf, &data); 275 walkTree(textRoot, stopAtLeaf, &data);
277 } 276 }
278 277
279 } 278 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGTextMetrics.cpp ('k') | Source/platform/fonts/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698