[WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jul 2014 06:04:51 +0000 (06:04 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jul 2014 06:04:51 +0000 (06:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134644

Reviewed by Darin Adler.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::preferencesDidChange):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
The indicator depends on the live layer tree commits coming in, including layer creation,
so it can't be turned on after the root layer is created. Even a refresh is insufficient
to get it working; the debug indicator really needs to exist from the first commit.
So, don't even attempt to dynamically enable the indicator; create it at
RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170838 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 cfa88626718764b81d4b7edc30cd3546db6db02a..9f6756be358842039539ae129d0364eccce35a0c 100644 (file)
@@ -1,3 +1,25 @@
+2014-07-06  Tim Horton  <timothy_horton@apple.com>
+
+        [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
+        https://bugs.webkit.org/show_bug.cgi?id=134644
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::preferencesDidChange):
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
+        The indicator depends on the live layer tree commits coming in, including layer creation,
+        so it can't be turned on after the root layer is created. Even a refresh is insufficient
+        to get it working; the debug indicator really needs to exist from the first commit.
+        So, don't even attempt to dynamically enable the indicator; create it at
+        RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
+
 2014-07-06  Yoav Weiss  <yoav@yoav.ws>
 
         Turn on img@sizes compile flag
index 453710885885d926b2459d908e37704cc1d68549..0b8125fa052a9f18d835044a3ab4f087285e931d 100644 (file)
@@ -83,7 +83,6 @@ public:
 #endif
 
     virtual void updateDebugIndicator() { }
-    virtual void setShouldShowDebugIndicator(bool) { }
 
     virtual void waitForDidUpdateViewState() { }
     
index 0c0ab2e6034a87d51793d54200b40ff1b61c46a1..e2e433a08bd2100392a281081caf8e9b1e00ee5a 100644 (file)
@@ -2384,9 +2384,6 @@ void WebPageProxy::preferencesDidChange()
         inspector()->enableRemoteInspection();
 #endif
 
-    if (m_drawingArea)
-        m_drawingArea->setShouldShowDebugIndicator(m_preferences->tiledScrollingIndicatorVisible());
-
     m_process->pagePreferencesChanged(this);
 
     m_pageClient.preferencesDidChange();
index 71dab1e1af51bc36633f6f8f591f91a1abb4ebe6..948753836b9aa4ff2b8419ac80668de6be14e2b8 100644 (file)
@@ -62,7 +62,6 @@ private:
     virtual void dispatchAfterEnsuringDrawing(std::function<void (CallbackBase::Error)>) override;
 
     WebCore::FloatRect scaledExposedRect() const;
-    virtual void setShouldShowDebugIndicator(bool) override;
 
 #if PLATFORM(MAC)
     virtual void setExposedRect(const WebCore::FloatRect&) override;
@@ -72,6 +71,7 @@ private:
     virtual void updateDebugIndicator() override;
     void updateDebugIndicator(WebCore::IntSize contentsSize, bool rootLayerChanged, float scale);
     void updateDebugIndicatorPosition();
+    void initializeDebugIndicator();
 
     virtual void waitForDidUpdateViewState() override;
     
index 89af408fd73c3d3466c348f8d76389437ccbd5df..a1f179ca4f483da1bdcba240154317e71837180d 100644 (file)
@@ -60,7 +60,8 @@ RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy(WebPageProxy* w
 
     m_webPageProxy->process().addMessageReceiver(Messages::RemoteLayerTreeDrawingAreaProxy::messageReceiverName(), m_webPageProxy->pageID(), *this);
 
-    setShouldShowDebugIndicator(m_webPageProxy->preferences().tiledScrollingIndicatorVisible());
+    if (m_webPageProxy->preferences().tiledScrollingIndicatorVisible())
+        initializeDebugIndicator();
 
     m_layerCommitObserver = RunLoopObserver::create(didCommitLayersRunLoopOrder, [this]() {
         this->coreAnimationDidCommitLayers();
@@ -266,19 +267,8 @@ void RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator(IntSize contentsSize,
     }
 }
 
-void RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator(bool show)
+void RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator()
 {
-    if (show == !!m_debugIndicatorLayerTreeHost)
-        return;
-    
-    if (!show) {
-        [m_tileMapHostLayer removeFromSuperlayer];
-        m_tileMapHostLayer = nullptr;
-        m_exposedRectIndicatorLayer = nullptr;
-        m_debugIndicatorLayerTreeHost = nullptr;
-        return;
-    }
-    
     m_debugIndicatorLayerTreeHost = std::make_unique<RemoteLayerTreeHost>(*this);
     m_debugIndicatorLayerTreeHost->setIsDebugLayerTreeHost(true);