Changeset 249352 in webkit


Ignore:
Timestamp:
Aug 30, 2019 5:29:02 PM (5 years ago)
Author:
Simon Fraser
Message:

Minor optimization in determineNonLayerDescendantsPaintedContent()
https://bugs.webkit.org/show_bug.cgi?id=201352

Reviewed by Antti Koivisto.

It's cheaper to call renderText.hasRenderedText() than renderText.linesBoundingBox(), because
the latter has to traverse all the InlineTextBoxes. This code path is fairly hot when
scrolling twitter feeds, since it's called from RenderLayer::updateLayerPositionsAfterScroll()
which calls RenderLayer::isVisuallyNonEmpty().

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::calculateClipRects const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249351 r249352  
     12019-08-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Minor optimization in determineNonLayerDescendantsPaintedContent()
     4        https://bugs.webkit.org/show_bug.cgi?id=201352
     5
     6        Reviewed by Antti Koivisto.
     7
     8        It's cheaper to call renderText.hasRenderedText() than renderText.linesBoundingBox(), because
     9        the latter has to traverse all the InlineTextBoxes. This code path is fairly hot when
     10        scrolling twitter feeds, since it's called from RenderLayer::updateLayerPositionsAfterScroll()
     11        which calls RenderLayer::isVisuallyNonEmpty().
     12
     13        * rendering/RenderLayer.cpp:
     14        (WebCore::RenderLayer::calculateClipRects const):
     15
    1162019-08-30  Saam Barati  <sbarati@apple.com>
    217
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r249339 r249352  
    64016401        if (is<RenderText>(child)) {
    64026402            const auto& renderText = downcast<RenderText>(child);
    6403             if (renderText.linesBoundingBox().isEmpty())
     6403            if (!renderText.hasRenderedText())
    64046404                continue;
    64056405
Note: See TracChangeset for help on using the changeset viewer.