Add testing for --force-compositing-mode to windows.internal
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Aug 2011 19:27:24 +0000 (19:27 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Aug 2011 19:27:24 +0000 (19:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=65777

Reviewed by Adam Barth.

.:

Add exports for Document::settings().

* Source/autotools/symbols.filter:

Source/WebCore:

Test: platform/chromium/compositing/force-compositing-mode/force-composite-empty.html

Move initial initialization to settings caching function so that RLC
picks up changes to the force compositing mode flag.

* WebCore.exp.in:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
* testing/Internals.cpp:
(WebCore::Internals::setForceCompositingMode):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Add exports for Document::settings().

* win/WebKit2.def:
* win/WebKit2CFLite.def:

LayoutTests:

Add empty page to test that the root gets a graphics layer.

* platform/chromium/compositing/force-compositing-mode/force-composite-empty-expected.txt: Added.
* platform/chromium/compositing/force-compositing-mode/force-composite-empty.html: Added.

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

14 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/platform/chromium/compositing/force-compositing-mode/force-composite-empty-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/compositing/force-compositing-mode/force-composite-empty.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter

index 52b12bb658f7d7cca908c5a36205b0a85b301efc..be45b3a09aa02b882dc4c9bf5093afbfb13a57b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-08-08  Adrienne Walker  <enne@google.com>
+
+        Add testing for --force-compositing-mode to windows.internal
+        https://bugs.webkit.org/show_bug.cgi?id=65777
+
+        Reviewed by Adam Barth.
+
+        Add exports for Document::settings().
+
+        * Source/autotools/symbols.filter:
+
 2011-08-09  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r92683.
index 82739e5a17de8d11c1a84c7844f3e94eb6e57ae7..f42c9472a8d89da8518f658e3c2da42b2ecc9bec 100644 (file)
@@ -1,3 +1,15 @@
+2011-08-08  Adrienne Walker  <enne@google.com>
+
+        Add testing for --force-compositing-mode to windows.internal
+        https://bugs.webkit.org/show_bug.cgi?id=65777
+
+        Reviewed by Adam Barth.
+
+        Add empty page to test that the root gets a graphics layer.
+
+        * platform/chromium/compositing/force-compositing-mode/force-composite-empty-expected.txt: Added.
+        * platform/chromium/compositing/force-compositing-mode/force-composite-empty.html: Added.
+
 2011-08-08  Ryosuke Niwa  <rniwa@webkit.org>
 
         Repeated copy and paste result in nested style elements such as b and font
diff --git a/LayoutTests/platform/chromium/compositing/force-compositing-mode/force-composite-empty-expected.txt b/LayoutTests/platform/chromium/compositing/force-compositing-mode/force-composite-empty-expected.txt
new file mode 100644 (file)
index 0000000..f023327
--- /dev/null
@@ -0,0 +1,9 @@
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+    )
+  )
+)
+
diff --git a/LayoutTests/platform/chromium/compositing/force-compositing-mode/force-composite-empty.html b/LayoutTests/platform/chromium/compositing/force-compositing-mode/force-composite-empty.html
new file mode 100644 (file)
index 0000000..508ebce
--- /dev/null
@@ -0,0 +1,19 @@
+<html>
+  <head>
+    <script>
+      if (window.internals)
+        window.internals.setForceCompositingMode(document, true);
+      function doTest() {
+        if (window.layoutTestController) {
+          document.getElementById("layertree").innerText = layoutTestController.layerTreeAsText();
+          layoutTestController.dumpAsText();
+        }
+      }
+      window.addEventListener("load", doTest, false);
+    </script>
+  </head>
+<body>
+  <!-- in force compositing mode the body should get its own graphics layer -->
+  <pre id="layertree"></pre>
+</body>
+</html>
index c740575930e7e040aaaae0d439a7a6b486f4ae87..d435c70832c367766f7557888deeedb703106510 100644 (file)
@@ -1,3 +1,25 @@
+2011-08-08  Adrienne Walker  <enne@google.com>
+
+        Add testing for --force-compositing-mode to windows.internal
+        https://bugs.webkit.org/show_bug.cgi?id=65777
+
+        Reviewed by Adam Barth.
+
+        Test: platform/chromium/compositing/force-compositing-mode/force-composite-empty.html
+
+        Move initial initialization to settings caching function so that RLC
+        picks up changes to the force compositing mode flag.
+
+        * WebCore.exp.in:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+        (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
+        (WebCore::RenderLayerCompositor::updateCompositingLayers):
+        * testing/Internals.cpp:
+        (WebCore::Internals::setForceCompositingMode):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2011-08-09  Alexandru Chiculita  <achicu@adobe.com>
 
         Fixing 65868 REGRESSION(r92610) caused by 65668 - Optimize floating elements lookup
index ca7bbddb4ade020f32f47df963fc18ce90369b49..1e12f407c2f46c64ab9cc7c57805bc65514721e5 100644 (file)
@@ -1313,6 +1313,7 @@ __ZNK7WebCore8Document4bodyEv
 __ZNK7WebCore8Document4pageEv
 __ZNK7WebCore8Document6domainEv
 __ZNK7WebCore8Document6loaderEv
+__ZNK7WebCore8Document8settingsEv
 __ZNK7WebCore8IntPointcv7CGPointEv
 __ZNK7WebCore8IntPointcv8_NSPointEv
 __ZNK7WebCore8Position10downstreamENS_27EditingBoundaryCrossingRuleE
index ce9e6cfbee0b4b2d07d7d76dd9df50d969077086..dd8678c5f237ce2d80251c5e04d29b538ebc9b93 100644 (file)
@@ -108,16 +108,6 @@ RenderLayerCompositor::RenderLayerCompositor(RenderView* renderView)
     , m_rootLayerUpdateCount(0)
 #endif // PROFILE_LAYER_REBUILD
 {
-    Settings* settings = m_renderView->document()->settings();
-
-    // Even when forcing compositing mode, ignore child frames, or this will trigger
-    // layer creation from the enclosing RenderIFrame.
-    ASSERT(m_renderView->document()->frame());
-    if (settings && settings->forceCompositingMode() && settings->acceleratedCompositingEnabled()
-        && !m_renderView->document()->frame()->tree()->parent()) {
-        m_forceCompositingMode = true;
-        enableCompositingMode();
-    }
 }
 
 RenderLayerCompositor::~RenderLayerCompositor()
@@ -143,11 +133,15 @@ void RenderLayerCompositor::cacheAcceleratedCompositingFlags()
     bool hasAcceleratedCompositing = false;
     bool showDebugBorders = false;
     bool showRepaintCounter = false;
+    bool forceCompositingMode = false;
 
     if (Settings* settings = m_renderView->document()->settings()) {
         hasAcceleratedCompositing = settings->acceleratedCompositingEnabled();
         showDebugBorders = settings->showDebugBorders();
         showRepaintCounter = settings->showRepaintCounter();
+
+        if (!m_renderView->document()->frame()->tree()->parent())
+            forceCompositingMode = settings->forceCompositingMode() && hasAcceleratedCompositing;
     }
 
     // We allow the chrome to override the settings, in case the page is rendered
@@ -162,12 +156,13 @@ void RenderLayerCompositor::cacheAcceleratedCompositingFlags()
         }
     }
 
