| 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/layout/svg/line/SVGInlineTextBox.h" | 24 #include "core/layout/svg/line/SVGInlineTextBox.h" |
| 25 #include "core/svg/SVGLengthContext.h" | 25 #include "core/svg/SVGLengthContext.h" |
| 26 #include "core/svg/SVGTextContentElement.h" | 26 #include "core/svg/SVGTextContentElement.h" |
| 27 | 27 |
| 28 namespace blink { | 28 namespace blink { |
| 29 | 29 |
| 30 SVGTextChunkBuilder::SVGTextChunkBuilder() | 30 SVGTextChunkBuilder::SVGTextChunkBuilder() |
| 31 { | 31 { |
| 32 } | 32 } |
| 33 | 33 |
| 34 AffineTransform SVGTextChunkBuilder::transformationForTextBox(SVGInlineTextBox*
textBox) const | |
| 35 { | |
| 36 return m_textBoxTransformations.get(textBox); | |
| 37 } | |
| 38 | |
| 39 void SVGTextChunkBuilder::buildTextChunks(Vector<SVGInlineTextBox*>& lineLayoutB
oxes) | 34 void SVGTextChunkBuilder::buildTextChunks(Vector<SVGInlineTextBox*>& lineLayoutB
oxes) |
| 40 { | 35 { |
| 41 if (lineLayoutBoxes.isEmpty()) | 36 if (lineLayoutBoxes.isEmpty()) |
| 42 return; | 37 return; |
| 43 | 38 |
| 44 bool foundStart = false; | 39 bool foundStart = false; |
| 45 unsigned lastChunkStartPosition = 0; | 40 unsigned lastChunkStartPosition = 0; |
| 46 unsigned boxPosition = 0; | 41 unsigned boxPosition = 0; |
| 47 unsigned boxCount = lineLayoutBoxes.size(); | 42 unsigned boxCount = lineLayoutBoxes.size(); |
| 48 for (; boxPosition < boxCount; ++boxPosition) { | 43 for (; boxPosition < boxCount; ++boxPosition) { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 for (unsigned i = 0; i < fragmentCount; ++i) { | 241 for (unsigned i = 0; i < fragmentCount; ++i) { |
| 247 SVGTextFragment& fragment = fragments[i]; | 242 SVGTextFragment& fragment = fragments[i]; |
| 248 | 243 |
| 249 if (isVerticalText) | 244 if (isVerticalText) |
| 250 fragment.y += textAnchorShift; | 245 fragment.y += textAnchorShift; |
| 251 else | 246 else |
| 252 fragment.x += textAnchorShift; | 247 fragment.x += textAnchorShift; |
| 253 } | 248 } |
| 254 } | 249 } |
| 255 | 250 |
| 251 void SVGTextChunkBuilder::finalizeTransformMatrices(const Vector<SVGInlineTextBo
x*>& boxes) const |
| 252 { |
| 253 for (SVGInlineTextBox* textBox : boxes) { |
| 254 AffineTransform textBoxTransformation = m_textBoxTransformations.get(tex
tBox); |
| 255 if (textBoxTransformation.isIdentity()) |
| 256 continue; |
| 257 |
| 258 for (SVGTextFragment& fragment : textBox->textFragments()) { |
| 259 ASSERT(fragment.lengthAdjustTransform.isIdentity()); |
| 260 fragment.lengthAdjustTransform = textBoxTransformation; |
| 261 } |
| 262 } |
| 263 } |
| 264 |
| 256 } | 265 } |
| OLD | NEW |