Optimize composited iframe layer hookup
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 03:06:23 +0000 (03:06 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 03:06:23 +0000 (03:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191778

Reviewed by Zalan Bujtas.

The change made in r238229 can be more targeted; we only need to hook up iframe content
layers when the layer is already composited (otherwise the updateBacking() above would have triggered
the work), and when it's a RenderWidget layer.

Tested by existing tests.

* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):

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

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

index dd80089..62b654e 100644 (file)
@@ -1,3 +1,21 @@
+2018-11-16  Simon Fraser  <simon.fraser@apple.com>
+
+        Optimize composited iframe layer hookup
+        https://bugs.webkit.org/show_bug.cgi?id=191778
+
+        Reviewed by Zalan Bujtas.
+
+        The change made in r238229 can be more targeted; we only need to hook up iframe content
+        layers when the layer is already composited (otherwise the updateBacking() above would have triggered
+        the work), and when it's a RenderWidget layer.
+        
+        Tested by existing tests.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::outputPaintOrderTreeRecursive):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::layerStyleChanged):
+
 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
 
         Provide default implementation of Widget
index 755111a..cbc2a22 100644 (file)
@@ -6701,7 +6701,7 @@ static void outputPaintOrderTreeRecursive(TextStream& stream, const WebCore::Ren
 
     auto layerRect = layer.rect();
 
-    stream << &layer << " " << layerRect;
+    stream << &layer << " " << layerRect << " " << layer.name();
     stream.nextLine();
 
     const_cast<WebCore::RenderLayer&>(layer).updateLayerListsIfNeeded();
index c52479c..1bd50a6 100644 (file)
@@ -1387,9 +1387,8 @@ void RenderLayerCompositor::layerStyleChanged(StyleDifference diff, RenderLayer&
         }
     }
 
-    // FIXME: this is necessary to get iframe layers hooked up in response to scheduleInvalidateStyleAndLayerComposition(),
-    // but we should avoid triggering config updates on every recompositeLayer.
-    if (diff == StyleDifference::RecompositeLayer)
+    // This is necessary to get iframe layers hooked up in response to scheduleInvalidateStyleAndLayerComposition().
+    if (diff == StyleDifference::RecompositeLayer && layer.isComposited() && is<RenderWidget>(layer.renderer()))
         layer.setNeedsCompositingConfigurationUpdate();
 
     if (diff >= StyleDifference::RecompositeLayer && oldStyle) {