OLD | NEW |
---|---|
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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 } | 285 } |
286 } | 286 } |
287 #endif | 287 #endif |
288 | 288 |
289 void SVGTextLayoutEngine::finalizeTransformMatrices(Vector<SVGInlineTextBox*>& b oxes) | 289 void SVGTextLayoutEngine::finalizeTransformMatrices(Vector<SVGInlineTextBox*>& b oxes) |
290 { | 290 { |
291 unsigned boxCount = boxes.size(); | 291 unsigned boxCount = boxes.size(); |
292 if (!boxCount) | 292 if (!boxCount) |
293 return; | 293 return; |
294 | 294 |
295 AffineTransform textBoxTransformation; | |
296 for (unsigned boxPosition = 0; boxPosition < boxCount; ++boxPosition) { | 295 for (unsigned boxPosition = 0; boxPosition < boxCount; ++boxPosition) { |
297 SVGInlineTextBox* textBox = boxes.at(boxPosition); | 296 SVGInlineTextBox* textBox = boxes.at(boxPosition); |
298 m_chunkLayoutBuilder.transformationForTextBox(textBox, textBoxTransforma tion); | 297 AffineTransform textBoxTransformation = m_chunkLayoutBuilder.transformat ionForTextBox(textBox); |
pdr.
2014/07/08 19:00:44
I think this will create an unnecessary copy. Shou
fs
2014/07/09 08:53:53
This should be fine - at least the compiler I used
| |
299 if (textBoxTransformation.isIdentity()) | 298 if (textBoxTransformation.isIdentity()) |
300 continue; | 299 continue; |
301 | 300 |
302 Vector<SVGTextFragment>& fragments = textBox->textFragments(); | 301 Vector<SVGTextFragment>& fragments = textBox->textFragments(); |
303 unsigned fragmentCount = fragments.size(); | 302 unsigned fragmentCount = fragments.size(); |
304 for (unsigned i = 0; i < fragmentCount; ++i) { | 303 for (unsigned i = 0; i < fragmentCount; ++i) { |
305 ASSERT(fragments[i].lengthAdjustTransform.isIdentity()); | 304 ASSERT(fragments[i].lengthAdjustTransform.isIdentity()); |
306 fragments[i].lengthAdjustTransform = textBoxTransformation; | 305 fragments[i].lengthAdjustTransform = textBoxTransformation; |
307 } | 306 } |
308 } | 307 } |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
645 } | 644 } |
646 | 645 |
647 if (!didStartTextFragment) | 646 if (!didStartTextFragment) |
648 return; | 647 return; |
649 | 648 |
650 // Close last open fragment, if needed. | 649 // Close last open fragment, if needed. |
651 recordTextFragment(textBox, visualMetricsValues); | 650 recordTextFragment(textBox, visualMetricsValues); |
652 } | 651 } |
653 | 652 |
654 } | 653 } |
OLD | NEW |