Title: [140798] trunk/Source
Revision
140798
Author
commit-qu...@webkit.org
Date
2013-01-25 01:03:59 -0800 (Fri, 25 Jan 2013)

Log Message

Web Inspector: add checkbox for continuous painting to the inspector's settings
https://bugs.webkit.org/show_bug.cgi?id=107352

Patch by Eberhard Graether <egraet...@google.com> on 2013-01-25
Reviewed by Pavel Feldman.

This change adds a checkbox to activate continuous painting to the WebInspector's
rendering settings and plumbs the setting to Chromium's WebLayerTreeView. The
setting is visible if InspectorClient::canContinuouslyPaint() returns true.

Source/Platform:

* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):
(WebKit::WebLayerTreeView::setContinuousPaintingEnabled):

Source/WebCore:

No new tests.

* English.lproj/localizedStrings.js:
* inspector/Inspector.json:
* inspector/InspectorClient.h:
(WebCore::InspectorClient::canContinuouslyPaint):
(WebCore::InspectorClient::setContinuousPaintingEnabled):
(InspectorClient):
* inspector/InspectorPageAgent.cpp:
(PageAgentState):
(WebCore::InspectorPageAgent::restore):
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::canContinuouslyPaint):
(WebCore):
(WebCore::InspectorPageAgent::setContinuousPaintingEnabled):
* inspector/InspectorPageAgent.h:
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab):
(WebInspector.GenericSettingsTab.prototype.get _continuousPaintingChanged):
* inspector/front-end/inspector.js:
(WebInspector.doLoadedDone):

Source/WebKit/chromium:

* public/WebView.h:
(WebView):
* src/InspectorClientImpl.cpp:
(WebKit::InspectorClientImpl::canContinuouslyPaint):
(WebKit):
(WebKit::InspectorClientImpl::setContinuousPaintingEnabled):
* src/InspectorClientImpl.h:
(InspectorClientImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setContinuousPaintingEnabled):
(WebKit):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
* src/WebViewImpl.h:

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (140797 => 140798)


--- trunk/Source/Platform/ChangeLog	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/Platform/ChangeLog	2013-01-25 09:03:59 UTC (rev 140798)
@@ -1,3 +1,18 @@
+2013-01-25  Eberhard Graether  <egraet...@google.com>
+
+        Web Inspector: add checkbox for continuous painting to the inspector's settings
+        https://bugs.webkit.org/show_bug.cgi?id=107352
+
+        Reviewed by Pavel Feldman.
+
+        This change adds a checkbox to activate continuous painting to the WebInspector's
+        rendering settings and plumbs the setting to Chromium's WebLayerTreeView. The
+        setting is visible if InspectorClient::canContinuouslyPaint() returns true.
+
+        * chromium/public/WebLayerTreeView.h:
+        (WebLayerTreeView):
+        (WebKit::WebLayerTreeView::setContinuousPaintingEnabled):
+
 2013-01-22  Nat Duca  <nd...@chromium.org>
 
         [chromium] Add WebDiscardableMemory to platform

Modified: trunk/Source/Platform/chromium/public/WebLayerTreeView.h (140797 => 140798)


--- trunk/Source/Platform/chromium/public/WebLayerTreeView.h	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/Platform/chromium/public/WebLayerTreeView.h	2013-01-25 09:03:59 UTC (rev 140798)
@@ -183,6 +183,9 @@
     // Toggles the paint rects in the HUD layer
     virtual void setShowPaintRects(bool) { }
 
+    // Toggles continuous painting
+    virtual void setContinuousPaintingEnabled(bool) { }
+
     // FIXME: Remove this.
     virtual void loseCompositorContext(int numTimes) { }
 };

Modified: trunk/Source/WebCore/ChangeLog (140797 => 140798)


