2011-03-16 Daniel Sievers <sievers@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Mar 2011 23:37:48 +0000 (23:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Mar 2011 23:37:48 +0000 (23:37 +0000)
        Reviewed by James Robinson.

        Add setting to always force compositing mode
        https://bugs.webkit.org/show_bug.cgi?id=56156

        No new tests needed as this defaults to disabled (and is unfeasible
        to be tested through property overriding at runtime).

        * page/Settings.h:
        (WebCore::Settings::setForceCompositingMode):
        (WebCore::Settings::forceCompositingMode):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::RenderLayerCompositor):
        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
        * rendering/RenderLayerCompositor.h:
2011-03-16  Daniel Sievers  <sievers@google.com>

        Reviewed by James Robinson.

        Add setting to always force compositing mode
        https://bugs.webkit.org/show_bug.cgi?id=56156

        * public/WebSettings.h:
        * src/WebSettingsImpl.cpp:
        (WebKit::WebSettingsImpl::setForceCompositingMode):
        * src/WebSettingsImpl.h:
2011-03-16  Daniel Sievers  <sievers@google.com>

        Reviewed by James Robinson.

        Add setting to always force compositing mode
        https://bugs.webkit.org/show_bug.cgi?id=56156

        * DumpRenderTree/chromium/DumpRenderTree.cpp:
        (main):
        * DumpRenderTree/chromium/TestShell.cpp:
        (TestShell::TestShell):
        (TestShell::resetWebSettings):
        * DumpRenderTree/chromium/TestShell.h:
        (TestShell::setForceCompositingMode):
        * DumpRenderTree/chromium/WebPreferences.cpp:
        (WebPreferences::reset):
        (WebPreferences::applyTo):
        * DumpRenderTree/chromium/WebPreferences.h:

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

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/src/WebSettingsImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.h
Tools/ChangeLog
Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
Tools/DumpRenderTree/chromium/TestShell.cpp
Tools/DumpRenderTree/chromium/TestShell.h
Tools/DumpRenderTree/chromium/WebPreferences.cpp
Tools/DumpRenderTree/chromium/WebPreferences.h

index 5d17314..2fa1e86 100644 (file)
@@ -1,3 +1,21 @@
+2011-03-16  Daniel Sievers  <sievers@google.com>
+
+        Reviewed by James Robinson.
+
+        Add setting to always force compositing mode
+        https://bugs.webkit.org/show_bug.cgi?id=56156
+
+        No new tests needed as this defaults to disabled (and is unfeasible
+        to be tested through property overriding at runtime).
+
+        * page/Settings.h:
+        (WebCore::Settings::setForceCompositingMode):
+        (WebCore::Settings::forceCompositingMode):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+        * rendering/RenderLayerCompositor.h:
+
 2011-03-16  Vangelis Kokkevis  <vangelis@chromium.org>
 
         Reviewed by Kenneth Russell.
index aab936f..19adccc 100644 (file)
@@ -372,6 +372,9 @@ namespace WebCore {
         void setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag) { m_crossOriginCheckInGetMatchedCSSRulesDisabled = flag; }
         bool crossOriginCheckInGetMatchedCSSRulesDisabled() const { return m_crossOriginCheckInGetMatchedCSSRulesDisabled; }
 
+        void setForceCompositingMode(bool flag) { m_forceCompositingMode = flag; }
+        bool forceCompositingMode() { return m_forceCompositingMode; }
+
     private:
         Page* m_page;
 
