Changeset 249170 in webkit


Ignore:
Timestamp:
Aug 27, 2019 2:09:47 PM (5 years ago)
Author:
Simon Fraser
Message:

Minor optimization in InlineFlowBox::paintBoxDecorations()
https://bugs.webkit.org/show_bug.cgi?id=201199

Reviewed by Zalan Bujtas.

This function can early return before computing localRect, which takes a bit of time (seen
on profiles).

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::paintBoxDecorations):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249162 r249170  
     12019-08-27  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Minor optimization in InlineFlowBox::paintBoxDecorations()
     4        https://bugs.webkit.org/show_bug.cgi?id=201199
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        This function can early return before computing localRect, which takes a bit of time (seen
     9        on profiles).
     10
     11        * rendering/InlineFlowBox.cpp:
     12        (WebCore::InlineFlowBox::paintBoxDecorations):
     13
    1142019-08-27  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    215
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r249160 r249170  
    13481348        return;
    13491349
     1350    // You can use p::first-line to specify a background. If so, the root line boxes for
     1351    // a line may actually have to paint a background.
     1352    if (parent() && !renderer().hasVisibleBoxDecorations())
     1353        return;
     1354    const RenderStyle& lineStyle = this->lineStyle();
     1355    if (!parent() && (!isFirstLine() || &lineStyle == &renderer().style()))
     1356        return;
     1357
    13501358    LayoutRect frameRect(this->frameRect());
    13511359    constrainToLineTopAndBottomIfNeeded(frameRect);
     
    13541362    LayoutRect localRect(frameRect);
    13551363    flipForWritingMode(localRect);
    1356 
    1357     // You can use p::first-line to specify a background. If so, the root line boxes for
    1358     // a line may actually have to paint a background.
    1359     if (parent() && !renderer().hasVisibleBoxDecorations())
    1360         return;
    1361     const RenderStyle& lineStyle = this->lineStyle();
    1362     if (!parent() && (!isFirstLine() || &lineStyle == &renderer().style()))
    1363         return;
    13641364
    13651365    LayoutPoint adjustedPaintoffset = paintOffset + localRect.location();
Note: See TracChangeset for help on using the changeset viewer.