[WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jul 2014 19:04:34 +0000 (19:04 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jul 2014 19:04:34 +0000 (19:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134586

Reviewed by Benjamin Poulain.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
(WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
(WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::preferencesDidChange):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
Check the debug indicator pref at construction time, and update the state when it changes.
Checking it every commit was surprisingly expensive.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/DrawingAreaProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm

index 502287a8ea35db2a2e78bae62e35584dc478702f..8fad1f4792add3a2b8df5d92c1405be1a78fc52b 100644 (file)
@@ -1,3 +1,25 @@
+2014-07-03  Tim Horton  <timothy_horton@apple.com>
+
+        [WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason
+        https://bugs.webkit.org/show_bug.cgi?id=134586
+
+        Reviewed by Benjamin Poulain.
+
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
+        (WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
+        (WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::preferencesDidChange):
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
+        Check the debug indicator pref at construction time, and update the state when it changes.
+        Checking it every commit was surprisingly expensive.
+
 2014-07-03  Antti Koivisto  <antti@apple.com>
 
         Ensure frame creation messages get through to UI process
index 8685d672ff9c4d7022a7c01ea42ebed828baec23..078df2fd224f85d5060a54e4ccae28bcc06d066e 100644 (file)
@@ -82,8 +82,7 @@ public:
 #endif
 
     virtual void updateDebugIndicator() { }
-    virtual void showDebugIndicator(bool) { }
-    virtual bool isShowingDebugIndicator() const { return false; }
+    virtual void setShouldShowDebugIndicator(bool) { }
 
     virtual uint64_t lastVisibleTransactionID() const { ASSERT_NOT_REACHED(); return 0; }
 
index da0bc8e05bce1a0c8b9272c4995ddb33797ffb36..78bd0a61bd4e9154107fc70c76329ae081825923 100644 (file)
@@ -2373,6 +2373,9 @@ void WebPageProxy::preferencesDidChange()
         inspector()->enableRemoteInspection();
 #endif
 
+    if (m_drawingArea)
+        m_drawingArea->setShouldShowDebugIndicator(m_preferences->tiledScrollingIndicatorVisible());
+
     m_process->pagePreferencesChanged(this);
 
     m_pageClient.preferencesDidChange();
index f280ec0407d019450bc77c7f55880bd55b5f1dab..8a06d6ef29fe740e886d0a2e914447f88fc415d7 100644 (file)
@@ -58,7 +58,7 @@ private:
     virtual void didUpdateGeometry() override;
 
     WebCore::FloatRect scaledExposedRect() const;
-    void showDebugIndicator(bool);
+    virtual void setShouldShowDebugIndicator(bool) override;
 
 #if PLATFORM(MAC)
     virtual void setExposedRect(const WebCore::FloatRect&) override;
index 0249fbac1f32e131517a8a8ea542341060428aba..8cf3525742773d9106711c09c634c90648ff8d44 100644 (file)
@@ -60,6 +60,8 @@ RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy(WebPageProxy* w
 
     m_webPageProxy->process().addMessageReceiver(Messages::RemoteLayerTreeDrawingAreaProxy::messageReceiverName(), m_webPageProxy->pageID(), *this);
 
+    setShouldShowDebugIndicator(m_webPageProxy->preferences().tiledScrollingIndicatorVisible());
+
     m_layerCommitObserver = RunLoopObserver::create(didCommitLayersRunLoopOrder, [this]() {
         this->coreAnimationDidCommitLayers();
     });
@@ -151,8 +153,6 @@ void RemoteLayerTreeDrawingAreaProxy::commitLayerTree(const RemoteLayerTreeTrans
 #endif
 #endif // ENABLE(ASYNC_SCROLLING)
 
-    showDebugIndicator(m_webPageProxy->preferences().tiledScrollingIndicatorVisible());
-
     if (m_debugIndicatorLayerTreeHost) {
         float scale = indicatorScale(layerTreeTransaction.contentsSize());
         bool rootLayerChanged = m_debugIndicatorLayerTreeHost->updateLayerTree(layerTreeTransaction, scale);
@@ -260,7 +260,7 @@ void RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator(IntSize contentsSize,
     }
 }
 
-void RemoteLayerTreeDrawingAreaProxy::showDebugIndicator(bool show)
+void RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator(bool show)
 {
     if (show == !!m_debugIndicatorLayerTreeHost)
         return;