@@ -470,6 +473,7 @@ namespace WebCore {
         bool m_usePreHTML5ParserQuirks: 1;
         bool m_hyperlinkAuditingEnabled : 1;
         bool m_crossOriginCheckInGetMatchedCSSRulesDisabled : 1;
+        bool m_forceCompositingMode : 1;
 
 #if USE(SAFARI_THEME)
         static bool gShouldPaintNativeControls;
index 37f1b9e..c036755 100644 (file)
@@ -103,11 +103,22 @@ RenderLayerCompositor::RenderLayerCompositor(RenderView* renderView)
     , m_compositing(false)
     , m_compositingLayersNeedRebuild(false)
     , m_flushingLayers(false)
+    , m_forceCompositingMode(false)
     , m_rootLayerAttachment(RootLayerUnattached)
 #if PROFILE_LAYER_REBUILD
     , 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()
@@ -711,7 +722,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O
 
     // If we're back at the root, and no other layers need to be composited, and the root layer itself doesn't need
     // to be composited, then we can drop out of compositing mode altogether.
-    if (layer->isRootLayer() && !childState.m_subtreeIsCompositing && !requiresCompositingLayer(layer)) {
+    if (layer->isRootLayer() && !childState.m_subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode) {
         enableCompositingMode(false);
         willBeComposited = false;
     }
index 32d64d3..7383891 100644 (file)
@@ -272,6 +272,7 @@ private:
     bool m_compositing;
     bool m_compositingLayersNeedRebuild;
     bool m_flushingLayers;
+    bool m_forceCompositingMode;
 
     RootLayerAttachment m_rootLayerAttachment;
 
index 7387aa9..6c7d54c 100644 (file)
@@ -1,3 +1,15 @@
+2011-03-16  Daniel Sievers  <sievers@google.com>
+
+        Reviewed by James Robinson.
+
+        Add setting to always force compositing mode
+        https://bugs.webkit.org/show_bug.cgi?id=56156
+
+        * public/WebSettings.h:
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::setForceCompositingMode):
+        * src/WebSettingsImpl.h:
+
 2011-03-16  Sreeram Ramachandran  <sreeram@google.com>
 
         Reviewed by Dimitri Glazkov.
index 11ed49d..113de52 100644 (file)
@@ -101,6 +101,7 @@ public:
     virtual bool showPlatformLayerTree() const = 0;
     virtual void setEditingBehavior(EditingBehavior) = 0;
     virtual void setAcceleratedCompositingEnabled(bool) = 0;
+    virtual void setForceCompositingMode(bool) = 0;
     virtual void setCompositeToTextureEnabled(bool) = 0;
     virtual bool compositeToTextureEnabled() const = 0;
     virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool) = 0;
index e5d172e..1089af9 100644 (file)
@@ -308,6 +308,11 @@ void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled)
     m_settings->setAcceleratedCompositingEnabled(enabled);
 }
 
+void WebSettingsImpl::setForceCompositingMode(bool enabled)
+{
+    m_settings->setForceCompositingMode(enabled);
+}
+
 void WebSettingsImpl::setCompositeToTextureEnabled(bool enabled)
 {
     m_compositeToTextureEnabled = enabled;
index 323a5b3..d0319f8 100644 (file)
@@ -94,6 +94,7 @@ public:
     virtual bool showPlatformLayerTree() const { return m_showPlatformLayerTree; }
     virtual void setEditingBehavior(EditingBehavior);
     virtual void setAcceleratedCompositingEnabled(bool);
+    virtual void setForceCompositingMode(bool);
     virtual void setCompositeToTextureEnabled(bool);
     virtual bool compositeToTextureEnabled() const { return m_compositeToTextureEnabled; }
     virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool);
index 34655c1..2ed97ff 100644 (file)
@@ -1,3 +1,22 @@
+2011-03-16  Daniel Sievers  <sievers@google.com>
+
+        Reviewed by James Robinson.
+
+        Add setting to always force compositing mode
+        https://bugs.webkit.org/show_bug.cgi?id=56156
+
+        * DumpRenderTree/chromium/DumpRenderTree.cpp:
+        (main):
+        * DumpRenderTree/chromium/TestShell.cpp:
+        (TestShell::TestShell):
+        (TestShell::resetWebSettings):
+        * DumpRenderTree/chromium/TestShell.h:
+        (TestShell::setForceCompositingMode):
+        * DumpRenderTree/chromium/WebPreferences.cpp:
+        (WebPreferences::reset):
+        (WebPreferences::applyTo):
+        * DumpRenderTree/chromium/WebPreferences.h:
+
 2011-03-15  Hayato Ito  <hayato@chromium.org>
 
         Reviewed by Ojan Vafai.
index e008432..fa7e91d 100644 (file)
@@ -53,6 +53,7 @@ static const char optionCheckLayoutTestSystemDeps[] = "--check-layout-test-sys-d
 
 static const char optionHardwareAcceleratedGL[] = "--enable-hardware-gpu";
 static const char optionEnableAcceleratedCompositing[] = "--enable-accelerated-compositing";