-    if (hasAcceleratedCompositing != m_hasAcceleratedCompositing || showDebugBorders != m_showDebugBorders || showRepaintCounter != m_showRepaintCounter)
+    if (hasAcceleratedCompositing != m_hasAcceleratedCompositing || showDebugBorders != m_showDebugBorders || showRepaintCounter != m_showRepaintCounter || forceCompositingMode != m_forceCompositingMode)
         setCompositingLayersNeedRebuild();
 
     m_hasAcceleratedCompositing = hasAcceleratedCompositing;
     m_showDebugBorders = showDebugBorders;
     m_showRepaintCounter = showRepaintCounter;
+    m_forceCompositingMode = forceCompositingMode;
 }
 
 bool RenderLayerCompositor::canRender3DTransforms() const
@@ -254,6 +249,9 @@ void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
 {
     m_updateCompositingLayersTimer.stop();
 
+    if (m_forceCompositingMode && !m_compositing)
+        enableCompositingMode(true);
+
     if (!m_compositingDependsOnGeometry && !m_compositing)
         return;
 
index 6680ec54cdb19225a55546edd94f58eed287c8e6..e2b2349ca46be2e094eb47ef6569be332d77a05a 100644 (file)
@@ -37,6 +37,7 @@
 #include "Page.h"
 #include "RenderObject.h"
 #include "RenderTreeAsText.h"
+#include "Settings.h"
 #include "ShadowContentElement.h"
 #include "ShadowRoot.h"
 
@@ -178,4 +179,14 @@ PassRefPtr<ClientRect> Internals::boundingBox(Element* element, ExceptionCode& e
     return ClientRect::create(renderer->absoluteBoundingBoxRect());
 }
 
+void Internals::setForceCompositingMode(Document* document, bool enabled, ExceptionCode& ec)
+{
+    if (!document || !document->settings()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    document->settings()->setForceCompositingMode(enabled);
+}
+
 }
index 84fb401d18ccf3e98a31248deeebefb431dd8c1f..3e3bc18a4052d41fddaa56dbccbe2a350efd0e8d 100644 (file)
@@ -65,6 +65,8 @@ public:
 
     PassRefPtr<ClientRect> boundingBox(Element*, ExceptionCode&);
 
+    void setForceCompositingMode(Document*, bool enabled, ExceptionCode&);
+
 private:
     Internals();
 };
