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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp

Issue 1823073002: Use the line box's direction in computeGlyphOverflow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TEs Created 4 years, 9 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 | « third_party/WebKit/LayoutTests/TestExpectations ('k') | 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return; 107 return;
108 } 108 }
109 109
110 m_dx = dx; 110 m_dx = dx;
111 m_dy = dy; 111 m_dy = dy;
112 } 112 }
113 113
114 static void computeGlyphOverflow(SVGInlineTextBox* textBox, SVGTextFragment& tex tFragment) 114 static void computeGlyphOverflow(SVGInlineTextBox* textBox, SVGTextFragment& tex tFragment)
115 { 115 {
116 LineLayoutSVGInlineText textLineLayout = LineLayoutSVGInlineText(textBox->ge tLineLayoutItem()); 116 LineLayoutSVGInlineText textLineLayout = LineLayoutSVGInlineText(textBox->ge tLineLayoutItem());
117 TextRun run = SVGTextMetrics::constructTextRun(textLineLayout, textFragment. characterOffset, textFragment.length, textLineLayout.styleRef().direction()); 117 TextRun run = textBox->constructTextRun(textLineLayout.styleRef(), textFragm ent);
118 118
119 float scalingFactor = textLineLayout.scalingFactor(); 119 float scalingFactor = textLineLayout.scalingFactor();
120 ASSERT(scalingFactor); 120 ASSERT(scalingFactor);
121 const Font& scaledFont = textLineLayout.scaledFont(); 121 const Font& scaledFont = textLineLayout.scaledFont();
122 FloatRect glyphOverflowBounds; 122 FloatRect glyphOverflowBounds;
123 123
124 float width = scaledFont.width(run, nullptr, &glyphOverflowBounds); 124 float width = scaledFont.width(run, nullptr, &glyphOverflowBounds);
125 float ascent = scaledFont.getFontMetrics().floatAscent(); 125 float ascent = scaledFont.getFontMetrics().floatAscent();
126 float descent = scaledFont.getFontMetrics().floatDescent(); 126 float descent = scaledFont.getFontMetrics().floatDescent();
127 textFragment.glyphOverflow.setFromBounds(glyphOverflowBounds, ascent, descen t, width); 127 textFragment.glyphOverflow.setFromBounds(glyphOverflowBounds, ascent, descen t, width);
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 } 548 }
549 549
550 if (!didStartTextFragment) 550 if (!didStartTextFragment)
551 return; 551 return;
552 552
553 // Close last open fragment, if needed. 553 // Close last open fragment, if needed.
554 recordTextFragment(textBox); 554 recordTextFragment(textBox);
555 } 555 }
556 556
557 } // namespace blink 557 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698