Show layer borders for scrollbar layers
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 18:54:43 +0000 (18:54 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 18:54:43 +0000 (18:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76888

Source/WebCore:

Reviewed by Beth Dakin.

When compositing layer borders are showing, show the borders
for scrollbars layers. This reduces confusion about whether scrollbars
are rendering into their own layers.

Requires a new parameter to two GraphicsLayerClient methods.

* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::showDebugBorders):
(WebCore::GraphicsLayer::showRepaintCounter):
* platform/graphics/GraphicsLayerClient.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::showDebugBorders):
(WebCore::RenderLayerBacking::showRepaintCounter):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::showDebugBorders):
(WebCore::RenderLayerCompositor::showRepaintCounter):
* rendering/RenderLayerCompositor.h:

Source/WebKit/chromium:

Reviewed by Beth Dakin.

Update for new signature of GraphicsLayerClient::showDebugBorders()
and GraphicsLayerClient::showRepaintCounter().

* src/NonCompositedContentHost.cpp:
(WebKit::NonCompositedContentHost::showDebugBorders):
(WebKit::NonCompositedContentHost::showRepaintCounter):
* src/NonCompositedContentHost.h:
* src/PageOverlay.cpp:
(WebKit::OverlayGraphicsLayerClientImpl::showDebugBorders):
(WebKit::OverlayGraphicsLayerClientImpl::showRepaintCounter):
* tests/ImageLayerChromiumTest.cpp:
(WebCore::MockGraphicsLayerClient::showDebugBorders):
(WebCore::MockGraphicsLayerClient::showRepaintCounter):

Source/WebKit/win:

Reviewed by Beth Dakin.

Update for new signature of GraphicsLayerClient::showDebugBorders()
and GraphicsLayerClient::showRepaintCounter().

* WebView.cpp:
(WebView::showDebugBorders):
(WebView::showRepaintCounter):
* WebView.h:

Source/WebKit2:

Reviewed by Beth Dakin.

Update for new signatures of GraphicsLayerClient::showDebugBorders()
and GraphicsLayerClient::showRepaintCounter().

* UIProcess/LayerTreeHostProxy.h:
(WebKit::LayerTreeHostProxy::showDebugBorders):
(WebKit::LayerTreeHostProxy::showRepaintCounter):
* WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
(WebKit::LayerTreeHostCA::showDebugBorders):
(WebKit::LayerTreeHostCA::showRepaintCounter):
* WebProcess/WebPage/ca/LayerTreeHostCA.h:
* WebProcess/WebPage/qt/LayerTreeHostQt.h:

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

20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/GraphicsLayerClient.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/NonCompositedContentHost.cpp
Source/WebKit/chromium/src/NonCompositedContentHost.h
Source/WebKit/chromium/src/PageOverlay.cpp
Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/LayerTreeHostProxy.h
Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp
Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h
Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h

index 966c7d8..90131bb 100644 (file)
@@ -1,3 +1,29 @@
+2012-01-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Show layer borders for scrollbar layers
+        https://bugs.webkit.org/show_bug.cgi?id=76888
+
+        Reviewed by Beth Dakin.
+        
+        When compositing layer borders are showing, show the borders
+        for scrollbars layers. This reduces confusion about whether scrollbars
+        are rendering into their own layers.
+        
+        Requires a new parameter to two GraphicsLayerClient methods.
+
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::showDebugBorders):
+        (WebCore::GraphicsLayer::showRepaintCounter):
+        * platform/graphics/GraphicsLayerClient.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::showDebugBorders):
+        (WebCore::RenderLayerBacking::showRepaintCounter):
+        * rendering/RenderLayerBacking.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::showDebugBorders):
+        (WebCore::RenderLayerCompositor::showRepaintCounter):
+        * rendering/RenderLayerCompositor.h:
+
 2012-01-24  David Levin  <levin@chromium.org>
 
         [windows] Convert usage of GetDC to HWndDC Part 3.
index a6936c2..dc6e8b8 100644 (file)
@@ -370,8 +370,8 @@ public:
     virtual void setContentsOrientation(CompositingCoordinatesOrientation orientation) { m_contentsOrientation = orientation; }
     CompositingCoordinatesOrientation contentsOrientation() const { return m_contentsOrientation; }
 
