Title: [106121] trunk/Source/WebCore
Revision
106121
Author
[email protected]
Date
2012-01-27 07:35:40 -0800 (Fri, 27 Jan 2012)

Log Message

[Qt][WK2] Child layers appear in wrong position when scrolling
https://bugs.webkit.org/show_bug.cgi?id=77063

Reviewed by Simon Fraser.

When using the delegatesScrolling mode in FrameView, the compositor doesn't need
to control the special clip/scroll layers. Also, when we change that mode, we need to let
the compositor reset its backing-stores and rebuild them without scrolling/clipping.

This is tested by compositing tests, when run with Qt in touch mode.

* page/FrameView.cpp:
(WebCore::FrameView::delegatesScrollingDidChange):
(WebCore):
* page/FrameView.h:
(FrameView):
* platform/ScrollView.cpp:
(WebCore::ScrollView::setDelegatesScrolling):
* platform/ScrollView.h:
(WebCore::ScrollView::delegatesScrollingDidChange):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresScrollLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106120 => 106121)


--- trunk/Source/WebCore/ChangeLog	2012-01-27 15:15:50 UTC (rev 106120)
+++ trunk/Source/WebCore/ChangeLog	2012-01-27 15:35:40 UTC (rev 106121)
@@ -1,3 +1,28 @@
+2012-01-27  No'am Rosenthal  <[email protected]>
+
+        [Qt][WK2] Child layers appear in wrong position when scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=77063
+
+        Reviewed by Simon Fraser.
+
+        When using the delegatesScrolling mode in FrameView, the compositor doesn't need
+        to control the special clip/scroll layers. Also, when we change that mode, we need to let
+        the compositor reset its backing-stores and rebuild them without scrolling/clipping.
+
+        This is tested by compositing tests, when run with Qt in touch mode.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::delegatesScrollingDidChange):
+        (WebCore):
+        * page/FrameView.h:
+        (FrameView):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setDelegatesScrolling):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::delegatesScrollingDidChange):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresScrollLayer):
+
 2012-01-27  Thiago Marcos P. Santos  <[email protected]>
 
         Removed unused method from CSSStyleSelector

Modified: trunk/Source/WebCore/page/FrameView.cpp (106120 => 106121)


--- trunk/Source/WebCore/page/FrameView.cpp	2012-01-27 15:15:50 UTC (rev 106120)
+++ trunk/Source/WebCore/page/FrameView.cpp	2012-01-27 15:35:40 UTC (rev 106121)
@@ -1702,6 +1702,14 @@
     ScrollView::setScrollPosition(scrollPoint);
 }
 
+void FrameView::delegatesScrollingDidChange()
+{
+#if USE(ACCELERATED_COMPOSITING)
+    // When we switch to delgatesScrolling mode, we should destroy the scrolling/clipping layers in RenderLayerCompositor.
+    clearBackingStores();
+#endif
+}
+
 void FrameView::setFixedVisibleContentRect(const IntRect& visibleContentRect)
 {
     IntSize offset = scrollOffset();

Modified: trunk/Source/WebCore/page/FrameView.h (106120 => 106121)


--- trunk/Source/WebCore/page/FrameView.h	2012-01-27 15:15:50 UTC (rev 106120)
+++ trunk/Source/WebCore/page/FrameView.h	2012-01-27 15:35:40 UTC (rev 106121)
@@ -346,6 +346,8 @@
     virtual void contentsResized() OVERRIDE;
     virtual void visibleContentsResized();
 
+    virtual void delegatesScrollingDidChange();
+
     // Override ScrollView methods to do point conversion via renderers, in order to
     // take transforms into account.
     virtual IntRect convertToContainingView(const IntRect&) const;

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (106120 => 106121)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2012-01-27 15:15:50 UTC (rev 106120)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2012-01-27 15:35:40 UTC (rev 106121)
@@ -219,7 +219,11 @@
 
 void ScrollView::setDelegatesScrolling(bool delegatesScrolling)
 {
+    if (m_delegatesScrolling == delegatesScrolling)
+        return;
+
     m_delegatesScrolling = delegatesScrolling;
+    delegatesScrollingDidChange();
 }
 
 #if !PLATFORM(GTK)

Modified: trunk/Source/WebCore/platform/ScrollView.h (106120 => 106121)


--- trunk/Source/WebCore/platform/ScrollView.h	2012-01-27 15:15:50 UTC (rev 106120)
+++ trunk/Source/WebCore/platform/ScrollView.h	2012-01-27 15:35:40 UTC (rev 106121)
@@ -301,6 +301,7 @@
     virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
 
     virtual void visibleContentsResized() = 0;
+    virtual void delegatesScrollingDidChange() { }
 
     IntRect fixedVisibleContentRect() const { return m_fixedVisibleContentRect; }
 

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (106120 => 106121)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-01-27 15:15:50 UTC (rev 106120)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-01-27 15:35:40 UTC (rev 106121)
@@ -1583,6 +1583,10 @@
 
 bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const
 {
+    // This applies when the application UI handles scrolling, in which case RenderLayerCompositor doesn't need to manage it.
+    if (m_renderView->frameView()->delegatesScrolling())
+        return false;
+
     // We need to handle our own scrolling if we're:
     return !m_renderView->frameView()->platformWidget() // viewless (i.e. non-Mac, or Mac in WebKit2)
         || attachment == RootLayerAttachedViaEnclosingFrame; // a composited frame on Mac
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to