--- trunk/Source/WebCore/ChangeLog	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebCore/ChangeLog	2013-01-25 09:03:59 UTC (rev 140798)
@@ -1,3 +1,37 @@
+2013-01-25  Eberhard Graether  <egraet...@google.com>
+
+        Web Inspector: add checkbox for continuous painting to the inspector's settings
+        https://bugs.webkit.org/show_bug.cgi?id=107352
+
+        Reviewed by Pavel Feldman.
+
+        This change adds a checkbox to activate continuous painting to the WebInspector's
+        rendering settings and plumbs the setting to Chromium's WebLayerTreeView. The
+        setting is visible if InspectorClient::canContinuouslyPaint() returns true.
+
+        No new tests.
+
+        * English.lproj/localizedStrings.js:
+        * inspector/Inspector.json:
+        * inspector/InspectorClient.h:
+        (WebCore::InspectorClient::canContinuouslyPaint):
+        (WebCore::InspectorClient::setContinuousPaintingEnabled):
+        (InspectorClient):
+        * inspector/InspectorPageAgent.cpp:
+        (PageAgentState):
+        (WebCore::InspectorPageAgent::restore):
+        (WebCore::InspectorPageAgent::disable):
+        (WebCore::InspectorPageAgent::canContinuouslyPaint):
+        (WebCore):
+        (WebCore::InspectorPageAgent::setContinuousPaintingEnabled):
+        * inspector/InspectorPageAgent.h:
+        * inspector/front-end/Settings.js:
+        * inspector/front-end/SettingsScreen.js:
+        (WebInspector.GenericSettingsTab):
+        (WebInspector.GenericSettingsTab.prototype.get _continuousPaintingChanged):
+        * inspector/front-end/inspector.js:
+        (WebInspector.doLoadedDone):
+
 2013-01-25  Dominic Mazzoni  <dmazz...@google.com>
 
         REGRESSION (r140658): Multiple accessibility failures on GTK

Modified: trunk/Source/WebCore/English.lproj/localizedStrings.js (140797 => 140798)


--- trunk/Source/WebCore/English.lproj/localizedStrings.js	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebCore/English.lproj/localizedStrings.js	2013-01-25 09:03:59 UTC (rev 140798)
@@ -180,6 +180,7 @@
 localizedStrings["Emulate touch events"] = "Emulate touch events";
 localizedStrings["Enable Breakpoint"] = "Enable Breakpoint";
 localizedStrings["Enable breakpoint"] = "Enable breakpoint";
+localizedStrings["Enable continuous page repainting"] = "Enable continuous page repainting";
 localizedStrings["Enable Debugging"] = "Enable Debugging";
 localizedStrings["Enable Profiling"] = "Enable Profiling";
 localizedStrings["Enabling debugging will make scripts run slower."] = "Enabling debugging will make scripts run slower.";

Modified: trunk/Source/WebCore/inspector/Inspector.json (140797 => 140798)


