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

Side by Side Diff: Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp

Issue 11845002: Merge 138316 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 void SVGTextMetricsBuilder::advanceSimpleText() 59 void SVGTextMetricsBuilder::advanceSimpleText()
60 { 60 {
61 GlyphBuffer glyphBuffer; 61 GlyphBuffer glyphBuffer;
62 unsigned metricsLength = m_simpleWidthIterator->advance(m_textPosition + 1, &glyphBuffer); 62 unsigned metricsLength = m_simpleWidthIterator->advance(m_textPosition + 1, &glyphBuffer);
63 if (!metricsLength) { 63 if (!metricsLength) {
64 m_currentMetrics = SVGTextMetrics(); 64 m_currentMetrics = SVGTextMetrics();
65 return; 65 return;
66 } 66 }
67 67
68 if (currentCharacterStartsSurrogatePair())
69 ASSERT(metricsLength == 2);
70
71 float currentWidth = m_simpleWidthIterator->runWidthSoFar() - m_totalWidth; 68 float currentWidth = m_simpleWidthIterator->runWidthSoFar() - m_totalWidth;
72 m_totalWidth = m_simpleWidthIterator->runWidthSoFar(); 69 m_totalWidth = m_simpleWidthIterator->runWidthSoFar();
73 70
74 #if ENABLE(SVG_FONTS) 71 #if ENABLE(SVG_FONTS)
75 m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, cur rentWidth, m_simpleWidthIterator->lastGlyphName()); 72 m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, cur rentWidth, m_simpleWidthIterator->lastGlyphName());
76 #else 73 #else
77 m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, cur rentWidth, emptyString()); 74 m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, cur rentWidth, emptyString());
78 #endif 75 #endif
79 } 76 }
80 77
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText* textR oot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap) 218 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText* textR oot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap)
222 { 219 {
223 ASSERT(textRoot); 220 ASSERT(textRoot);
224 MeasureTextData data(&allCharactersMap); 221 MeasureTextData data(&allCharactersMap);
225 walkTree(textRoot, stopAtLeaf, &data); 222 walkTree(textRoot, stopAtLeaf, &data);
226 } 223 }
227 224
228 } 225 }
229 226
230 #endif // ENABLE(SVG) 227 #endif // ENABLE(SVG)
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp ('k') | Source/WebCore/svg/SVGFontData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698