Diff
Modified: trunk/Source/Platform/ChangeLog (134390 => 134391)
--- trunk/Source/Platform/ChangeLog 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/Platform/ChangeLog 2012-11-13 10:25:21 UTC (rev 134391)
@@ -1,3 +1,16 @@
+2012-11-13 Eberhard Graether <[email protected]>
+
+ checkbox to toggle FPS counter in the inspector's settings
+ https://bugs.webkit.org/show_bug.cgi?id=99660
+
+ Reviewed by Pavel Feldman.
+
+ Added a checkbox to the inspector's settings to toggle a FPS counter. The checkbox appears when InspectorClient::canShowFPSCounter() returns true.
+
+ * chromium/public/WebLayerTreeView.h:
+ (WebLayerTreeView):
+ (WebKit::WebLayerTreeView::setShowFPSCounter):
+
2012-11-12 Alexandre Elias <[email protected]>
[chromium] Delete WebCompositor.h
Modified: trunk/Source/Platform/chromium/public/WebLayerTreeView.h (134390 => 134391)
--- trunk/Source/Platform/chromium/public/WebLayerTreeView.h 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/Platform/chromium/public/WebLayerTreeView.h 2012-11-13 10:25:21 UTC (rev 134391)
@@ -169,6 +169,9 @@
// This call is relatively expensive in threaded mode as it blocks on the compositor thread.
virtual void renderingStats(WebRenderingStats&) const = 0;
+ // Toggles the FPS counter in the HUD layer
+ virtual void setShowFPSCounter(bool) { }
+
// Provides a font atlas to use for debug visualizations. The atlas must be a bitmap containing glyph data, a table of
// ASCII character values to a subrectangle of the atlas representing the corresponding glyph, and the glyph height.
virtual void setFontAtlas(WebRect asciiToRectTable[128], const SkBitmap&, int fontHeight) { }
Modified: trunk/Source/WebCore/ChangeLog (134390 => 134391)
--- trunk/Source/WebCore/ChangeLog 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebCore/ChangeLog 2012-11-13 10:25:21 UTC (rev 134391)
@@ -1,3 +1,35 @@
+2012-11-13 Eberhard Graether <[email protected]>
+
+ checkbox to toggle FPS counter in the inspector's settings
+ https://bugs.webkit.org/show_bug.cgi?id=99660
+
+ Reviewed by Pavel Feldman.
+
+ Added a checkbox to the inspector's settings to toggle a FPS counter. The checkbox appears when InspectorClient::canShowFPSCounter() returns true.
+
+ No new tests.
+
+ * English.lproj/localizedStrings.js:
+ * inspector/Inspector.json:
+ * inspector/InspectorClient.h:
+ (WebCore::InspectorClient::canShowFPSCounter):
+ (WebCore::InspectorClient::setShowFPSCounter):
+ (InspectorClient):
+ * inspector/InspectorPageAgent.cpp:
+ (PageAgentState):
+ (WebCore::InspectorPageAgent::enable):
+ (WebCore::InspectorPageAgent::disable):
+ (WebCore::InspectorPageAgent::canShowFPSCounter):
+ (WebCore):
+ (WebCore::InspectorPageAgent::setShowFPSCounter):
+ * inspector/InspectorPageAgent.h:
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/SettingsScreen.js:
+ (WebInspector.GenericSettingsTab):
+ (WebInspector.GenericSettingsTab.prototype.get _showFPSCounterChanged):
+ * inspector/front-end/inspector.js:
+ (WebInspector.doLoadedDone):
+
2012-11-12 Kent Tamura <[email protected]>
Unable to set valid time value to input[type=time] with user interaction in some cases
Modified: trunk/Source/WebCore/English.lproj/localizedStrings.js (134390 => 134391)
--- trunk/Source/WebCore/English.lproj/localizedStrings.js 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebCore/English.lproj/localizedStrings.js 2012-11-13 10:25:21 UTC (rev 134391)
@@ -647,6 +647,7 @@
localizedStrings["IndexedDB"] = "IndexedDB";
localizedStrings["Animation"] = "Animation";
localizedStrings["Show paint rectangles"] = "Show paint rectangles";
+localizedStrings["Show FPS meter"] = "Show FPS meter";
localizedStrings["Security origin"] = "Security origin";
localizedStrings["Version"] = "Version";
localizedStrings["Primary key"] = "Primary key";
Modified: trunk/Source/WebCore/inspector/Inspector.json (134390 => 134391)
--- trunk/Source/WebCore/inspector/Inspector.json 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebCore/inspector/Inspector.json 2012-11-13 10:25:21 UTC (rev 134391)
@@ -345,6 +345,22 @@
"hidden": true
},
{
+ "name": "canShowFPSCounter",
+ "description": "Tells if backend supports a FPS counter display",
+ "returns": [
+ { "name": "show", "type": "boolean", "description": "True if the FPS count can be shown" }
+ ],
+ "hidden": true
+ },
+ {
+ "name": "setShowFPSCounter",
+ "description": "Requests that backend shows the FPS counter",
+ "parameters": [
+ { "name": "show", "type": "boolean", "description": "True for showing the FPS counter" }
+ ],
+ "hidden": true
+ },
+ {
"name": "getScriptExecutionStatus",
"description": "Determines if scripts can be executed in the page.",
"returns": [
Modified: trunk/Source/WebCore/inspector/InspectorClient.h (134390 => 134391)
--- trunk/Source/WebCore/inspector/InspectorClient.h 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebCore/inspector/InspectorClient.h 2012-11-13 10:25:21 UTC (rev 134391)
@@ -72,6 +72,9 @@
// FIXME: Platforms may want to implement this (see https://bugs.webkit.org/show_bug.cgi?id=82886).
}
+ virtual bool canShowFPSCounter() { return false; }
+ virtual void setShowFPSCounter(bool) { }
+
virtual bool supportsFrameInstrumentation() { return false; }
virtual void getAllocatedObjects(HashSet<const void*>&) { }
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (134390 => 134391)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2012-11-13 10:25:21 UTC (rev 134391)
@@ -92,6 +92,7 @@
static const char pageAgentScreenHeightOverride[] = "pageAgentScreenHeightOverride";
static const char pageAgentFontScaleFactorOverride[] = "pageAgentFontScaleFactorOverride";
static const char pageAgentFitWindow[] = "pageAgentFitWindow";
+static const char pageAgentShowFPSCounter[] = "pageAgentShowFPSCounter";
static const char showPaintRects[] = "showPaintRects";
#if ENABLE(TOUCH_EVENTS)
static const char touchEventEmulationEnabled[] = "touchEventEmulationEnabled";
@@ -366,6 +367,8 @@
m_state->setBoolean(PageAgentState::pageAgentEnabled, true);
bool scriptExecutionDisabled = m_state->getBoolean(PageAgentState::pageAgentScriptExecutionDisabled);
setScriptExecutionDisabled(0, scriptExecutionDisabled);
+ bool showFPSCounter = m_state->getBoolean(PageAgentState::pageAgentShowFPSCounter);
+ setShowFPSCounter(0, showFPSCounter);
m_instrumentingAgents->setInspectorPageAgent(this);
}
@@ -375,6 +378,7 @@
m_instrumentingAgents->setInspectorPageAgent(0);
setScriptExecutionDisabled(0, false);
+ setShowFPSCounter(0, false);
// When disabling the agent, reset the override values.
m_state->setLong(PageAgentState::pageAgentScreenWidthOverride, 0);
@@ -711,6 +715,18 @@
m_page->mainFrame()->view()->invalidate();
}
+void InspectorPageAgent::canShowFPSCounter(ErrorString*, bool* outParam)
+{
+ *outParam = m_client->canShowFPSCounter();
+}
+
+void InspectorPageAgent::setShowFPSCounter(ErrorString*, bool show)
+{
+ m_state->setBoolean(PageAgentState::pageAgentShowFPSCounter, show);
+ m_client->setShowFPSCounter(show);
+ m_page->mainFrame()->view()->invalidate();
+}
+
void InspectorPageAgent::getScriptExecutionStatus(ErrorString*, PageCommandHandler::Result::Enum* status)
{
bool disabledByScriptController = false;
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (134390 => 134391)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.h 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h 2012-11-13 10:25:21 UTC (rev 134391)
@@ -109,6 +109,8 @@
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 canShowFPSCounter(ErrorString*, bool*);
+ virtual void setShowFPSCounter(ErrorString*, bool show);
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 (134390 => 134391)
--- trunk/Source/WebCore/inspector/front-end/Settings.js 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebCore/inspector/front-end/Settings.js 2012-11-13 10:25:21 UTC (rev 134391)
@@ -58,6 +58,7 @@
timelineCanMonitorMainThread: false,
canOverrideGeolocation: false,
canOverrideDeviceOrientation: false,
+ canShowFPSCounter: false
}
/**
@@ -96,6 +97,7 @@
this.showScriptFolders = this.createSetting("showScriptFolders", true);
this.emulateTouchEvents = this.createSetting("emulateTouchEvents", false);
this.showPaintRects = this.createSetting("showPaintRects", false);
+ this.showFPSCounter = this.createSetting("showFPSCounter", false);
this.showShadowDOM = this.createSetting("showShadowDOM", false);
this.zoomLevel = this.createSetting("zoomLevel", 0);
this.savedURLs = this.createSetting("savedURLs", {});
Modified: trunk/Source/WebCore/inspector/front-end/SettingsScreen.js (134390 => 134391)
--- trunk/Source/WebCore/inspector/front-end/SettingsScreen.js 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebCore/inspector/front-end/SettingsScreen.js 2012-11-13 10:25:21 UTC (rev 134391)
@@ -273,6 +273,11 @@
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show paint rectangles"), WebInspector.settings.showPaintRects));
WebInspector.settings.showPaintRects.addChangeListener(this._showPaintRectsChanged, this);
+ if (Capabilities.canShowFPSCounter) {
+ p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show FPS meter"), WebInspector.settings.showFPSCounter));
+ WebInspector.settings.showFPSCounter.addChangeListener(this._showFPSCounterChanged, this);
+ }
+
p = this._appendSection(WebInspector.UIString("Sources"));
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show folders"), WebInspector.settings.showScriptFolders));
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Search in content scripts"), WebInspector.settings.searchInContentScripts));
@@ -311,6 +316,11 @@
PageAgent.setShowPaintRects(WebInspector.settings.showPaintRects.get());
},
+ _showFPSCounterChanged: function()
+ {
+ PageAgent.setShowFPSCounter(WebInspector.settings.showFPSCounter.get());
+ },
+
_updateScriptDisabledCheckbox: function()
{
function executionStatusCallback(error, status)
Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (134390 => 134391)
--- trunk/Source/WebCore/inspector/front-end/inspector.js 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js 2012-11-13 10:25:21 UTC (rev 134391)
@@ -371,6 +371,7 @@
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.canShowFPSCounter(WebInspector._initializeCapability.bind(WebInspector, "canShowFPSCounter", 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)));
@@ -483,6 +484,9 @@
if (WebInspector.settings._javascript_Disabled.get())
PageAgent.setScriptExecutionDisabled(true);
+ if (WebInspector.settings.showFPSCounter.get())
+ PageAgent.setShowFPSCounter(true);
+
this.domAgent._emulateTouchEventsChanged();
WebInspector.WorkerManager.loadCompleted();
Modified: trunk/Source/WebKit/chromium/ChangeLog (134390 => 134391)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-11-13 10:25:21 UTC (rev 134391)
@@ -1,3 +1,29 @@
+2012-11-13 Eberhard Graether <[email protected]>
+
+ checkbox to toggle FPS counter in the inspector's settings
+ https://bugs.webkit.org/show_bug.cgi?id=99660
+
+ Reviewed by Pavel Feldman.
+
+ Added a checkbox to the inspector's settings to toggle a FPS counter. The checkbox appears when InspectorClient::canShowFPSCounter() returns true.
+
+ * public/WebView.h:
+ (WebView):
+ * src/InspectorClientImpl.cpp:
+ (WebKit::InspectorClientImpl::canShowFPSCounter):
+ (WebKit):
+ (WebKit::InspectorClientImpl::setShowFPSCounter):
+ * src/InspectorClientImpl.h:
+ (InspectorClientImpl):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::setShowFPSCounter):
+ (WebKit):
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+ (WebKit::WebViewImpl::loadFontAtlasIfNecessary):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
2012-11-12 Kent Tamura <[email protected]>
Unable to set valid time value to input[type=time] with user interaction in some cases
Modified: trunk/Source/WebKit/chromium/public/WebView.h (134390 => 134391)
--- trunk/Source/WebKit/chromium/public/WebView.h 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebKit/chromium/public/WebView.h 2012-11-13 10:25:21 UTC (rev 134391)
@@ -471,6 +471,8 @@
virtual bool isSelectionEditable() const = 0;
+ virtual void setShowFPSCounter(bool) = 0;
+
// Benchmarking support -------------------------------------------------
virtual WebViewBenchmarkSupport* benchmarkSupport() { return 0; }
Modified: trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp (134390 => 134391)
--- trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp 2012-11-13 10:25:21 UTC (rev 134391)
@@ -163,6 +163,16 @@
agent->autoZoomPageToFitWidth();
}
+bool InspectorClientImpl::canShowFPSCounter()
+{
+ return true;
+}
+
+void InspectorClientImpl::setShowFPSCounter(bool show)
+{
+ m_inspectedWebView->setShowFPSCounter(show);
+}
+
bool InspectorClientImpl::supportsFrameInstrumentation()
{
return true;
Modified: trunk/Source/WebKit/chromium/src/InspectorClientImpl.h (134390 => 134391)
--- trunk/Source/WebKit/chromium/src/InspectorClientImpl.h 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebKit/chromium/src/InspectorClientImpl.h 2012-11-13 10:25:21 UTC (rev 134391)
@@ -77,6 +77,9 @@
virtual void overrideDeviceMetrics(int, int, float, bool);
virtual void autoZoomPageToFitWidth();
+ virtual bool canShowFPSCounter();
+ virtual void setShowFPSCounter(bool);
+
virtual bool supportsFrameInstrumentation();
virtual void getAllocatedObjects(HashSet<const void*>&);
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (134390 => 134391)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-11-13 10:25:21 UTC (rev 134391)
@@ -425,6 +425,7 @@
, m_compositorSurfaceReady(false)
, m_deviceScaleInCompositor(1)
, m_inputHandlerIdentifier(-1)
+ , m_isFontAtlasLoaded(false)
#endif
#if ENABLE(INPUT_SPEECH)
, m_speechInputClient(SpeechInputClientImpl::create(client))
@@ -831,6 +832,17 @@
return &m_benchmarkSupport;
}
+void WebViewImpl::setShowFPSCounter(bool show)
+{
+ if (isAcceleratedCompositingActive()) {
+ TRACE_EVENT0("webkit", "WebViewImpl::setShowFPSCounter");
+#if USE(ACCELERATED_COMPOSITING)
+ loadFontAtlasIfNecessary();
+#endif
+ m_layerTreeView->setShowFPSCounter(show);
+ }
+}
+
bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
{
ASSERT((event.type == WebInputEvent::RawKeyDown)
@@ -3995,17 +4007,15 @@
m_client->didActivateCompositor(m_inputHandlerIdentifier);
m_isAcceleratedCompositingActive = true;
m_compositorCreationFailed = false;
+ m_isFontAtlasLoaded = false;
if (m_pageOverlays)
m_pageOverlays->update();
- // Only allocate the font atlas if we have reason to use the heads-up display.
- if (layerTreeViewSettings.showFPSCounter || layerTreeViewSettings.showPlatformLayerTree) {
- TRACE_EVENT0("cc", "WebViewImpl::setIsAcceleratedCompositingActive(true) initialize font atlas");
- WebRect asciiToRectTable[128];
- int fontHeight;
- SkBitmap bitmap = WebCore::CompositorHUDFontAtlas::generateFontAtlas(asciiToRectTable, fontHeight);
- m_layerTreeView->setFontAtlas(asciiToRectTable, bitmap, fontHeight);
- }
+ if (layerTreeViewSettings.showPlatformLayerTree)
+ loadFontAtlasIfNecessary();
+
+ if (settingsImpl()->showFPSCounter())
+ setShowFPSCounter(true);
} else {
m_nonCompositedContentHost.clear();
m_isAcceleratedCompositingActive = false;
@@ -4017,6 +4027,21 @@
page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositingActive);
}
+void WebViewImpl::loadFontAtlasIfNecessary()
+{
+ ASSERT(m_layerTreeView);
+
+ if (m_isFontAtlasLoaded)
+ return;
+
+ TRACE_EVENT0("webkit", "WebViewImpl::loadFontAtlas");
+ WebRect asciiToRectTable[128];
+ int fontHeight;
+ SkBitmap bitmap = WebCore::CompositorHUDFontAtlas::generateFontAtlas(asciiToRectTable, fontHeight);
+ m_layerTreeView->setFontAtlas(asciiToRectTable, bitmap, fontHeight);
+ m_isFontAtlasLoaded = true;
+}
+
#endif
namespace {
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (134390 => 134391)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.h 2012-11-13 10:18:33 UTC (rev 134390)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h 2012-11-13 10:25:21 UTC (rev 134391)
@@ -309,6 +309,7 @@
#endif
virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&);
virtual WebViewBenchmarkSupport* benchmarkSupport();
+ virtual void setShowFPSCounter(bool);
// WebLayerTreeViewClient
virtual void willBeginFrame();
@@ -650,6 +651,7 @@
#if USE(ACCELERATED_COMPOSITING)
void setIsAcceleratedCompositingActive(bool);
+ void loadFontAtlasIfNecessary();
void doComposite();
void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&);
void reallocateRenderer();
@@ -846,6 +848,7 @@
bool m_compositorSurfaceReady;
float m_deviceScaleInCompositor;
int m_inputHandlerIdentifier;
+ bool m_isFontAtlasLoaded;
#endif
static const WebInputEvent* m_currentInputEvent;