https://bugs.webkit.org/show_bug.cgi?id=109096
Patch by Eberhard Graether <egraether@google.com> on 2013-02-07
Reviewed by Pavel Feldman.
This change adds a checkbox to show composited layer borders to the WebInspector's
rendering settings and plumbs the setting to Chromium's WebLayerTreeView. The setting
is visible if InspectorClient::canShowDebugBorders() returns true.
Source/Platform:
* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):
(WebKit::WebLayerTreeView::setShowDebugBorders):
Source/WebCore:
No new tests.
* English.lproj/localizedStrings.js:
* inspector/Inspector.json:
* inspector/InspectorClient.h:
(WebCore::InspectorClient::canShowDebugBorders):
(WebCore::InspectorClient::setShowDebugBorders):
(InspectorClient):
* inspector/InspectorPageAgent.cpp:
(PageAgentState):
(WebCore::InspectorPageAgent::restore):
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::canShowDebugBorders):
(WebCore):
(WebCore::InspectorPageAgent::setShowDebugBorders):
* inspector/InspectorPageAgent.h:
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab):
(WebInspector.GenericSettingsTab.prototype.get _showDebugBordersChanged):
* inspector/front-end/inspector.js:
(WebInspector.doLoadedDone):
Source/WebKit/chromium:
* src/InspectorClientImpl.cpp:
(WebKit::InspectorClientImpl::canShowDebugBorders):
(WebKit):
(WebKit::InspectorClientImpl::setShowDebugBorders):
* src/InspectorClientImpl.h:
(InspectorClientImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::setShowDebugBorders):
(WebKit):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
* src/WebViewImpl.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142144
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-02-07 Eberhard Graether <egraether@google.com>
+
+ Web Inspector: Add settings checkbox for composited layer borders
+ https://bugs.webkit.org/show_bug.cgi?id=109096
+
+ Reviewed by Pavel Feldman.
+
+ This change adds a checkbox to show composited layer borders to the WebInspector's
+ rendering settings and plumbs the setting to Chromium's WebLayerTreeView. The setting
+ is visible if InspectorClient::canShowDebugBorders() returns true.
+
+ * chromium/public/WebLayerTreeView.h:
+ (WebLayerTreeView):
+ (WebKit::WebLayerTreeView::setShowDebugBorders):
+
2013-02-06 Tommy Widenflycht <tommyw@google.com>
MediaStream API: Implement DTMF support in RTCPeerConnection
// Toggles the paint rects in the HUD layer
virtual void setShowPaintRects(bool) { }
+ // Toggles the debug borders on layers
+ virtual void setShowDebugBorders(bool) { }
+
// Toggles continuous painting
virtual void setContinuousPaintingEnabled(bool) { }
+2013-02-07 Eberhard Graether <egraether@google.com>
+
+ Web Inspector: Add settings checkbox for composited layer borders
+ https://bugs.webkit.org/show_bug.cgi?id=109096
+
+ Reviewed by Pavel Feldman.
+
+ This change adds a checkbox to show composited layer borders to the WebInspector's
+ rendering settings and plumbs the setting to Chromium's WebLayerTreeView. The setting
+ is visible if InspectorClient::canShowDebugBorders() returns true.
+
+ No new tests.
+
+ * English.lproj/localizedStrings.js:
+ * inspector/Inspector.json:
+ * inspector/InspectorClient.h:
+ (WebCore::InspectorClient::canShowDebugBorders):
+ (WebCore::InspectorClient::setShowDebugBorders):
+ (InspectorClient):
+ * inspector/InspectorPageAgent.cpp:
+ (PageAgentState):
+ (WebCore::InspectorPageAgent::restore):
+ (WebCore::InspectorPageAgent::disable):
+ (WebCore::InspectorPageAgent::canShowDebugBorders):
+ (WebCore):
+ (WebCore::InspectorPageAgent::setShowDebugBorders):
+ * inspector/InspectorPageAgent.h:
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/SettingsScreen.js:
+ (WebInspector.GenericSettingsTab):
+ (WebInspector.GenericSettingsTab.prototype.get _showDebugBordersChanged):
+ * inspector/front-end/inspector.js:
+ (WebInspector.doLoadedDone):
+
2013-02-07 Gavin Peters <gavinp@chromium.org>
Unreviewed, rolling out r142141.
localizedStrings["IndexedDB"] = "IndexedDB";
localizedStrings["Animation"] = "Animation";
localizedStrings["Show paint rectangles"] = "Show paint rectangles";
+localizedStrings["Show composited layer borders"] = "Show composited layer borders";
localizedStrings["Show FPS meter"] = "Show FPS meter";
localizedStrings["Security origin"] = "Security origin";
localizedStrings["Version"] = "Version";
],
"hidden": true
},
+ {
+ "name": "canShowDebugBorders",
+ "description": "Tells if backend supports debug borders on layers",
+ "returns": [
+ { "name": "show", "type": "boolean", "description": "True if the debug borders can be shown" }
+ ],
+ "hidden": true
+ },
+ {
+ "name": "setShowDebugBorders",
+ "description": "Requests that backend shows debug borders on layers",
+ "parameters": [
+ { "name": "show", "type": "boolean", "description": "True for showing debug borders" }
+ ],
+ "hidden": true
+ },
{
"name": "canShowFPSCounter",
"description": "Tells if backend supports a FPS counter display",
virtual bool overridesShowPaintRects() { return false; }
virtual void setShowPaintRects(bool) { }
+ virtual bool canShowDebugBorders() { return false; }
+ virtual void setShowDebugBorders(bool) { }
+
virtual bool canShowFPSCounter() { return false; }
virtual void setShowFPSCounter(bool) { }
static const char pageAgentShowFPSCounter[] = "pageAgentShowFPSCounter";
static const char pageAgentContinuousPaintingEnabled[] = "pageAgentContinuousPaintingEnabled";
static const char pageAgentShowPaintRects[] = "pageAgentShowPaintRects";
+static const char pageAgentShowDebugBorders[] = "pageAgentShowDebugBorders";
#if ENABLE(TOUCH_EVENTS)
static const char touchEventEmulationEnabled[] = "touchEventEmulationEnabled";
#endif
setScriptExecutionDisabled(0, scriptExecutionDisabled);
bool showPaintRects = m_state->getBoolean(PageAgentState::pageAgentShowPaintRects);
setShowPaintRects(0, showPaintRects);
+ bool showDebugBorders = m_state->getBoolean(PageAgentState::pageAgentShowDebugBorders);
+ setShowDebugBorders(0, showDebugBorders);
bool showFPSCounter = m_state->getBoolean(PageAgentState::pageAgentShowFPSCounter);
setShowFPSCounter(0, showFPSCounter);
String emulatedMedia = m_state->getString(PageAgentState::pageAgentEmulatedMedia);
setScriptExecutionDisabled(0, false);
setShowPaintRects(0, false);
+ setShowDebugBorders(0, false);
setShowFPSCounter(0, false);
setEmulatedMedia(0, "");
setContinuousPaintingEnabled(0, false);
mainFrame()->view()->invalidate();
}
+void InspectorPageAgent::canShowDebugBorders(ErrorString*, bool* outParam)
+{
+ *outParam = m_client->canShowDebugBorders();
+}
+
+void InspectorPageAgent::setShowDebugBorders(ErrorString*, bool show)
+{
+ m_state->setBoolean(PageAgentState::pageAgentShowDebugBorders, show);
+ m_client->setShowDebugBorders(show);
+ if (mainFrame() && mainFrame()->view())
+ mainFrame()->view()->invalidate();
+}
+
void InspectorPageAgent::canShowFPSCounter(ErrorString*, bool* outParam)
{
*outParam = m_client->canShowFPSCounter();
virtual void canOverrideDeviceMetrics(ErrorString*, bool*);
virtual void setDeviceMetricsOverride(ErrorString*, int width, int height, double fontScaleFactor, bool fitWindow);
virtual void setShowPaintRects(ErrorString*, bool show);
+ virtual void canShowDebugBorders(ErrorString*, bool*);
+ virtual void setShowDebugBorders(ErrorString*, bool show);
virtual void canShowFPSCounter(ErrorString*, bool*);
virtual void setShowFPSCounter(ErrorString*, bool show);
virtual void canContinuouslyPaint(ErrorString*, bool*);
timelineCanMonitorMainThread: false,
canOverrideGeolocation: false,
canOverrideDeviceOrientation: false,
+ canShowDebugBorders: false,
canShowFPSCounter: false,
canContinuouslyPaint: false
}
this.emulateTouchEvents = this.createSetting("emulateTouchEvents", false);
this.showPaintRects = this.createSetting("showPaintRects", false);
this.continuousPainting = this.createSetting("continuousPainting", false);
+ this.showDebugBorders = this.createSetting("showDebugBorders", false);
this.showFPSCounter = this.createSetting("showFPSCounter", false);
this.showShadowDOM = this.createSetting("showShadowDOM", false);
this.zoomLevel = this.createSetting("zoomLevel", 0);
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show paint rectangles"), WebInspector.settings.showPaintRects));
WebInspector.settings.showPaintRects.addChangeListener(this._showPaintRectsChanged, this);
+ if (Capabilities.canShowDebugBorders) {
+ p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show composited layer borders"), WebInspector.settings.showDebugBorders));
+ WebInspector.settings.showDebugBorders.addChangeListener(this._showDebugBordersChanged, this);
+ }
if (Capabilities.canShowFPSCounter) {
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show FPS meter"), WebInspector.settings.showFPSCounter));
WebInspector.settings.showFPSCounter.addChangeListener(this._showFPSCounterChanged, this);
PageAgent.setShowPaintRects(WebInspector.settings.showPaintRects.get());
},
+ _showDebugBordersChanged: function()
+ {
+ PageAgent.setShowDebugBorders(WebInspector.settings.showDebugBorders.get());
+ },
+
_showFPSCounterChanged: function()
{
PageAgent.setShowFPSCounter(WebInspector.settings.showFPSCounter.get());
ProfilerAgent.hasHeapProfiler(WebInspector._initializeCapability.bind(WebInspector, "heapProfilerPresent", null));
TimelineAgent.supportsFrameInstrumentation(WebInspector._initializeCapability.bind(WebInspector, "timelineSupportsFrameInstrumentation", null));
TimelineAgent.canMonitorMainThread(WebInspector._initializeCapability.bind(WebInspector, "timelineCanMonitorMainThread", null));
+ PageAgent.canShowDebugBorders(WebInspector._initializeCapability.bind(WebInspector, "canShowDebugBorders", 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));
if (WebInspector.settings.showPaintRects.get())
PageAgent.setShowPaintRects(true);
+ if (WebInspector.settings.showDebugBorders.get())
+ PageAgent.setShowDebugBorders(true);
+
if (WebInspector.settings.continuousPainting.get())
PageAgent.setContinuousPaintingEnabled(true);
+2013-02-07 Eberhard Graether <egraether@google.com>
+
+ Web Inspector: Add settings checkbox for composited layer borders
+ https://bugs.webkit.org/show_bug.cgi?id=109096
+
+ Reviewed by Pavel Feldman.
+
+ This change adds a checkbox to show composited layer borders to the WebInspector's
+ rendering settings and plumbs the setting to Chromium's WebLayerTreeView. The setting
+ is visible if InspectorClient::canShowDebugBorders() returns true.
+
+ * src/InspectorClientImpl.cpp:
+ (WebKit::InspectorClientImpl::canShowDebugBorders):
+ (WebKit):
+ (WebKit::InspectorClientImpl::setShowDebugBorders):
+ * src/InspectorClientImpl.h:
+ (InspectorClientImpl):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::setShowDebugBorders):
+ (WebKit):
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ * src/WebViewImpl.h:
+
2013-02-07 Stephen White <senorblanco@chromium.org>
Unreviewed. Rolled DEPS.
m_inspectedWebView->setShowPaintRects(show);
}
+bool InspectorClientImpl::canShowDebugBorders()
+{
+ return true;
+}
+
+void InspectorClientImpl::setShowDebugBorders(bool show)
+{
+ m_inspectedWebView->setShowDebugBorders(show);
+}
+
bool InspectorClientImpl::canShowFPSCounter()
{
if (m_inspectedWebView->page())
virtual bool overridesShowPaintRects();
virtual void setShowPaintRects(bool);
+ virtual bool canShowDebugBorders();
+ virtual void setShowDebugBorders(bool);
+
virtual bool canShowFPSCounter();
virtual void setShowFPSCounter(bool);
, m_suppressInvalidations(false)
, m_showFPSCounter(false)
, m_showPaintRects(false)
+ , m_showDebugBorders(false)
, m_continuousPaintingEnabled(false)
{
// WebKit/win/WebView.cpp does the same thing, except they call the
m_showPaintRects = show;
}
+void WebViewImpl::setShowDebugBorders(bool show)
+{
+ if (isAcceleratedCompositingActive())
+ m_layerTreeView->setShowDebugBorders(show);
+ m_showDebugBorders = show;
+}
+
void WebViewImpl::setContinuousPaintingEnabled(bool enabled)
{
if (isAcceleratedCompositingActive()) {
m_pageOverlays->update();
m_layerTreeView->setShowFPSCounter(m_showFPSCounter);
m_layerTreeView->setShowPaintRects(m_showPaintRects);
+ m_layerTreeView->setShowDebugBorders(m_showDebugBorders);
m_layerTreeView->setContinuousPaintingEnabled(m_continuousPaintingEnabled);
} else {
m_nonCompositedContentHost.clear();
virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&);
virtual WebViewBenchmarkSupport* benchmarkSupport();
virtual void setShowPaintRects(bool);
+ virtual void setShowDebugBorders(bool);
virtual void setShowFPSCounter(bool);
virtual void setContinuousPaintingEnabled(bool);
bool m_showFPSCounter;
bool m_showPaintRects;
+ bool m_showDebugBorders;
bool m_continuousPaintingEnabled;
};