Title: [106138] trunk/Source/WebCore
Revision
106138
Author
[email protected]
Date
2012-01-27 11:32:43 -0800 (Fri, 27 Jan 2012)

Log Message

When threaded scrolling is enabled for a FrameView, always put scrollbars in layers
https://bugs.webkit.org/show_bug.cgi?id=77232
<rdar://problem/10766708>

Reviewed by Beth Dakin.

* page/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView):
* page/ScrollingCoordinator.h:
Add a new helper function.

* rendering/RenderLayerCompositor.cpp:
(WebCore::shouldCompositeOverflowControls):
Make this take a FrameView, check with the scrolling coordinator if the overflow controls should be composited.

(WebCore::RenderLayerCompositor::requiresHorizontalScrollbarLayer):
(WebCore::RenderLayerCompositor::requiresVerticalScrollbarLayer):
(WebCore::RenderLayerCompositor::requiresScrollCornerLayer):
Update for the change to make shouldCompositeOverflowControls take a FrameView.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106137 => 106138)


--- trunk/Source/WebCore/ChangeLog	2012-01-27 19:27:43 UTC (rev 106137)
+++ trunk/Source/WebCore/ChangeLog	2012-01-27 19:32:43 UTC (rev 106138)
@@ -1,3 +1,25 @@
+2012-01-27  Anders Carlsson  <[email protected]>
+
+        When threaded scrolling is enabled for a FrameView, always put scrollbars in layers
+        https://bugs.webkit.org/show_bug.cgi?id=77232
+        <rdar://problem/10766708>
+
+        Reviewed by Beth Dakin.
+
+        * page/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView):
+        * page/ScrollingCoordinator.h:
+        Add a new helper function.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::shouldCompositeOverflowControls):
+        Make this take a FrameView, check with the scrolling coordinator if the overflow controls should be composited.
+
+        (WebCore::RenderLayerCompositor::requiresHorizontalScrollbarLayer):
+        (WebCore::RenderLayerCompositor::requiresVerticalScrollbarLayer):
+        (WebCore::RenderLayerCompositor::requiresScrollCornerLayer):
+        Update for the change to make shouldCompositeOverflowControls take a FrameView.
+
 2012-01-24  Vincent Scheib  <[email protected]>
 
         Pointer Lock: Implement pointer interface

Modified: trunk/Source/WebCore/page/ScrollingCoordinator.cpp (106137 => 106138)


--- trunk/Source/WebCore/page/ScrollingCoordinator.cpp	2012-01-27 19:27:43 UTC (rev 106137)
+++ trunk/Source/WebCore/page/ScrollingCoordinator.cpp	2012-01-27 19:32:43 UTC (rev 106138)
@@ -62,6 +62,18 @@
     m_page = 0;
 }
 
+bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView) const
+{
+    ASSERT(isMainThread());
+    ASSERT(m_page);
+
+    // We currently only handle the main frame.
+    if (frameView->frame() != m_page->mainFrame())
+        return false;
+
+    return true;
+}
+
 void ScrollingCoordinator::syncFrameViewGeometry(FrameView* frameView)
 {
     ASSERT(isMainThread());

Modified: trunk/Source/WebCore/page/ScrollingCoordinator.h (106137 => 106138)


--- trunk/Source/WebCore/page/ScrollingCoordinator.h	2012-01-27 19:27:43 UTC (rev 106137)
+++ trunk/Source/WebCore/page/ScrollingCoordinator.h	2012-01-27 19:32:43 UTC (rev 106138)
@@ -56,6 +56,9 @@
 
     void pageDestroyed();
 
+    // Return whether this scrolling coordinator handles scrolling for the given frame view.
+    bool coordinatesScrollingForFrameView(FrameView*) const;
+
     // Should be called whenever the scroll layer for the given frame view changes.
     void frameViewScrollLayerDidChange(FrameView*, const GraphicsLayer*);
 

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (106137 => 106138)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-01-27 19:27:43 UTC (rev 106137)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-01-27 19:32:43 UTC (rev 106138)
@@ -1677,10 +1677,18 @@
     return true;
 }
 
-static bool shouldCompositeOverflowControls(ScrollView* view)
+static bool shouldCompositeOverflowControls(FrameView* view)
 {
     if (view->platformWidget())
         return false;
+
+#if ENABLE(THREADED_SCROLLING)
+    if (Page* page = view->frame()->page()) {
+        if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
+            return scrollingCoordinator->coordinatesScrollingForFrameView(view);
+    }
+#endif
+
 #if !PLATFORM(CHROMIUM)
     if (!view->hasOverlayScrollbars())
         return false;
@@ -1690,19 +1698,19 @@
 
 bool RenderLayerCompositor::requiresHorizontalScrollbarLayer() const
 {
-    ScrollView* view = m_renderView->frameView();
+    FrameView* view = m_renderView->frameView();
     return shouldCompositeOverflowControls(view) && view->horizontalScrollbar();
 }
 
 bool RenderLayerCompositor::requiresVerticalScrollbarLayer() const
 {
-    ScrollView* view = m_renderView->frameView();
+    FrameView* view = m_renderView->frameView();
     return shouldCompositeOverflowControls(view) && view->verticalScrollbar();
 }
 
 bool RenderLayerCompositor::requiresScrollCornerLayer() const
 {
-    ScrollView* view = m_renderView->frameView();
+    FrameView* view = m_renderView->frameView();
     return shouldCompositeOverflowControls(view) && view->isScrollCornerVisible();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to