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

Side by Side Diff: Source/core/rendering/svg/SVGTextLayoutEngine.cpp

Issue 362923007: Move transformationForTextBox() call out of the fragment-loop (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
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; 295 AffineTransform textBoxTransformation;
296 for (unsigned boxPosition = 0; boxPosition < boxCount; ++boxPosition) { 296 for (unsigned boxPosition = 0; boxPosition < boxCount; ++boxPosition) {
297 SVGInlineTextBox* textBox = boxes.at(boxPosition); 297 SVGInlineTextBox* textBox = boxes.at(boxPosition);
298 m_chunkLayoutBuilder.transformationForTextBox(textBox, textBoxTransforma tion);
pdr. 2014/07/03 22:56:49 What do you think about refactoring this function
299 if (textBoxTransformation.isIdentity())
300 continue;
301
298 Vector<SVGTextFragment>& fragments = textBox->textFragments(); 302 Vector<SVGTextFragment>& fragments = textBox->textFragments();
299
300 unsigned fragmentCount = fragments.size(); 303 unsigned fragmentCount = fragments.size();
301 for (unsigned i = 0; i < fragmentCount; ++i) { 304 for (unsigned i = 0; i < fragmentCount; ++i) {
302 m_chunkLayoutBuilder.transformationForTextBox(textBox, textBoxTransf ormation);
303 if (textBoxTransformation.isIdentity())
304 continue;
305 ASSERT(fragments[i].lengthAdjustTransform.isIdentity()); 305 ASSERT(fragments[i].lengthAdjustTransform.isIdentity());
306 fragments[i].lengthAdjustTransform = textBoxTransformation; 306 fragments[i].lengthAdjustTransform = textBoxTransformation;
307 } 307 }
308 } 308 }
309 309
310 boxes.clear(); 310 boxes.clear();
311 } 311 }
312 312
313 void SVGTextLayoutEngine::finishLayout() 313 void SVGTextLayoutEngine::finishLayout()
314 { 314 {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 645 }
646 646
647 if (!didStartTextFragment) 647 if (!didStartTextFragment)
648 return; 648 return;
649 649
650 // Close last open fragment, if needed. 650 // Close last open fragment, if needed.
651 recordTextFragment(textBox, visualMetricsValues); 651 recordTextFragment(textBox, visualMetricsValues);
652 } 652 }
653 653
654 } 654 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698