index 088d694bae14d39d46f07856f705ff2f1d6931b1..8da0b997e1cdd8b1ff5d6d1d41da6fb8b636bc7f 100644 (file)
@@ -42,6 +42,8 @@ module window {
         void setInspectorResourcesDataSizeLimits(in Document document, in long maximumResourcesContentSize, in long maximumSingleResourceContentSize) raises(DOMException);
 
         ClientRect boundingBox(in Element element) raises(DOMException);
+
+        void setForceCompositingMode(in Document document, in boolean enabled) raises(DOMException);
     };
 }
 
index ef710502ccf6902a03e8b6c4c546587f05f17fe4..bc6bf5d2d6e0936157c2fa4b80fb0e6985e90a14 100644 (file)
@@ -1,3 +1,15 @@
+2011-08-08  Adrienne Walker  <enne@google.com>
+
+        Add testing for --force-compositing-mode to windows.internal
+        https://bugs.webkit.org/show_bug.cgi?id=65777
+
+        Reviewed by Adam Barth.
+
+        Add exports for Document::settings().
+
+        * win/WebKit2.def:
+        * win/WebKit2CFLite.def:
+
 2011-08-09  Kenneth Rohde Christiansen  <kenneth@webkit.org>
 
         [Qt] Redirect didFindZoomableArea thru to the view
index 3ffdb7e5094b585286c2db9ef647712667bd790f..1a369ccbfb50c4791313749567afa8321699a7df 100644 (file)
@@ -160,6 +160,7 @@ EXPORTS
         ?setDisabled@MemoryCache@WebCore@@QAEX_N@Z
         ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
         ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z
+        ?settings@Document@WebCore@@QBEPAVSettings@2@XZ
         ?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ
         ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
         ?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
index b3fd56bb9c3701d71e4a292ee04b17d76de93215..fba2ed8179ce3d746dabd6660df04d9fce1c7e99 100644 (file)
@@ -154,6 +154,7 @@ EXPORTS
         ?setDisabled@MemoryCache@WebCore@@QAEX_N@Z
         ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
         ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z
+        ?settings@Document@WebCore@@QBEPAVSettings@2@XZ
         ?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ
         ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
         ?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
index cbd646ac4497e74d5d5ce46bc0d1a7a99a622fae..b01b1104374d80d4ac44b5820bb20ba6da6e026d 100644 (file)
@@ -62,6 +62,7 @@ _ZNK7WebCore20CachedResourceLoader11isPreloadedERKN3WTF6StringE;
 _ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE;
 _ZNK7WebCore7Element10shadowRootEv;
 _ZNK7WebCore8Document4pageEv;
+_ZNK7WebCore8Document8settingsEv;
 _ZNK7WebCore9TreeScope14getElementByIdERKN3WTF12AtomicStringE;
 local:
 _Z*;