REGRESSION (r183300): Fixed elements flash when scrolling
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2015 01:46:59 +0000 (01:46 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2015 01:46:59 +0000 (01:46 +0000)
commit3508402e05f13e3a2bdc419db8e357a1f73518ec
treeca73d767aaca51796cbd5e4007908228ba191ddf
parente38f8708371bc4cc5599aadf55250633b1e8fb4a
REGRESSION (r183300): Fixed elements flash when scrolling
https://bugs.webkit.org/show_bug.cgi?id=144778
rdar://problem/20769741

Reviewed by Dean Jackson.

After r183300 we can detached layer backing store when outside the coverage region.
However, position:fixed layers are moved around by the ScrollingCoordinator behind
GraphicsLayer's back, so we can do layer flushes with stale information about layer
geometry.

To avoid dropping backing store for layers in this situation, prevent backing
store detachment on layers registered with the ScrollingCoordinator as viewport-constrained
layers. Preventing detachment on a layer also prevents detachment on all descendant
layers.

* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setAllowsBackingStoreDetachment):
(WebCore::GraphicsLayer::allowsBackingStoreDetachment):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): Set m_intersectsCoverageRect to true
if backing store detachment is prevented.
(WebCore::GraphicsLayerCA::recursiveCommitChanges): Set a bit in the CommitState to
communicate to descendants that detachment is prevented.
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::CommitState::CommitState): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):
* rendering/RenderLayerBacking.h:
(WebCore::RenderLayerBacking::setScrollingNodeIDForRole): If registering with a non-zero
nodeID for the ViewportConstrained role, turn off backing store detachment.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h