Source/WebCore: Create a separate setting for compositing of for scrollable [i]frames
authorvangelis@chromium.org <vangelis@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Nov 2011 23:03:05 +0000 (23:03 +0000)
committervangelis@chromium.org <vangelis@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Nov 2011 23:03:05 +0000 (23:03 +0000)
that forceCompositingMode can be used without turning frames into composited layers.
https://bugs.webkit.org/show_bug.cgi?id=71714

Reviewed by James Robinson.

* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setAcceleratedCompositingForScrollableFramesEnabled):
(WebCore::Settings::acceleratedCompositingForScrollableFramesEnabled):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
* testing/Internals.cpp:
(WebCore::Internals::setEnableCompositingForScrollableFrames):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests: [chromium] Make compositing for scrollable [i]frames a setting separate from
forceCompositingMode.
https://bugs.webkit.org/show_bug.cgi?id=71714

Adjust the force-compositing-mode layout tests to explicitly set the new flag.

Reviewed by James Robinson.

* platform/chromium/compositing/force-compositing-mode/force-composite-empty.html:
* platform/chromium/compositing/force-compositing-mode/no-overflow-iframe-layer.html:
* platform/chromium/compositing/force-compositing-mode/overflow-hidden-iframe-layer.html:
* platform/chromium/compositing/force-compositing-mode/overflow-iframe-enter-compositing.html:
* platform/chromium/compositing/force-compositing-mode/overflow-iframe-layer.html:
* platform/chromium/compositing/force-compositing-mode/overflow-iframe-leave-compositing.html:

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

14 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium/compositing/force-compositing-mode/force-composite-empty.html
LayoutTests/platform/chromium/compositing/force-compositing-mode/no-overflow-iframe-layer.html
LayoutTests/platform/chromium/compositing/force-compositing-mode/overflow-hidden-iframe-layer.html
LayoutTests/platform/chromium/compositing/force-compositing-mode/overflow-iframe-enter-compositing.html
LayoutTests/platform/chromium/compositing/force-compositing-mode/overflow-iframe-layer.html
LayoutTests/platform/chromium/compositing/force-compositing-mode/overflow-iframe-leave-compositing.html
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl

index d5806ec..640d680 100755 (executable)
@@ -1,3 +1,20 @@
+2011-11-07  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        [chromium] Make compositing for scrollable [i]frames a setting separate from
+        forceCompositingMode.
+        https://bugs.webkit.org/show_bug.cgi?id=71714
+
+        Adjust the force-compositing-mode layout tests to explicitly set the new flag.
+
+        Reviewed by James Robinson.
+
+        * platform/chromium/compositing/force-compositing-mode/force-composite-empty.html:
+        * platform/chromium/compositing/force-compositing-mode/no-overflow-iframe-layer.html:
+        * platform/chromium/compositing/force-compositing-mode/overflow-hidden-iframe-layer.html:
+        * platform/chromium/compositing/force-compositing-mode/overflow-iframe-enter-compositing.html:
+        * platform/chromium/compositing/force-compositing-mode/overflow-iframe-layer.html:
+        * platform/chromium/compositing/force-compositing-mode/overflow-iframe-leave-compositing.html:
+
 2011-11-07  Tony Chang  <tony@chromium.org>
 
         Update chromium test_expectations.txt.
index 508ebce..90981a6 100644 (file)
@@ -1,8 +1,10 @@
 <html>
   <head>
     <script>
-      if (window.internals)
+      if (window.internals) {
         window.internals.setForceCompositingMode(document, true);
+        window.internals.setEnableCompositingForScrollableFrames(document, true);
+      }
       function doTest() {
         if (window.layoutTestController) {
           document.getElementById("layertree").innerText = layoutTestController.layerTreeAsText();
index 61234ff..d65ee80 100644 (file)
       }
     }
     window.addEventListener("load", doTest, false);
-    if (window.internals)
+    if (window.internals) {
       internals.setForceCompositingMode(document, true);
+      internals.setEnableCompositingForScrollableFrames(document, true);
+    }
   </script>
 </head>
 <body>
index 04c3d7a..afe35e4 100644 (file)
@@ -7,8 +7,10 @@
     }
   </style>
   <script>
-    if (window.internals)
+    if (window.internals) {
       internals.setForceCompositingMode(document, true);
+      internals.setEnableCompositingForScrollableFrames(document, true);
+    }
     function doTest()
     {
       if (window.layoutTestController)
index 5a5906c..d3357fd 100644 (file)
@@ -7,8 +7,10 @@
     }
   </style>
   <script>
-    if (window.internals)
+    if (window.internals) {
       internals.setForceCompositingMode(document, true);
+      internals.setEnableCompositingForScrollableFrames(document, true);
+    }
     function doTest()
     {
       if (window.layoutTestController)
index 1fd5e35..a4c4a22 100644 (file)
@@ -7,8 +7,10 @@
     }
   </style>
   <script>
