Don't call clipCrossesPaintingBoundary() when not necessary
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2019 15:14:46 +0000 (15:14 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2019 15:14:46 +0000 (15:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201064

Reviewed by Zalan Bujtas.

clipCrossesPaintingBoundary() does some RenderLayer ancestor walks, so avoid
calling it when we already know that the clip rects are TemporaryClipRects.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249044 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp

index c81e4b4..f39bf26 100644 (file)
@@ -1,3 +1,16 @@
+2019-08-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Don't call clipCrossesPaintingBoundary() when not necessary
+        https://bugs.webkit.org/show_bug.cgi?id=201064
+
+        Reviewed by Zalan Bujtas.
+
+        clipCrossesPaintingBoundary() does some RenderLayer ancestor walks, so avoid
+        calling it when we already know that the clip rects are TemporaryClipRects.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects const):
+
 2019-08-23  Philippe Normand  <pnormand@igalia.com>
 
         [GStreamer] Hole-punch build is broken
index 6e302ed..07a092c 100644 (file)
@@ -5590,7 +5590,7 @@ void RenderLayer::calculateClipRects(const ClipRectsContext& clipRectsContext, C
             ClipRectsContext parentContext(clipRectsContext);
             parentContext.overlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize; // FIXME: why?
             
-            if (clipCrossesPaintingBoundary())
+            if (parentContext.clipRectsType != TemporaryClipRects && clipCrossesPaintingBoundary())
                 parentContext.clipRectsType = TemporaryClipRects;
 
             parentLayer->calculateClipRects(parentContext, clipRects);