-    bool showDebugBorders() const { return m_client ? m_client->showDebugBorders() : false; }
-    bool showRepaintCounter() const { return m_client ? m_client->showRepaintCounter() : false; }
+    bool showDebugBorders() const { return m_client ? m_client->showDebugBorders(this) : false; }
+    bool showRepaintCounter() const { return m_client ? m_client->showRepaintCounter(this) : false; }
     
     void updateDebugIndicators();
     
index d933826..81272dd 100644 (file)
@@ -71,8 +71,8 @@ public:
     // Page scale factor.
     virtual float pageScaleFactor() const { return 1; }
 
-    virtual bool showDebugBorders() const = 0;
-    virtual bool showRepaintCounter() const = 0;
+    virtual bool showDebugBorders(const GraphicsLayer*) const = 0;
+    virtual bool showRepaintCounter(const GraphicsLayer*) const = 0;
 };
 
 } // namespace WebCore
index 4189b6b..628185c 100644 (file)
@@ -1179,12 +1179,12 @@ void RenderLayerBacking::didCommitChangesForLayer(const GraphicsLayer*) const
     compositor()->didFlushChangesForLayer(m_owningLayer);
 }
 
-bool RenderLayerBacking::showDebugBorders() const
+bool RenderLayerBacking::showDebugBorders(const GraphicsLayer*) const
 {
     return compositor() ? compositor()->compositorShowDebugBorders() : false;
 }
 
-bool RenderLayerBacking::showRepaintCounter() const
+bool RenderLayerBacking::showRepaintCounter(const GraphicsLayer*) const
 {
     return compositor() ? compositor()->compositorShowRepaintCounter() : false;
 }
index 4c6d367..b2d481c 100644 (file)
@@ -133,8 +133,8 @@ public:
     virtual float pageScaleFactor() const;
     virtual void didCommitChangesForLayer(const GraphicsLayer*) const;
 
-    virtual bool showDebugBorders() const;
-    virtual bool showRepaintCounter() const;
+    virtual bool showDebugBorders(const GraphicsLayer*) const;
+    virtual bool showRepaintCounter(const GraphicsLayer*) const;
 
     LayoutRect contentsBox() const;
     
index d7e405c..70ca33e 100644 (file)
@@ -1623,6 +1623,22 @@ void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, Gr
     }
 }
 
+bool RenderLayerCompositor::showDebugBorders(const GraphicsLayer* layer) const
+{
+    if (layer == m_layerForHorizontalScrollbar || layer == m_layerForVerticalScrollbar || layer == m_layerForScrollCorner)
+        return m_showDebugBorders;
+
+    return false;
+}
+
+bool RenderLayerCompositor::showRepaintCounter(const GraphicsLayer* layer) const
+{
+    if (layer == m_layerForHorizontalScrollbar || layer == m_layerForVerticalScrollbar || layer == m_layerForScrollCorner)
+        return m_showDebugBorders;
+
+    return false;
+}
+
 float RenderLayerCompositor::deviceScaleFactor() const
 {
     Frame* frame = m_renderView->frameView()->frame();
index 29c83d0..198a18c 100644 (file)
@@ -217,10 +217,8 @@ private:
     virtual void notifySyncRequired(const GraphicsLayer*) { scheduleLayerFlush(); }
     virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const LayoutRect&);
 
-    // These calls return false always. They are saying that the layers associated with this client
-    // (the clipLayer and scrollLayer) should never show debugging info.
-    virtual bool showDebugBorders() const { return false; }
-    virtual bool showRepaintCounter() const { return false; }
+    virtual bool showDebugBorders(const GraphicsLayer*) const;
+    virtual bool showRepaintCounter(const GraphicsLayer*) const;
     
     // Whether the given RL needs a compositing layer.
     bool needsToBeComposited(const RenderLayer*) const;
