[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)
commit1ddb4ec45b74720524abbb2c04de5f7962dc4f15
tree4c40a234c7570d653ee6d2abd898052814c53fd2
parentab0ab405139a412e314aa64434f4615dc1c71f8d
[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.

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