| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. 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 13 matching lines...) Expand all Loading... |
| 24 #include "core/rendering/svg/RenderSVGInlineText.h" | 24 #include "core/rendering/svg/RenderSVGInlineText.h" |
| 25 #include "core/rendering/svg/SVGInlineTextBox.h" | 25 #include "core/rendering/svg/SVGInlineTextBox.h" |
| 26 #include "core/svg/SVGLengthContext.h" | 26 #include "core/svg/SVGLengthContext.h" |
| 27 | 27 |
| 28 namespace WebCore { | 28 namespace WebCore { |
| 29 | 29 |
| 30 SVGTextChunkBuilder::SVGTextChunkBuilder() | 30 SVGTextChunkBuilder::SVGTextChunkBuilder() |
| 31 { | 31 { |
| 32 } | 32 } |
| 33 | 33 |
| 34 void SVGTextChunkBuilder::transformationForTextBox(SVGInlineTextBox* textBox, Af
fineTransform& transform) const | 34 AffineTransform SVGTextChunkBuilder::transformationForTextBox(SVGInlineTextBox*
textBox) const |
| 35 { | 35 { |
| 36 DEFINE_STATIC_LOCAL(const AffineTransform, s_identityTransform, ()); | 36 return m_textBoxTransformations.get(textBox); |
| 37 if (!m_textBoxTransformations.contains(textBox)) { | |
| 38 transform = s_identityTransform; | |
| 39 return; | |
| 40 } | |
| 41 | |
| 42 transform = m_textBoxTransformations.get(textBox); | |
| 43 } | 37 } |
| 44 | 38 |
| 45 void SVGTextChunkBuilder::buildTextChunks(Vector<SVGInlineTextBox*>& lineLayoutB
oxes) | 39 void SVGTextChunkBuilder::buildTextChunks(Vector<SVGInlineTextBox*>& lineLayoutB
oxes) |
| 46 { | 40 { |
| 47 if (lineLayoutBoxes.isEmpty()) | 41 if (lineLayoutBoxes.isEmpty()) |
| 48 return; | 42 return; |
| 49 | 43 |
| 50 bool foundStart = false; | 44 bool foundStart = false; |
| 51 unsigned lastChunkStartPosition = 0; | 45 unsigned lastChunkStartPosition = 0; |
| 52 unsigned boxPosition = 0; | 46 unsigned boxPosition = 0; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 SVGTextFragment& fragment = fragments[i]; | 249 SVGTextFragment& fragment = fragments[i]; |
| 256 | 250 |
| 257 if (isVerticalText) | 251 if (isVerticalText) |
| 258 fragment.y += textAnchorShift; | 252 fragment.y += textAnchorShift; |
| 259 else | 253 else |
| 260 fragment.x += textAnchorShift; | 254 fragment.x += textAnchorShift; |
| 261 } | 255 } |
| 262 } | 256 } |
| 263 | 257 |
| 264 } | 258 } |
| OLD | NEW |