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

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

Issue 135853005: Minor optimization of SVG <textPath> layout (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reupload. Created 6 years, 11 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
« 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 if (textPathOffset < 0) { 548 if (textPathOffset < 0) {
549 advanceToNextLogicalCharacter(logicalMetrics); 549 advanceToNextLogicalCharacter(logicalMetrics);
550 advanceToNextVisualCharacter(visualMetrics); 550 advanceToNextVisualCharacter(visualMetrics);
551 continue; 551 continue;
552 } 552 }
553 553
554 // Stop processing, if the next character lies behind the path. 554 // Stop processing, if the next character lies behind the path.
555 if (textPathOffset > m_textPathLength) 555 if (textPathOffset > m_textPathLength)
556 break; 556 break;
557 557
558 bool ok = false; 558 FloatPoint point;
559 FloatPoint point = m_textPath.pointAtLength(textPathOffset, ok); 559 bool ok = m_textPath.pointAndNormalAtLength(textPathOffset, point, a ngle);
560 ASSERT(ok); 560 ASSERT_UNUSED(ok, ok);
561
562 x = point.x(); 561 x = point.x();
563 y = point.y(); 562 y = point.y();
564 angle = m_textPath.normalAngleAtLength(textPathOffset, ok);
565 ASSERT(ok);
566 563
567 // For vertical text on path, the actual angle has to be rotated 90 degrees anti-clockwise, not the orientation angle! 564 // For vertical text on path, the actual angle has to be rotated 90 degrees anti-clockwise, not the orientation angle!
568 if (m_isVerticalText) 565 if (m_isVerticalText)
569 angle -= 90; 566 angle -= 90;
570 } else { 567 } else {
571 // Apply all previously calculated shift values. 568 // Apply all previously calculated shift values.
572 if (m_isVerticalText) { 569 if (m_isVerticalText) {
573 x += baselineShift; 570 x += baselineShift;
574 y -= kerning; 571 y -= kerning;
575 } else { 572 } else {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 } 643 }
647 644
648 if (!didStartTextFragment) 645 if (!didStartTextFragment)
649 return; 646 return;
650 647
651 // Close last open fragment, if needed. 648 // Close last open fragment, if needed.
652 recordTextFragment(textBox, visualMetricsValues); 649 recordTextFragment(textBox, visualMetricsValues);
653 } 650 }
654 651
655 } 652 }
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