[CoordinatedGraphics] Use ScrollingCoordinator to track fixed layers
authorcaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 14:47:50 +0000 (14:47 +0000)
committercaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 14:47:50 +0000 (14:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108990

.:

Reviewed by Noam Rosenthal.

Add a new test that allow us to remove the fixed positioning of a layer but still keeping
it compositing. Coordinated Graphics had a bug where the CoordinatedSceneGraph would still
count this layer as fixed position.

* ManualTests/remove-fixed-position-but-keep-compositing.html: Added.

Source/WebCore:

Reviewed by Noam Rosenthal.

WebCore keeps ScrollingCoordinator up-to-date about whether layers are fixed or not, so we
don't need to traverse the tree every frame to get this information.

The function ScrollingCoordinator::setLayerIsFixedToContainerLayer() is called when
RenderLayerBacking is updating its graphics layers.

The new code also works in new situations where the previous was broken: if a layer changed
from being fixed to not fixed (but still kept as a layer for other reasons), the layer will
be correctly updated. Previous implementation only had logic to mark layers as fixed, but
not the other way round. A manual test was added to illustrate the solved problem.

Testing was done with the existing manual tests that make use of "position:fixed". Automatic
tests are mostly not affected by this because usage of this information affects only the
UseFixedLayout mode, not used by default in WebKitTestRunner. Work to improve this situation
will be tracked in bug https://bugs.webkit.org/show_bug.cgi?id=109175.

* CMakeLists.txt:
* Target.pri:
* WebCore.pri:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::create): create specific version of ScrollingCoordinator.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: Added.
(WebCore):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::setLayerIsFixedToContainerLayer):
update layer information using existing hook in ScrollingCoordinator.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
(WebCore):
(ScrollingCoordinatorCoordinatedGraphics):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setFixedToViewport): now that setting viewport is not
embedded in the synchronization work, we need to mark the layer so it is updated in the
next frame.
(WebCore):
(WebCore::CoordinatedGraphicsLayer::flushCompositingState): remove call to syncFixedLayers().
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayerClient): remove now unused syncFixedLayers() from client.
(CoordinatedGraphicsLayer):

Source/WebKit2:

Reviewed by Noam Rosenthal.
Signed off for WebKit2 by Simon Fraser.

WebCore keeps ScrollingCoordinator up-to-date about whether layers are fixed or not, so we
don't need to traverse the tree every frame to get this information.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: remove
syncFixedLayers() and its helper functions. Those were used to identify the fixed layers
and are not needed anymore.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl): enable the scrolling coordinator usage for
Coordinated Graphics.

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

15 files changed:
ChangeLog
ManualTests/remove-fixed-position-but-keep-compositing.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Target.pri
Source/WebCore/WebCore.pri
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp [new file with mode: 0644]
Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h [new file with mode: 0644]
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp

index 5788e3e52c4117396aa0b7e314101310b2e58159..6fb075c1d461ccf3279a0b8318119768e42d29f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2013-02-07  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
+
+        [CoordinatedGraphics] Use ScrollingCoordinator to track fixed layers
+        https://bugs.webkit.org/show_bug.cgi?id=108990
+
+        Reviewed by Noam Rosenthal.
+
+        Add a new test that allow us to remove the fixed positioning of a layer but still keeping
+        it compositing. Coordinated Graphics had a bug where the CoordinatedSceneGraph would still
+        count this layer as fixed position.
+
+        * ManualTests/remove-fixed-position-but-keep-compositing.html: Added.
+
 2013-02-07  Gustavo Noronha Silva  <gns@gnome.org>
 
         Unreviewed build fix after r141196 for 32 bits autotools.