index aa2e43a..67aa5d5 100644 (file)
@@ -1,3 +1,24 @@
+2012-01-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Show layer borders for scrollbar layers
+        https://bugs.webkit.org/show_bug.cgi?id=76888
+
+        Reviewed by Beth Dakin.
+
+        Update for new signature of GraphicsLayerClient::showDebugBorders()
+        and GraphicsLayerClient::showRepaintCounter().
+
+        * src/NonCompositedContentHost.cpp:
+        (WebKit::NonCompositedContentHost::showDebugBorders):
+        (WebKit::NonCompositedContentHost::showRepaintCounter):
+        * src/NonCompositedContentHost.h:
+        * src/PageOverlay.cpp:
+        (WebKit::OverlayGraphicsLayerClientImpl::showDebugBorders):
+        (WebKit::OverlayGraphicsLayerClientImpl::showRepaintCounter):
+        * tests/ImageLayerChromiumTest.cpp:
+        (WebCore::MockGraphicsLayerClient::showDebugBorders):
+        (WebCore::MockGraphicsLayerClient::showRepaintCounter):
+
 2012-01-24  Vincent Scheib  <scheib@chromium.org>
 
         [Chromium] Add WebKit API for Pointer Lock
index d3e0280..7bcb98a 100644 (file)
@@ -151,12 +151,12 @@ void NonCompositedContentHost::setShowDebugBorders(bool showDebugBorders)
     m_graphicsLayer->updateDebugIndicators();
 }
 
-bool NonCompositedContentHost::showDebugBorders() const
+bool NonCompositedContentHost::showDebugBorders(const WebCore::GraphicsLayer*) const
 {
     return m_showDebugBorders;
 }
 
-bool NonCompositedContentHost::showRepaintCounter() const
+bool NonCompositedContentHost::showRepaintCounter(const WebCore::GraphicsLayer*) const
 {
     return false;
 }
index 2ae85b7..be9f509 100644 (file)
@@ -71,8 +71,8 @@ private:
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
     virtual void notifySyncRequired(const WebCore::GraphicsLayer*);
     virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect);
-    virtual bool showDebugBorders() const;
-    virtual bool showRepaintCounter() const;
+    virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const;
+    virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const;
 
     WebCore::LayerChromium* scrollLayer();
 
index 6bbb695..5f16d29 100644 (file)
@@ -98,12 +98,12 @@ public:
         return m_webViewImpl->pageScaleFactor();
     }
 
-    virtual bool showDebugBorders() const
+    virtual bool showDebugBorders(const GraphicsLayer*) const
     {
         return m_webViewImpl->page()->settings()->showDebugBorders();
     }
 
-    virtual bool showRepaintCounter() const
+    virtual bool showRepaintCounter(const GraphicsLayer*) const
     {
         return m_webViewImpl->page()->settings()->showRepaintCounter();
     }
index b28f8e8..bf88959 100644 (file)
@@ -41,8 +41,8 @@ class MockGraphicsLayerClient : public GraphicsLayerClient {
     virtual void notifyAnimationStarted(const GraphicsLayer*, double time) { }
     virtual void notifySyncRequired(const GraphicsLayer*) { }
     virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) { }
-    virtual bool showDebugBorders() const { return false; }
-    virtual bool showRepaintCounter() const { return false; }
+    virtual bool showDebugBorders(const GraphicsLayer*) const { return false; }
+    virtual bool showRepaintCounter(const GraphicsLayer*) const { return false; }
 };
 
 class TestImage : public Image {
index ea2214d..cc55727 100644 (file)
@@ -1,3 +1,18 @@
+2012-01-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Show layer borders for scrollbar layers
+        https://bugs.webkit.org/show_bug.cgi?id=76888
+
+        Reviewed by Beth Dakin.
+
+        Update for new signature of GraphicsLayerClient::showDebugBorders()
+        and GraphicsLayerClient::showRepaintCounter().
+
+        * WebView.cpp:
+        (WebView::showDebugBorders):
+        (WebView::showRepaintCounter):
+        * WebView.h:
+
 2012-01-23  David Levin  <levin@chromium.org>
 
         [windows] Convert usages of GetDC to HWndDC Part 2.
index 615fa11..926dc82 100644 (file)
@@ -6628,12 +6628,12 @@ void WebView::paintContents(const GraphicsLayer*, GraphicsContext& context, Grap
     context.restore();
 }
 
-bool WebView::showDebugBorders() const
+bool WebView::showDebugBorders(const GraphicsLayer*) const
 {
     return m_page->settings()->showDebugBorders();
 }
 
-bool WebView::showRepaintCounter() const
+bool WebView::showRepaintCounter(const GraphicsLayer*) const
 {
     return m_page->settings()->showRepaintCounter();
 }
index 1bdec21..38230cb 100644 (file)
@@ -994,8 +994,8 @@ private:
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
     virtual void notifySyncRequired(const WebCore::GraphicsLayer*);
     virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& inClip);