+static const char optionForceCompositingMode[] = "--force-compositing-mode";
 static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-canvas";
 
 static const char optionStressOpt[] = "--stress-opt";
@@ -131,6 +132,7 @@ int main(int argc, char* argv[])
     bool allowExternalPages = false;
     bool startupDialog = false;
     bool acceleratedCompositingEnabled = false;
+    bool forceCompositingMode = false;
     bool accelerated2DCanvasEnabled = false;
     bool stressOpt = false;
     bool stressDeopt = false;
@@ -161,6 +163,8 @@ int main(int argc, char* argv[])
             hardwareAcceleratedGL = true;
         else if (argument == optionEnableAcceleratedCompositing)
             acceleratedCompositingEnabled = true;
+        else if (argument == optionForceCompositingMode)
+            forceCompositingMode = true;
         else if (argument == optionEnableAccelerated2DCanvas)
             accelerated2DCanvasEnabled = true;
         else if (argument == optionStressOpt)
@@ -194,6 +198,7 @@ int main(int argc, char* argv[])
         TestShell shell(testShellMode);
         shell.setAllowExternalPages(allowExternalPages);
         shell.setAcceleratedCompositingEnabled(acceleratedCompositingEnabled);
+        shell.setForceCompositingMode(forceCompositingMode);
         shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled);
         shell.setJavaScriptFlags(javaScriptFlags);
         shell.setStressOpt(stressOpt);
index e1a86ef..1a4eb39 100644 (file)
@@ -85,6 +85,7 @@ TestShell::TestShell(bool testShellMode)
     , m_devTools(0)
     , m_allowExternalPages(false)
     , m_acceleratedCompositingEnabled(false)
+    , m_forceCompositingMode(false)
     , m_accelerated2dCanvasEnabled(false)
     , m_stressOpt(false)
     , m_stressDeopt(false)
@@ -163,6 +164,7 @@ void TestShell::resetWebSettings(WebView& webView)
 {
     m_prefs.reset();
     m_prefs.acceleratedCompositingEnabled = m_acceleratedCompositingEnabled;
+    m_prefs.forceCompositingMode = m_forceCompositingMode;
     m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled;
     m_prefs.applyTo(&webView);
 }
index ef9be7f..ecf19e5 100644 (file)
@@ -125,6 +125,7 @@ public:
     void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; }
 
     void setAcceleratedCompositingEnabled(bool enabled) { m_acceleratedCompositingEnabled = enabled; }
+    void setForceCompositingMode(bool enabled) { m_forceCompositingMode = enabled; }
     void setAccelerated2dCanvasEnabled(bool enabled) { m_accelerated2dCanvasEnabled = enabled; }
 
 #if defined(OS_WIN)
@@ -200,6 +201,7 @@ private:
     int m_timeout; // timeout value in millisecond
     bool m_allowExternalPages;
     bool m_acceleratedCompositingEnabled;
+    bool m_forceCompositingMode;
     bool m_accelerated2dCanvasEnabled;
     WebPreferences m_prefs;
     bool m_stressOpt;
index 71f5ec7..84f84b6 100644 (file)
@@ -104,6 +104,7 @@ void WebPreferences::reset()
     hyperlinkAuditingEnabled = false;
     acceleratedCompositingEnabled = false;
     accelerated2dCanvasEnabled = false;
+    forceCompositingMode = false;
 }
 
 void WebPreferences::applyTo(WebView* webView)
@@ -149,6 +150,7 @@ void WebPreferences::applyTo(WebView* webView)
     webView->setTabsToLinks(tabsToLinks);
     settings->setCaretBrowsingEnabled(caretBrowsingEnabled);
     settings->setAcceleratedCompositingEnabled(acceleratedCompositingEnabled);
+    settings->setForceCompositingMode(forceCompositingMode);
     settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled);
 
     // Fixed values.
index 50bb8cc..ad27fb8 100644 (file)
@@ -78,6 +78,7 @@ struct WebPreferences {
     bool hyperlinkAuditingEnabled;
     bool caretBrowsingEnabled;
     bool acceleratedCompositingEnabled;
+    bool forceCompositingMode;
     bool accelerated2dCanvasEnabled;
 
     WebPreferences() { reset(); }