Enable ScrollingCoordinator in chromium whenever compositing is enabled
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 01:04:21 +0000 (01:04 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 01:04:21 +0000 (01:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79165

Reviewed by Adam Barth.

Source/WebCore:

As the title says.

* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange):
(WebCore::ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange):
(WebCore::ScrollingCoordinator::setScrollLayer):
(WebCore::ScrollingCoordinator::setNonFastScrollableRegion):
(WebCore::ScrollingCoordinator::setScrollParameters):
(WebCore::ScrollingCoordinator::setWheelEventHandlerCount):
(WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):
    Remove ASSERT_NOT_REACHED()ed from these functions, they are now expected to be called but do nothing.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
    Guard a mac-specific piece of code in #if PLATFORM(MAC). This code already has a FIXME.
* rendering/RenderLayerCompositor.cpp:
(WebCore::shouldCompositeOverflowControls):
    Make coordinatesScroll..() sufficient but not necessary for compositing overflow controls. In chromium, we
    want to composite overflow controls even for FrameViews that we aren't coordinating via the
    ScrollingCoordinator.

Source/WebKit/chromium:

* src/NonCompositedContentHost.cpp:
(WebKit::NonCompositedContentHost::setViewport):
    Whenever the ScrollingCoordinator is enabled the scroll layer's position is expected to be updated
    externally to RenderLayerCompositor, so set it here.
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::setAcceleratedCompositingEnabled):

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

Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/NonCompositedContentHost.cpp
Source/WebKit/chromium/src/WebSettingsImpl.cpp

index d6d90c7..9050803 100644 (file)
@@ -1,3 +1,30 @@
+2012-02-21  James Robinson  <jamesr@chromium.org>
+
+        Enable ScrollingCoordinator in chromium whenever compositing is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=79165
+
+        Reviewed by Adam Barth.
+
+        As the title says.
+
+        * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
+        (WebCore::ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange):
+        (WebCore::ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange):
+        (WebCore::ScrollingCoordinator::setScrollLayer):
+        (WebCore::ScrollingCoordinator::setNonFastScrollableRegion):
+        (WebCore::ScrollingCoordinator::setScrollParameters):
+        (WebCore::ScrollingCoordinator::setWheelEventHandlerCount):
+        (WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):
+            Remove ASSERT_NOT_REACHED()ed from these functions, they are now expected to be called but do nothing.
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::RenderLayerBacking):
+            Guard a mac-specific piece of code in #if PLATFORM(MAC). This code already has a FIXME.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::shouldCompositeOverflowControls):
+            Make coordinatesScroll..() sufficient but not necessary for compositing overflow controls. In chromium, we
+            want to composite overflow controls even for FrameViews that we aren't coordinating via the
+            ScrollingCoordinator.
+
 2012-02-21  Adam Klein  <adamk@chromium.org>
 
         Setting innerText causes DOMSubtreeModified to be dispatched too early
index 18a6d7c..890e098 100644 (file)
@@ -36,25 +36,21 @@ PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
 
 void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer* horizontalScrollbarLayer)
 {
-    ASSERT_NOT_REACHED();
     // FIXME: Implement!
 }
 
 void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView*, GraphicsLayer* verticalScrollbarLayer)
 {
-    ASSERT_NOT_REACHED();
     // FIXME: Implement!
 }
 
 void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer)
 {
-    ASSERT_NOT_REACHED();
     // FIXME: Implement!
 }
 
 void ScrollingCoordinator::setNonFastScrollableRegion(const Region&)
 {
-    ASSERT_NOT_REACHED();
     // FIXME: Implement!
 }
 
@@ -62,19 +58,16 @@ void ScrollingCoordinator::setScrollParameters(ScrollElasticity horizontalScroll
                                                bool hasEnabledHorizontalScrollbar, bool hasEnabledVerticalScrollbar,
                                                const IntRect& viewportRect, const IntSize& contentsSize)
 {
-    ASSERT_NOT_REACHED();
     // FIXME: Implement!
 }
 
 void ScrollingCoordinator::setWheelEventHandlerCount(unsigned)
 {
-    ASSERT_NOT_REACHED();
     // FIXME: Implement!
 }
 
 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool)
 {
-    ASSERT_NOT_REACHED();
     // FIXME: Implement!
 }
 
index b92e6b6..f559970 100644 (file)
@@ -101,9 +101,11 @@ RenderLayerBacking::RenderLayerBacking(RenderLayer* layer)
         if (page && frame && page->mainFrame() == frame) {
             m_isMainFrameRenderViewLayer = true;
 
+#if PLATFORM(MAC)
             // FIXME: It's a little weird that we base this decision on whether there's a scrolling coordinator or not.
             if (page->scrollingCoordinator())
                 m_usingTiledCacheLayer = true;
+#endif
         }
     }
     
index 5e2511c..75a280c 100644 (file)
@@ -1712,7 +1712,8 @@ static bool shouldCompositeOverflowControls(FrameView* view)
 
     if (Page* page = view->frame()->page()) {
         if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
-            return scrollingCoordinator->coordinatesScrollingForFrameView(view);
+            if (scrollingCoordinator->coordinatesScrollingForFrameView(view))
+                return true;
     }
 
 #if !PLATFORM(CHROMIUM)
index 800d0f0..6435dd7 100644 (file)
@@ -1,3 +1,17 @@
+2012-02-21  James Robinson  <jamesr@chromium.org>
+
+        Enable ScrollingCoordinator in chromium whenever compositing is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=79165
+
+        Reviewed by Adam Barth.
+
+        * src/NonCompositedContentHost.cpp:
+        (WebKit::NonCompositedContentHost::setViewport):
+            Whenever the ScrollingCoordinator is enabled the scroll layer's position is expected to be updated
+            externally to RenderLayerCompositor, so set it here.
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::setAcceleratedCompositingEnabled):
+
 2012-02-21  Daniel Cheng  <dcheng@chromium.org>
 
         [chromium] Fix image drag out on Chromium
index c9be08a..b6b1a22 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "NonCompositedContentHost.h"
 
+#include "FloatPoint.h"
 #include "FloatRect.h"
 #include "GraphicsLayer.h"
 #include "LayerChromium.h"
@@ -103,6 +104,7 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize,
 
     m_viewportSize = viewportSize;
     scrollLayer()->setScrollPosition(scrollPosition);
+    scrollLayer()->setPosition(-scrollPosition);
     // Due to the possibility of pinch zoom, the noncomposited layer is always
     // assumed to be scrollable.
     scrollLayer()->setScrollable(true);
index 90bd00c..a8b67f8 100644 (file)
@@ -331,6 +331,7 @@ void WebSettingsImpl::setEditingBehavior(EditingBehavior behavior)
 void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled)
 {
     m_settings->setAcceleratedCompositingEnabled(enabled);
+    m_settings->setScrollingCoordinatorEnabled(enabled);
 }
 
 void WebSettingsImpl::setForceCompositingMode(bool enabled)