OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2011. 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 Vector<SVGTextLayoutAttributes*>& layoutAttributes = textRoot->layoutAttribu
tes(); | 72 Vector<SVGTextLayoutAttributes*>& layoutAttributes = textRoot->layoutAttribu
tes(); |
73 | 73 |
74 size_t layoutAttributesSize = layoutAttributes.size(); | 74 size_t layoutAttributesSize = layoutAttributes.size(); |
75 for (size_t i = 0; i < layoutAttributesSize; ++i) | 75 for (size_t i = 0; i < layoutAttributesSize; ++i) |
76 m_metricsBuilder.measureTextRenderer(layoutAttributes[i]->context()); | 76 m_metricsBuilder.measureTextRenderer(layoutAttributes[i]->context()); |
77 } | 77 } |
78 | 78 |
79 bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesIfNeeded(RenderSVGText
* textRoot) | 79 bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesIfNeeded(RenderSVGText
* textRoot) |
80 { | 80 { |
81 ASSERT(textRoot); | 81 ASSERT(textRoot); |
82 if (!m_textPositions.isEmpty()) | |
83 return m_textLength; | |
84 | 82 |
85 m_textLength = 0; | 83 if (m_textPositions.isEmpty()) { |
86 const UChar* lastCharacter = 0; | 84 m_textLength = 0; |
87 collectTextPositioningElements(textRoot, lastCharacter); | 85 const UChar* lastCharacter = 0; |
| 86 collectTextPositioningElements(textRoot, lastCharacter); |
| 87 } |
88 | 88 |
89 m_characterDataMap.clear(); | 89 m_characterDataMap.clear(); |
90 if (!m_textLength) | 90 if (!m_textLength) |
91 return false; | 91 return false; |
92 | 92 |
93 buildLayoutAttributes(textRoot); | 93 buildLayoutAttributes(textRoot); |
94 return true; | 94 return true; |
95 } | 95 } |
96 | 96 |
97 static inline void processRenderSVGInlineText(RenderSVGInlineText* text, unsigne
d& atCharacter, const UChar*& lastCharacter) | 97 static inline void processRenderSVGInlineText(RenderSVGInlineText* text, unsigne
d& atCharacter, const UChar*& lastCharacter) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 continue; | 247 continue; |
248 } | 248 } |
249 | 249 |
250 it->second.rotate = lastRotation; | 250 it->second.rotate = lastRotation; |
251 } | 251 } |
252 } | 252 } |
253 | 253 |
254 } | 254 } |
255 | 255 |
256 #endif // ENABLE(SVG) | 256 #endif // ENABLE(SVG) |
OLD | NEW |