-    virtual bool showDebugBorders() const;
-    virtual bool showRepaintCounter() const;
+    virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const;
+    virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const;
 
     // CACFLayerTreeHostClient
     virtual void flushPendingGraphicsLayerChanges();
index aa8f07c..efb1dc0 100644 (file)
@@ -1,3 +1,22 @@
+2012-01-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Show layer borders for scrollbar layers
+        https://bugs.webkit.org/show_bug.cgi?id=76888
+
+        Reviewed by Beth Dakin.
+        
+        Update for new signatures of GraphicsLayerClient::showDebugBorders()
+        and GraphicsLayerClient::showRepaintCounter().
+
+        * UIProcess/LayerTreeHostProxy.h:
+        (WebKit::LayerTreeHostProxy::showDebugBorders):
+        (WebKit::LayerTreeHostProxy::showRepaintCounter):
+        * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
+        (WebKit::LayerTreeHostCA::showDebugBorders):
+        (WebKit::LayerTreeHostCA::showRepaintCounter):
+        * WebProcess/WebPage/ca/LayerTreeHostCA.h:
+        * WebProcess/WebPage/qt/LayerTreeHostQt.h:
+
 2012-01-24  David Levin  <levin@chromium.org>
 
         [windows] Convert usage of GetDC to HWndDC Part 3.
index 004c280..163ba71 100644 (file)
@@ -78,8 +78,8 @@ protected:
     // Reimplementations from WebCore::GraphicsLayerClient.
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double) { }
     virtual void notifySyncRequired(const WebCore::GraphicsLayer*) { }
-    virtual bool showDebugBorders() const { return false; }
-    virtual bool showRepaintCounter() const { return false; }
+    virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const { return false; }
+    virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const { return false; }
     void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect&) { }
 
     WebCore::RunLoop::Timer<LayerTreeHostProxy> m_animationTimer;
index 8b135fd..87e9ced 100644 (file)
@@ -203,12 +203,12 @@ void LayerTreeHostCA::paintContents(const GraphicsLayer* graphicsLayer, Graphics
     }
 }
 
-bool LayerTreeHostCA::showDebugBorders() const
+bool LayerTreeHostCA::showDebugBorders(const GraphicsLayer*) const
 {
     return m_webPage->corePage()->settings()->showDebugBorders();
 }
 
-bool LayerTreeHostCA::showRepaintCounter() const
+bool LayerTreeHostCA::showRepaintCounter(const GraphicsLayer*) const
 {
     return m_webPage->corePage()->settings()->showRepaintCounter();
 }
index 0566e97..0c3c7a1 100644 (file)
@@ -73,8 +73,8 @@ private:
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
     virtual void notifySyncRequired(const WebCore::GraphicsLayer*);
     virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect);
-    virtual bool showDebugBorders() const;
-    virtual bool showRepaintCounter() const;
+    virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const;
+    virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const;
     virtual float deviceScaleFactor() const;
     virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { }
 
index ac63c42..07f04e8 100644 (file)
@@ -86,8 +86,8 @@ private:
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
     virtual void notifySyncRequired(const WebCore::GraphicsLayer*);
     virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect);
-    virtual bool showDebugBorders() const;
-    virtual bool showRepaintCounter() const;
+    virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const;
+    virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const;
 
     // LayerTreeHostQt
     void createPageOverlayLayer();