Title: [249352] trunk/Source/WebCore
Revision
249352
Author
simon.fra...@apple.com
Date
2019-08-30 17:29:02 -0700 (Fri, 30 Aug 2019)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (249351 => 249352)


--- trunk/Source/WebCore/ChangeLog	2019-08-31 00:13:42 UTC (rev 249351)
+++ trunk/Source/WebCore/ChangeLog	2019-08-31 00:29:02 UTC (rev 249352)
@@ -1,3 +1,18 @@
+2019-08-30  Simon Fraser  <simon.fra...@apple.com>
+
+        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):
+
 2019-08-30  Saam Barati  <sbar...@apple.com>
 
         [WHLSL] Remove getters/setters/anders

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (249351 => 249352)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2019-08-31 00:13:42 UTC (rev 249351)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2019-08-31 00:29:02 UTC (rev 249352)
@@ -6400,7 +6400,7 @@
 
         if (is<RenderText>(child)) {
             const auto& renderText = downcast<RenderText>(child);
-            if (renderText.linesBoundingBox().isEmpty())
+            if (!renderText.hasRenderedText())
                 continue;
 
             if (renderer.style().userSelect() != UserSelect::None)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to