RenderLayerCompositor should let ScrollingCoordinator update main thread scrolling...
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2013 18:57:42 +0000 (18:57 +0000)
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2013 18:57:42 +0000 (18:57 +0000)
commit3f988a706e2a0ea14feb052f73d2841faf7249dc
tree19151d792ccad3c30e9334a5dee5f11cab33fce0
parentccd4bef28c1ece40e1936bd5a298cf11ee438e88
RenderLayerCompositor should let ScrollingCoordinator update main thread scrolling reasons after change of layers
https://bugs.webkit.org/show_bug.cgi?id=105652

Reviewed by Simon Fraser.

Source/WebCore:

Let ScrollingCoordinator know the change of ViewportConstrainedNotCompositedReason in time.
By the way moved RenderLayerCompositor::FixedPositionLayerNotCompositedReason to RenderLayer::ViewportConstrainedNotCompositedReason.

Tests: compositing/layer-creation/fixed-position-in-view-dynamic.html
       compositing/layer-creation/fixed-position-out-of-view-dynamic.html

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
(WebCore::ScrollingCoordinator::mainThreadScrollingReasons):
(WebCore::ScrollingCoordinator::mainThreadScrollingReasonsAsText):
* page/scrolling/ScrollingCoordinator.h:
(ScrollingCoordinator):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
(WebCore::ScrollingCoordinatorMac::hasVisibleSlowRepaintViewportConstrainedObjects):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::logThreadedScrollingMode):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::paintLayer):
* rendering/RenderLayer.h:
(RenderLayer): Moved RenderLayerCompositor::FixedPositionLayerNotCompositedReason to here and renamed it to ViewportConstrainedNotCompositedReason.
(WebCore::RenderLayer::setViewportConstrainedNotCompositedReason):
(WebCore::RenderLayer::viewportConstrainedNotCompositedReason):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateBacking): Now updates ViewportConstrainedNotCompositedReason here instead of in computeCompositingRequirements before so that the reason is updated in time.
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::needsToBeComposited):
(WebCore::RenderLayerCompositor::requiresCompositingLayer):
(WebCore::RenderLayerCompositor::reasonForCompositing):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::reportMemoryUsage):
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor):

LayoutTests:

Tests to ensure mainThreadScrollingReasons are correctly updated after a fixed element is dynamically inserted into the DOM tree.

* compositing/layer-creation/fixed-position-in-view-dynamic-expected.txt: Added.
* compositing/layer-creation/fixed-position-in-view-dynamic.html: Added.
* compositing/layer-creation/fixed-position-out-of-view-dynamic-expected.txt: Added.
* compositing/layer-creation/fixed-position-out-of-view-dynamic.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/layer-creation/fixed-position-in-view-dynamic-expected.txt [new file with mode: 0644]
LayoutTests/compositing/layer-creation/fixed-position-in-view-dynamic.html [new file with mode: 0644]
LayoutTests/compositing/layer-creation/fixed-position-out-of-view-dynamic-expected.txt [new file with mode: 0644]
LayoutTests/compositing/layer-creation/fixed-position-out-of-view-dynamic.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h