ScrollingCoordinator::coordinatesScrollingForFrameView should be conditional on compo...
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 21:39:00 +0000 (21:39 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 21:39:00 +0000 (21:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79126

Reviewed by Anders Carlsson.

The ScrollingCoordinator should only attempt to coordinate scrolling when compositing is active, since it's all
about manipulating GraphicsLayers. Adds a runtime check.

Also removes some stray #if ENABLE(THREADED_SCROLLING) guards that snuck into FrameView.

* page/FrameView.cpp:
(WebCore::FrameView::addFixedObject):
(WebCore::FrameView::removeFixedObject):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView):
(WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):

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

Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

index 0c8d7e2..cf14314 100644 (file)
@@ -1,5 +1,24 @@
 2012-02-21  James Robinson  <jamesr@chromium.org>
 
+        ScrollingCoordinator::coordinatesScrollingForFrameView should be conditional on compositing being active
+        https://bugs.webkit.org/show_bug.cgi?id=79126
+
+        Reviewed by Anders Carlsson.
+
+        The ScrollingCoordinator should only attempt to coordinate scrolling when compositing is active, since it's all
+        about manipulating GraphicsLayers. Adds a runtime check.
+
+        Also removes some stray #if ENABLE(THREADED_SCROLLING) guards that snuck into FrameView.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::addFixedObject):
+        (WebCore::FrameView::removeFixedObject):
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView):
+        (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
+
+2012-02-21  James Robinson  <jamesr@chromium.org>
+
         Chromium build fix. Unreviwed but rubber-stamped by Antti.
 
         * dom/Document.cpp:
index 8ff0828..024c484 100644 (file)
@@ -1337,12 +1337,10 @@ void FrameView::addFixedObject()
         if (platformWidget())
             updateCanBlitOnScrollRecursively();
 
-#if ENABLE(THREADED_SCROLLING)
         if (Page* page = m_frame->page()) {
             if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
                 scrollingCoordinator->frameViewHasFixedObjectsDidChange(this);
         }
-#endif
     }
 }
 
@@ -1352,12 +1350,10 @@ void FrameView::removeFixedObject()
     --m_fixedObjectCount;
 
     if (!m_fixedObjectCount) {
-#if ENABLE(THREADED_SCROLLING)
         if (Page* page = m_frame->page()) {
             if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
                 scrollingCoordinator->frameViewHasFixedObjectsDidChange(this);
         }
-#endif
 
         // FIXME: In addFixedObject() we only call this if there's a platform widget,
         // why isn't the same check being made here?
index 85b07f1..83aa87a 100644 (file)
@@ -99,7 +99,15 @@ bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView
     if (frameView->frame() != m_page->mainFrame())
         return false;
 
-    return true;
+    // We currently only support composited mode.
+#if USE(ACCELERATED_COMPOSITING)
+    RenderView* renderView = m_page->mainFrame()->contentRenderer();
+    if (!renderView)
+        return false;
+    return renderView->usesCompositing();
+#endif
+
+    return false;
 }
 
 static Region computeNonFastScrollableRegion(FrameView* frameView)