--- trunk/Source/WebCore/inspector/Inspector.json	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebCore/inspector/Inspector.json	2013-01-25 09:03:59 UTC (rev 140798)
@@ -366,6 +366,22 @@
                 "hidden": true
             },
             {
+                "name": "canContinuouslyPaint",
+                "description": "Tells if backend supports continuous painting",
+                "returns": [
+                    { "name": "value", "type": "boolean", "description": "True if continuous painting is available" }
+                ],
+                "hidden": true
+            },
+            {
+                "name": "setContinuousPaintingEnabled",
+                "description": "Requests that backend enables continuous painting",
+                "parameters": [
+                    { "name": "enabled", "type": "boolean", "description": "True for enabling cointinuous painting" }
+                ],
+                "hidden": true
+            },
+            {
                 "name": "getScriptExecutionStatus",
                 "description": "Determines if scripts can be executed in the page.",
                 "returns": [

Modified: trunk/Source/WebCore/inspector/InspectorClient.h (140797 => 140798)


--- trunk/Source/WebCore/inspector/InspectorClient.h	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebCore/inspector/InspectorClient.h	2013-01-25 09:03:59 UTC (rev 140798)
@@ -76,6 +76,9 @@
     virtual bool canShowFPSCounter() { return false; }
     virtual void setShowFPSCounter(bool) { }
 
+    virtual bool canContinuouslyPaint() { return false; }
+    virtual void setContinuousPaintingEnabled(bool) { }
+
     virtual bool supportsFrameInstrumentation() { return false; }
 
     virtual void getAllocatedObjects(HashSet<const void*>&) { }

Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (140797 => 140798)


--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2013-01-25 09:03:59 UTC (rev 140798)
@@ -93,6 +93,7 @@
 static const char pageAgentFontScaleFactorOverride[] = "pageAgentFontScaleFactorOverride";
 static const char pageAgentFitWindow[] = "pageAgentFitWindow";
 static const char pageAgentShowFPSCounter[] = "pageAgentShowFPSCounter";
+static const char pageAgentContinuousPaintingEnabled[] = "pageAgentContinuousPaintingEnabled";
 static const char pageAgentShowPaintRects[] = "pageAgentShowPaintRects";
 #if ENABLE(TOUCH_EVENTS)
 static const char touchEventEmulationEnabled[] = "touchEventEmulationEnabled";
@@ -366,6 +367,8 @@
         setShowFPSCounter(0, showFPSCounter);
         String emulatedMedia = m_state->getString(PageAgentState::pageAgentEmulatedMedia);
         setEmulatedMedia(0, emulatedMedia);
+        bool continuousPaintingEnabled = m_state->getBoolean(PageAgentState::pageAgentContinuousPaintingEnabled);
+        setContinuousPaintingEnabled(0, continuousPaintingEnabled);
 
         int currentWidth = static_cast<int>(m_state->getLong(PageAgentState::pageAgentScreenWidthOverride));
         int currentHeight = static_cast<int>(m_state->getLong(PageAgentState::pageAgentScreenHeightOverride));
@@ -401,6 +404,7 @@
     setShowPaintRects(0, false);
     setShowFPSCounter(0, false);
     setEmulatedMedia(0, "");
+    setContinuousPaintingEnabled(0, false);
 
     // When disabling the agent, reset the override values.
     m_state->setLong(PageAgentState::pageAgentScreenWidthOverride, 0);
@@ -749,6 +753,20 @@
         mainFrame()->view()->invalidate();
 }
 
+void InspectorPageAgent::canContinuouslyPaint(ErrorString*, bool* outParam)
+{
+    *outParam = m_client->canContinuouslyPaint();
+}
+
+void InspectorPageAgent::setContinuousPaintingEnabled(ErrorString*, bool enabled)
+{
+    m_state->setBoolean(PageAgentState::pageAgentContinuousPaintingEnabled, enabled);
+    m_client->setContinuousPaintingEnabled(enabled);
+
+    if (!enabled && mainFrame() && mainFrame()->view())
+        mainFrame()->view()->invalidate();
+}
+
 void InspectorPageAgent::getScriptExecutionStatus(ErrorString*, PageCommandHandler::Result::Enum* status)
 {
     bool disabledByScriptController = false;

Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (140797 => 140798)


--- trunk/Source/WebCore/inspector/InspectorPageAgent.h	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h	2013-01-25 09:03:59 UTC (rev 140798)
@@ -111,6 +111,8 @@
     virtual void setShowPaintRects(ErrorString*, bool show);
     virtual void canShowFPSCounter(ErrorString*, bool*);
     virtual void setShowFPSCounter(ErrorString*, bool show);
+    virtual void canContinuouslyPaint(ErrorString*, bool*);
+    virtual void setContinuousPaintingEnabled(ErrorString*, bool enabled);
     virtual void getScriptExecutionStatus(ErrorString*, PageCommandHandler::Result::Enum*);
     virtual void setScriptExecutionDisabled(ErrorString*, bool);
     virtual void setGeolocationOverride(ErrorString*, const double*, const double*, const double*);

Modified: trunk/Source/WebCore/inspector/front-end/Settings.js (140797 => 140798)


--- trunk/Source/WebCore/inspector/front-end/Settings.js	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebCore/inspector/front-end/Settings.js	2013-01-25 09:03:59 UTC (rev 140798)
@@ -60,7 +60,8 @@
     timelineCanMonitorMainThread: false,
     canOverrideGeolocation: false,
     canOverrideDeviceOrientation: false,
-    canShowFPSCounter: false
+    canShowFPSCounter: false,
+    canContinuouslyPaint: false
 }
 
 /**
@@ -99,6 +100,7 @@
     this.showScriptFolders = this.createSetting("showScriptFolders", true);
     this.emulateTouchEvents = this.createSetting("emulateTouchEvents", false);
     this.showPaintRects = this.createSetting("showPaintRects", false);
+    this.continuousPainting = this.createSetting("continuousPainting", false);
     this.showFPSCounter = this.createSetting("showFPSCounter", false);
     this.showShadowDOM = this.createSetting("showShadowDOM", false);
     this.zoomLevel = this.createSetting("zoomLevel", 0);

Modified: trunk/Source/WebCore/inspector/front-end/SettingsScreen.js (140797 => 140798)


--- trunk/Source/WebCore/inspector/front-end/SettingsScreen.js	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebCore/inspector/front-end/SettingsScreen.js	2013-01-25 09:03:59 UTC (rev 140798)
@@ -296,6 +296,10 @@
         p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show FPS meter"), WebInspector.settings.showFPSCounter));
         WebInspector.settings.showFPSCounter.addChangeListener(this._showFPSCounterChanged, this);
     }
+    if (Capabilities.canContinuouslyPaint) {
+        p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Enable continuous page repainting"), WebInspector.settings.continuousPainting));
+        WebInspector.settings.continuousPainting.addChangeListener(this._continuousPaintingChanged, this);
+    }
 
     p = this._appendSection(WebInspector.UIString("Sources"));
     p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show folders"), WebInspector.settings.showScriptFolders));
@@ -344,6 +348,11 @@
         PageAgent.setShowFPSCounter(WebInspector.settings.showFPSCounter.get());
     },
 
+    _continuousPaintingChanged: function()
+    {
+        PageAgent.setContinuousPaintingEnabled(WebInspector.settings.continuousPainting.get());
+    },
+
     _updateScriptDisabledCheckbox: function()
     {
         function executionStatusCallback(error, status)

Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (140797 => 140798)


--- trunk/Source/WebCore/inspector/front-end/inspector.js	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js	2013-01-25 09:03:59 UTC (rev 140798)
@@ -372,6 +372,7 @@
     TimelineAgent.supportsFrameInstrumentation(WebInspector._initializeCapability.bind(WebInspector, "timelineSupportsFrameInstrumentation", null));
     TimelineAgent.canMonitorMainThread(WebInspector._initializeCapability.bind(WebInspector, "timelineCanMonitorMainThread", null));
     PageAgent.canShowFPSCounter(WebInspector._initializeCapability.bind(WebInspector, "canShowFPSCounter", null));
+    PageAgent.canContinuouslyPaint(WebInspector._initializeCapability.bind(WebInspector, "canContinuouslyPaint", null));
     PageAgent.canOverrideDeviceMetrics(WebInspector._initializeCapability.bind(WebInspector, "canOverrideDeviceMetrics", null));
     PageAgent.canOverrideGeolocation(WebInspector._initializeCapability.bind(WebInspector, "canOverrideGeolocation", null));
     PageAgent.canOverrideDeviceOrientation(WebInspector._initializeCapability.bind(WebInspector, "canOverrideDeviceOrientation", WebInspector._doLoadedDoneWithCapabilities.bind(WebInspector)));
@@ -491,6 +492,9 @@
     if (WebInspector.settings.showPaintRects.get())
         PageAgent.setShowPaintRects(true);
 
+    if (WebInspector.settings.continuousPainting.get())
+        PageAgent.setContinuousPaintingEnabled(true);
+
     if (WebInspector.settings._javascript_Disabled.get())
         PageAgent.setScriptExecutionDisabled(true);
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (140797 => 140798)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-01-25 09:03:59 UTC (rev 140798)
@@ -1,3 +1,28 @@
+2013-01-25  Eberhard Graether  <egraet...@google.com>
+
+        Web Inspector: add checkbox for continuous painting to the inspector's settings
+        https://bugs.webkit.org/show_bug.cgi?id=107352
+
+        Reviewed by Pavel Feldman.
+
+        This change adds a checkbox to activate continuous painting to the WebInspector's
+        rendering settings and plumbs the setting to Chromium's WebLayerTreeView. The
+        setting is visible if InspectorClient::canContinuouslyPaint() returns true.
+
+        * public/WebView.h:
+        (WebView):
+        * src/InspectorClientImpl.cpp:
+        (WebKit::InspectorClientImpl::canContinuouslyPaint):
+        (WebKit):
+        (WebKit::InspectorClientImpl::setContinuousPaintingEnabled):
+        * src/InspectorClientImpl.h:
+        (InspectorClientImpl):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::setContinuousPaintingEnabled):
+        (WebKit):
+        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+        * src/WebViewImpl.h:
+
 2013-01-24  Keishi Hattori  <kei...@webkit.org>
 
         Adjust design of the Calendar Picker

Modified: trunk/Source/WebKit/chromium/public/WebView.h (140797 => 140798)


--- trunk/Source/WebKit/chromium/public/WebView.h	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebKit/chromium/public/WebView.h	2013-01-25 09:03:59 UTC (rev 140798)
@@ -472,6 +472,7 @@
 
     virtual void setShowPaintRects(bool) = 0;
     virtual void setShowFPSCounter(bool) = 0;
+    virtual void setContinuousPaintingEnabled(bool) = 0;
 
     // Benchmarking support -------------------------------------------------
 

Modified: trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp (140797 => 140798)


--- trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp	2013-01-25 09:03:59 UTC (rev 140798)
@@ -172,6 +172,16 @@
     m_inspectedWebView->setShowFPSCounter(show);
 }
 
+bool InspectorClientImpl::canContinuouslyPaint()
+{
+    return true;
+}
+
+void InspectorClientImpl::setContinuousPaintingEnabled(bool enabled)
+{
+    m_inspectedWebView->setContinuousPaintingEnabled(enabled);
+}
+
 bool InspectorClientImpl::supportsFrameInstrumentation()
 {
     return true;

Modified: trunk/Source/WebKit/chromium/src/InspectorClientImpl.h (140797 => 140798)


--- trunk/Source/WebKit/chromium/src/InspectorClientImpl.h	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebKit/chromium/src/InspectorClientImpl.h	2013-01-25 09:03:59 UTC (rev 140798)
@@ -79,6 +79,9 @@
     virtual bool canShowFPSCounter();
     virtual void setShowFPSCounter(bool);
 
+    virtual bool canContinuouslyPaint();
+    virtual void setContinuousPaintingEnabled(bool);
+
     virtual bool supportsFrameInstrumentation();
 
     virtual void getAllocatedObjects(HashSet<const void*>&);

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (140797 => 140798)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-25 09:03:59 UTC (rev 140798)
@@ -873,6 +873,15 @@
     m_showPaintRects = show;
 }
 
+void WebViewImpl::setContinuousPaintingEnabled(bool enabled)
+{
+    if (isAcceleratedCompositingActive()) {
+        TRACE_EVENT0("webkit", "WebViewImpl::setContinuousPaintingEnabled");
+        m_layerTreeView->setContinuousPaintingEnabled(enabled);
+    }
+    m_continuousPaintingEnabled = enabled;
+}
+
 bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
 {
     ASSERT((event.type == WebInputEvent::RawKeyDown)
@@ -4069,6 +4078,7 @@
                 m_pageOverlays->update();
             m_layerTreeView->setShowFPSCounter(m_showFPSCounter);
             m_layerTreeView->setShowPaintRects(m_showPaintRects);
+            m_layerTreeView->setContinuousPaintingEnabled(m_continuousPaintingEnabled);
         } else {
             m_nonCompositedContentHost.clear();
             m_isAcceleratedCompositingActive = false;

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (140797 => 140798)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-01-25 08:55:07 UTC (rev 140797)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-01-25 09:03:59 UTC (rev 140798)
@@ -311,6 +311,7 @@
     virtual WebViewBenchmarkSupport* benchmarkSupport();
     virtual void setShowPaintRects(bool);
     virtual void setShowFPSCounter(bool);
+    virtual void setContinuousPaintingEnabled(bool);
 
     // WebLayerTreeViewClient
     virtual void willBeginFrame();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to