diff --git a/ManualTests/remove-fixed-position-but-keep-compositing.html b/ManualTests/remove-fixed-position-but-keep-compositing.html
new file mode 100644 (file)
index 0000000..a2dbc44
--- /dev/null
@@ -0,0 +1,46 @@
+<html>
+
+  <body style="height: 10000px">
+
+  <button id="toggle">Toggle</button>
+
+  <p>
+  The black rectangle starts fixed, and due to a -webkit-transform will be composited. Toggle to unfix it and scroll: the black rectangle should scroll with the page and not overlap the numbers.
+  </p>
+
+  <div id="rect" style="background-color: black; width: 200px; height: 200px; position: fixed; -webkit-transform: translate3d(0,0,0)">
+  </div>
+
+1<br>
+2<br>
+3<br>
+4<br>
+5<br>
+6<br>
+7<br>
+8<br>
+9<br>
+10<br>
+11<br>
+12<br>
+13<br>
+14<br>
+15<br>
+16<br>
+17<br>
+18<br>
+19<br>
+20<br>
+
+<script>
+var rect = document.getElementById("rect");
+var toggle = document.getElementById("toggle");
+
+toggle.addEventListener("click", function (ev) {
+    if (rect.style.position === "fixed") {
+        rect.style.position = "";
+    } else {
+        rect.style.position = "fixed";
+    }
+});
+</script>
index bfd51fd81a3462722c82432e3a3ed84a92ae1a7d..5020e2943a77e5eff6b60f377e688bc2f05c114e 100644 (file)
@@ -44,6 +44,7 @@ set(WebCore_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/page"
     "${WEBCORE_DIR}/page/animation"
     "${WEBCORE_DIR}/page/scrolling"
+    "${WEBCORE_DIR}/page/scrolling/coordinatedgraphics"
     "${WEBCORE_DIR}/platform"
     "${WEBCORE_DIR}/platform/animation"
     "${WEBCORE_DIR}/platform/audio"
@@ -1820,6 +1821,7 @@ set(WebCore_SOURCES
 
     page/scrolling/ScrollingConstraints.cpp
     page/scrolling/ScrollingCoordinator.cpp
+    page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
 
     platform/Arena.cpp
     platform/AsyncFileSystem.cpp
index 5eae2040fa3b735b1ad6e5aa2f82676d800289dd..6f177f5f10553621adf69cea4b586c1e8ffc1b14 100644 (file)
@@ -1,3 +1,49 @@
+2013-02-07  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
+
+        [CoordinatedGraphics] Use ScrollingCoordinator to track fixed layers
+        https://bugs.webkit.org/show_bug.cgi?id=108990
+
+        Reviewed by Noam Rosenthal.
+
+        WebCore keeps ScrollingCoordinator up-to-date about whether layers are fixed or not, so we
+        don't need to traverse the tree every frame to get this information.
+
+        The function ScrollingCoordinator::setLayerIsFixedToContainerLayer() is called when
+        RenderLayerBacking is updating its graphics layers.
+
+        The new code also works in new situations where the previous was broken: if a layer changed
+        from being fixed to not fixed (but still kept as a layer for other reasons), the layer will
+        be correctly updated. Previous implementation only had logic to mark layers as fixed, but
+        not the other way round. A manual test was added to illustrate the solved problem.
+
+        Testing was done with the existing manual tests that make use of "position:fixed". Automatic
+        tests are mostly not affected by this because usage of this information affects only the
+        UseFixedLayout mode, not used by default in WebKitTestRunner. Work to improve this situation
+        will be tracked in bug https://bugs.webkit.org/show_bug.cgi?id=109175.
+
+        * CMakeLists.txt:
+        * Target.pri:
+        * WebCore.pri:
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::create): create specific version of ScrollingCoordinator.
+        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: Added.
+        (WebCore):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::setLayerIsFixedToContainerLayer):
+        update layer information using existing hook in ScrollingCoordinator.
+        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
+        (WebCore):
+        (ScrollingCoordinatorCoordinatedGraphics):
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::setFixedToViewport): now that setting viewport is not
+        embedded in the synchronization work, we need to mark the layer so it is updated in the
+        next frame.
+        (WebCore):
+        (WebCore::CoordinatedGraphicsLayer::flushCompositingState): remove call to syncFixedLayers().
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+        (CoordinatedGraphicsLayerClient): remove now unused syncFixedLayers() from client.
+        (CoordinatedGraphicsLayer):
+
 2013-02-07  Keishi Hattori  <keishi@webkit.org>
 
         REGRESSION (r140778): Calendar Picker doesn't open when the element has the required attribute
