Changeset 147008 in webkit
- Timestamp:
- Mar 27, 2013 1:51:11 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r147004 r147008 1 2013-03-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 Selection code spends a lot of time in InlineTextBox::localSelectionRect 4 https://bugs.webkit.org/show_bug.cgi?id=113364 5 6 Reviewed by Enrica Casucci. 7 8 Avoid computing the font width when we're selecting the entire line box. 9 10 This appears to be 25-26% improvement on Interactive/SelectAll:Time. 11 12 * rendering/InlineTextBox.cpp: 13 (WebCore::InlineTextBox::localSelectionRect): 14 1 15 2013-03-26 Timothy Hatcher <timothy@apple.com> 2 16 -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r146104 r147008 207 207 endPos = textRun.length(); 208 208 209 LayoutRect r = enclosingIntRect(font.selectionRectForText(textRun, FloatPoint(logicalLeft(), selTop), selHeight, sPos, ePos)); 209 FloatPoint startingPoint = FloatPoint(logicalLeft(), selTop); 210 LayoutRect r; 211 if (sPos || ePos != static_cast<int>(m_len)) 212 r = enclosingIntRect(font.selectionRectForText(textRun, startingPoint, selHeight, sPos, ePos)); 213 else // Avoid computing the font width when the entire line box is selected as an optimization. 214 r = enclosingIntRect(FloatRect(startingPoint, FloatSize(m_logicalWidth, selHeight))); 210 215 211 216 LayoutUnit logicalWidth = r.width();
Note: See TracChangeset
for help on using the changeset viewer.