-    if (window.internals)
+    if (window.internals) {
       internals.setForceCompositingMode(document, true);
+      internals.setEnableCompositingForScrollableFrames(document, true);
+    }
     function doTest()
     {
       if (window.layoutTestController) {
index 1860f0e..bee3b0a 100644 (file)
@@ -7,8 +7,10 @@
     }
   </style>
   <script>
-    if (window.internals)
+    if (window.internals) {
       internals.setForceCompositingMode(document, true);
+      internals.setEnableCompositingForScrollableFrames(document, true);
+    }
     function doTest()
     {
       if (window.layoutTestController)
index 22d3230..141851d 100755 (executable)
@@ -1,3 +1,23 @@
+2011-11-07  Vangelis Kokkevis  <vangelis@chromium.org>
+
+        Create a separate setting for compositing of for scrollable [i]frames
+        that forceCompositingMode can be used without turning frames into composited layers.
+        https://bugs.webkit.org/show_bug.cgi?id=71714
+
+        Reviewed by James Robinson.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (WebCore::Settings::setAcceleratedCompositingForScrollableFramesEnabled):
+        (WebCore::Settings::acceleratedCompositingForScrollableFramesEnabled):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
+        * testing/Internals.cpp:
+        (WebCore::Internals::setEnableCompositingForScrollableFrames):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2011-11-07  Rafael Weinstein  <rafaelw@chromium.org>
 
         [MutationObservers] Fix mac build (with mutation_observers enabled)
index c2c6f65..c406db8 100644 (file)
@@ -181,6 +181,7 @@ Settings::Settings(Page* page)
     , m_acceleratedCompositingForCanvasEnabled(true)
     , m_acceleratedCompositingForAnimationEnabled(true)
     , m_acceleratedCompositingForFixedPositionEnabled(false)
+    , m_acceleratedCompositingForScrollableFramesEnabled(false)
     , m_showDebugBorders(false)
     , m_showRepaintCounter(false)
     , m_experimentalNotificationsEnabled(false)
index 1ff3c2d..caac52e 100644 (file)
@@ -322,6 +322,9 @@ namespace WebCore {
         void setAcceleratedCompositingForFixedPositionEnabled(bool enabled) { m_acceleratedCompositingForFixedPositionEnabled = enabled; }
         bool acceleratedCompositingForFixedPositionEnabled() const { return m_acceleratedCompositingForFixedPositionEnabled; }
 
+        void setAcceleratedCompositingForScrollableFramesEnabled(bool enabled) { m_acceleratedCompositingForScrollableFramesEnabled = enabled; }
+        bool acceleratedCompositingForScrollableFramesEnabled() const { return m_acceleratedCompositingForScrollableFramesEnabled; }
+
         void setShowDebugBorders(bool);
         bool showDebugBorders() const { return m_showDebugBorders; }
 
@@ -573,6 +576,7 @@ namespace WebCore {
         bool m_acceleratedCompositingForCanvasEnabled : 1;
         bool m_acceleratedCompositingForAnimationEnabled : 1;
         bool m_acceleratedCompositingForFixedPositionEnabled : 1;
+        bool m_acceleratedCompositingForScrollableFramesEnabled : 1; // Works only in conjunction with forceCompositingMode
         bool m_showDebugBorders : 1;
         bool m_showRepaintCounter : 1;
         bool m_experimentalNotificationsEnabled : 1;
index ca70b6b..f93a399 100644 (file)
@@ -144,7 +144,7 @@ void RenderLayerCompositor::cacheAcceleratedCompositingFlags()
         forceCompositingMode = settings->forceCompositingMode() && hasAcceleratedCompositing;
 
         if (forceCompositingMode && m_renderView->document()->ownerElement())
-            forceCompositingMode = requiresCompositingForScrollableFrame();
+            forceCompositingMode = settings->acceleratedCompositingForScrollableFramesEnabled() && requiresCompositingForScrollableFrame();
     }
 
     // We allow the chrome to override the settings, in case the page is rendered
index b1ddd19..cae6e8e 100644 (file)
@@ -253,6 +253,16 @@ void Internals::setEnableCompositingForFixedPosition(Document* document, bool en
     document->settings()->setAcceleratedCompositingForFixedPositionEnabled(enabled);
 }
 
+void Internals::setEnableCompositingForScrollableFrames(Document* document, bool enabled, ExceptionCode& ec)
+{
+    if (!document || !document->settings()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    document->settings()->setAcceleratedCompositingForScrollableFramesEnabled(enabled);
+}
+
 void Internals::setAcceleratedDrawingEnabled(Document* document, bool enabled, ExceptionCode& ec)
 {
     if (!document || !document->settings()) {
index ed0f6d9..5dfc112 100644 (file)
@@ -76,6 +76,7 @@ public:
 
     void setForceCompositingMode(Document*, bool enabled, ExceptionCode&);
     void setEnableCompositingForFixedPosition(Document*, bool enabled, ExceptionCode&);
+    void setEnableCompositingForScrollableFrames(Document*, bool enabled, ExceptionCode&);
     void setAcceleratedDrawingEnabled(Document*, bool enabled, ExceptionCode&);
 
     void setEnableScrollAnimator(Document*, bool enabled, ExceptionCode&);
index 4a36638..3db6508 100644 (file)
@@ -50,6 +50,7 @@ module window {
 
         void setForceCompositingMode(in Document document, in boolean enabled) raises(DOMException);
         void setEnableCompositingForFixedPosition(in Document document, in boolean enabled) raises(DOMException);
+        void setEnableCompositingForScrollableFrames(in Document document, in boolean enabled) raises(DOMException);
         void setAcceleratedDrawingEnabled(in Document document, in boolean enabled) raises(DOMException);
         void setEnableScrollAnimator(in Document document, in boolean enabled) raises(DOMException);
         void setZoomAnimatorTransform(in Document document, in float scale, in float tx, in float ty) raises(DOMException);