index b6983ba65b3e0ba08f436919c981bae5fa5f3fc6..ab08d7d70231910182c0a4384c58c1b0f53064d9 100644 (file)
@@ -4066,6 +4066,7 @@ enable?(CANVAS_PROXY) {
 
 use?(3D_GRAPHICS) {
     HEADERS += \
+        page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h \
         platform/graphics/cpu/arm/GraphicsContext3DNEON.h \
         platform/graphics/ANGLEWebKitBridge.h \
         platform/graphics/Extensions3D.h \
@@ -4090,6 +4091,7 @@ use?(3D_GRAPHICS) {
         platform/graphics/texmap/coordinated/UpdateAtlas.h
 
     SOURCES += \
+        page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp \
         platform/graphics/ANGLEWebKitBridge.cpp \
         platform/graphics/GraphicsContext3D.cpp \
         platform/graphics/gpu/DrawingBuffer.cpp \
index 1525b671a95c8a6d7b0115bc7eddd1e4ec213357..8f59c5d26a7f1997db37bc7f312b6008e7f45bea 100644 (file)
@@ -50,6 +50,7 @@ INCLUDEPATH += \
     $$SOURCE_DIR/page/animation \
     $$SOURCE_DIR/page/qt \
     $$SOURCE_DIR/page/scrolling \
+    $$SOURCE_DIR/page/scrolling/coordinatedgraphics \
     $$SOURCE_DIR/platform \
     $$SOURCE_DIR/platform/animation \
     $$SOURCE_DIR/platform/audio \
@@ -63,6 +64,7 @@ INCLUDEPATH += \
     $$SOURCE_DIR/platform/graphics/qt \
     $$SOURCE_DIR/platform/graphics/surfaces \
     $$SOURCE_DIR/platform/graphics/texmap \
+    $$SOURCE_DIR/platform/graphics/texmap/coordinated \
     $$SOURCE_DIR/platform/graphics/transforms \
     $$SOURCE_DIR/platform/image-decoders \
     $$SOURCE_DIR/platform/image-decoders/bmp \
index f12c280ad942c0e7a339fedf6d5e7ea003853668..2ec7165485e7c1c51acd40f511f6a1a7ea908894 100644 (file)
 #include "ScrollingCoordinatorChromium.h"
 #endif
 
+#if USE(COORDINATED_GRAPHICS)
+#include "ScrollingCoordinatorCoordinatedGraphics.h"
+#endif
+
 namespace WebCore {
 
 PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
@@ -64,6 +68,10 @@ PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
     return adoptRef(new ScrollingCoordinatorChromium(page));
 #endif
 
+#if USE(COORDINATED_GRAPHICS)
+    return adoptRef(new ScrollingCoordinatorCoordinatedGraphics(page));
+#endif
+
     return adoptRef(new ScrollingCoordinator(page));
 }
 
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
new file mode 100644 (file)
index 0000000..a1bf3bd
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(COORDINATED_GRAPHICS)
+
+#include "ScrollingCoordinatorCoordinatedGraphics.h"
+
+#include "CoordinatedGraphicsLayer.h"
+#include "Page.h"
+#include "Settings.h"
+
+namespace WebCore {
+
+ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics(Page* page)
+    : ScrollingCoordinator(page)
+{
+}
+
+void ScrollingCoordinatorCoordinatedGraphics::setLayerIsFixedToContainerLayer(GraphicsLayer* layer, bool enable)
+{
+    if (!m_page->settings()->acceleratedCompositingForFixedPositionEnabled())
+        return;
+    toCoordinatedGraphicsLayer(layer)->setFixedToViewport(enable);
+}
+
+} // namespace WebCore
+
+#endif // USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h
new file mode 100644 (file)
index 0000000..87c2c72
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollingCoordinatorCoordinatedGraphics_h
+#define ScrollingCoordinatorCoordinatedGraphics_h
+
+#if USE(COORDINATED_GRAPHICS)
+
+#include "ScrollingCoordinator.h"
+
+namespace WebCore {
+
+class ScrollingCoordinatorCoordinatedGraphics : public ScrollingCoordinator {
+public:
+    explicit ScrollingCoordinatorCoordinatedGraphics(Page*);
+
+    virtual void setLayerIsFixedToContainerLayer(GraphicsLayer*, bool);
+};
+
+} // namespace WebCore
+
+#endif // USE(COORDINATED_GRAPHICS)
+
+#endif
index 3736f2604c0c104399957b98a2525ee7dbcdd9bb..0ee97cdc00bae59ee84deb69644e45bb371213b2 100644 (file)
@@ -464,6 +464,15 @@ CoordinatedLayerID CoordinatedGraphicsLayer::id() const
     return m_id;
 }
 
+void CoordinatedGraphicsLayer::setFixedToViewport(bool isFixed)
+{
+    if (m_fixedToViewport == isFixed)
+        return;
+
+    m_fixedToViewport = isFixed;
+    didChangeLayerState();
+}
+
 void CoordinatedGraphicsLayer::flushCompositingState(const FloatRect& rect)
 {
     if (!m_coordinator->isFlushingLayerChanges()) {
@@ -478,8 +487,6 @@ void CoordinatedGraphicsLayer::flushCompositingState(const FloatRect& rect)
     if (CoordinatedGraphicsLayer* replica = toCoordinatedGraphicsLayer(replicaLayer()))
         replica->flushCompositingStateForThisLayerOnly();
 
-    m_coordinator->syncFixedLayers();
-
     flushCompositingStateForThisLayerOnly();
 
     for (size_t i = 0; i < children().size(); ++i)
index a551d3511ada644ebf732bef62e86ad9d87f1a20..a3f0a08fd98215d1016d27859f52758334020fa2 100644 (file)
@@ -72,7 +72,6 @@ public:
     virtual void setLayerAnimations(CoordinatedLayerID, const GraphicsLayerAnimations&) = 0;
 
     virtual void detachLayer(CoordinatedGraphicsLayer*) = 0;
-    virtual void syncFixedLayers() = 0;
     virtual PassOwnPtr<GraphicsContext> beginContentUpdate(const IntSize&, CoordinatedSurface::Flags, uint32_t& atlasID, IntPoint&) = 0;
 };
 
@@ -137,7 +136,7 @@ public:
 
     CoordinatedLayerID id() const;
 
-    void setFixedToViewport(bool isFixed) { m_fixedToViewport = isFixed; }
+    void setFixedToViewport(bool isFixed);
 
     IntRect coverRect() const { return m_mainBackingStore ? m_mainBackingStore->mapToContents(m_mainBackingStore->coverRect()) : IntRect(); }
 
index a73e644df2c894ccd3fd70ca9da514bdca9fe3ac..eeea5125dc14b9c392c6ab266bee295d74b165bd 100644 (file)
@@ -1,3 +1,22 @@
+2013-02-07  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
+
+        [CoordinatedGraphics] Use ScrollingCoordinator to track fixed layers
+        https://bugs.webkit.org/show_bug.cgi?id=108990
+
+        Reviewed by Noam Rosenthal.
+        Signed off for WebKit2 by Simon Fraser.
+
+        WebCore keeps ScrollingCoordinator up-to-date about whether layers are fixed or not, so we
+        don't need to traverse the tree every frame to get this information.
+
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: remove
+        syncFixedLayers() and its helper functions. Those were used to identify the fixed layers
+        and are not needed anymore.
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::DrawingAreaImpl): enable the scrolling coordinator usage for
+        Coordinated Graphics.
+
 2013-02-07  Michael BrĂ¼ning  <michael.bruning@digia.com>
 
         [Qt][WK2] Fold QtWebPageLoadClient into QQuickWebViewPrivate and move to C API.
index 9bab108a84475b6e6838830c869b42b0d6813d14..c3b63befc75b24a1e7cebe434206cdea74cdfe28 100644 (file)
@@ -469,54 +469,6 @@ void CoordinatedLayerTreeHost::detachLayer(CoordinatedGraphicsLayer* layer)
     scheduleLayerFlush();
 }
 
-static void updateOffsetFromViewportForSelf(RenderLayer* renderLayer)
-{
-    // These conditions must match the conditions in RenderLayerCompositor::requiresCompositingForPosition.
-    RenderLayerBacking* backing = renderLayer->backing();
-    if (!backing)
-        return;
-
-    RenderStyle* style = renderLayer->renderer()->style();
-    if (!style)
-        return;
-
-    if (!renderLayer->renderer()->isOutOfFlowPositioned() || renderLayer->renderer()->style()->position() != FixedPosition)
-        return;
-
-    if (!renderLayer->renderer()->container()->isRenderView())
-        return;
-
-    if (!renderLayer->isStackingContainer())
-        return;
-
-    CoordinatedGraphicsLayer* graphicsLayer = toCoordinatedGraphicsLayer(backing->graphicsLayer());
-    graphicsLayer->setFixedToViewport(true);
-}
-
-static void updateOffsetFromViewportForLayer(RenderLayer* renderLayer)
-{
-    updateOffsetFromViewportForSelf(renderLayer);
-
-    if (renderLayer->firstChild())
-        updateOffsetFromViewportForLayer(renderLayer->firstChild());
-    if (renderLayer->nextSibling())
-        updateOffsetFromViewportForLayer(renderLayer->nextSibling());
-}
-
-void CoordinatedLayerTreeHost::syncFixedLayers()
-{
-    if (!m_webPage->corePage()->settings() || !m_webPage->corePage()->settings()->acceleratedCompositingForFixedPositionEnabled())
-        return;
-
-    if (!m_webPage->mainFrame()->view()->hasViewportConstrainedObjects())
-        return;
-
-    RenderLayer* rootRenderLayer = m_webPage->mainFrame()->contentRenderer()->compositor()->rootRenderLayer();
-    ASSERT(rootRenderLayer);
-    if (rootRenderLayer->firstChild())
-        updateOffsetFromViewportForLayer(rootRenderLayer->firstChild());
-}
-
 void CoordinatedLayerTreeHost::lockAnimations()
 {
     m_animationsLocked = true;
index 7297eed81e05a2ee0f005eea3df81885fec3f2b5..544ea7a09b798dc2cd4c714adc81667682ebb89c 100644 (file)
@@ -105,7 +105,6 @@ public:
 #endif
     virtual void setLayerRepaintCount(WebCore::CoordinatedLayerID, int) OVERRIDE;
     virtual void detachLayer(WebCore::CoordinatedGraphicsLayer*);
-    virtual void syncFixedLayers();
 
     virtual PassOwnPtr<WebCore::GraphicsContext> beginContentUpdate(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags, uint32_t& atlasID, WebCore::IntPoint&);
 
index 29ea02128410abd868c7fc9d7970e2198a044a6c..4af153dd60bbfc3312a292cae0d3bb96049ca039 100644 (file)
@@ -73,6 +73,7 @@ DrawingAreaImpl::DrawingAreaImpl(WebPage* webPage, const WebPageCreationParamete
 
 #if USE(COORDINATED_GRAPHICS)
     m_alwaysUseCompositing = true;
+    webPage->corePage()->settings()->setScrollingCoordinatorEnabled(true);
 #endif
 
     if (m_alwaysUseCompositing)