Commit 3642be9f authored by antti@apple.com's avatar antti@apple.com

Avoid unthrottled layer flushes triggered by RenderLayerCompositor::ensureRootLayer

https://bugs.webkit.org/show_bug.cgi?id=127426

Reviewed by Anders Carlsson.
        
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollLayerPosition):
(WebCore::RenderLayerCompositor::frameViewDidScroll):

    Factor scroll layer position update to a function.

(WebCore::RenderLayerCompositor::ensureRootLayer):
        
    Stop calling frameViewDidChangeSize/frameViewDidScroll. Instead call the relevent functions
    directly. This avoid unthrottled layer flush that is done when the view actually scrolls.

* rendering/RenderLayerCompositor.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 15e35e7a
2014-01-22 Antti Koivisto <antti@apple.com>
Avoid unthrottled layer flushes triggered by RenderLayerCompositor::ensureRootLayer
https://bugs.webkit.org/show_bug.cgi?id=127426
Reviewed by Anders Carlsson.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollLayerPosition):
(WebCore::RenderLayerCompositor::frameViewDidScroll):
Factor scroll layer position update to a function.
(WebCore::RenderLayerCompositor::ensureRootLayer):
Stop calling frameViewDidChangeSize/frameViewDidScroll. Instead call the relevent functions
directly. This avoid unthrottled layer flush that is done when the view actually scrolls.
* rendering/RenderLayerCompositor.h:
2014-01-22 Mihai Tica <mitica@adobe.com> 2014-01-22 Mihai Tica <mitica@adobe.com>
[CSS Background Blending] -webkit-background-blend-mode fails for certain SVG files [CSS Background Blending] -webkit-background-blend-mode fails for certain SVG files
...@@ -1496,18 +1496,9 @@ bool RenderLayerCompositor::hasCoordinatedScrolling() const ...@@ -1496,18 +1496,9 @@ bool RenderLayerCompositor::hasCoordinatedScrolling() const
return scrollingCoordinator && scrollingCoordinator->coordinatesScrollingForFrameView(&m_renderView.frameView()); return scrollingCoordinator && scrollingCoordinator->coordinatesScrollingForFrameView(&m_renderView.frameView());
} }
void RenderLayerCompositor::frameViewDidScroll() void RenderLayerCompositor::updateScrollLayerPosition()
{ {
if (!m_scrollLayer) ASSERT(m_scrollLayer);
return;
// If there's a scrolling coordinator that manages scrolling for this frame view,
// it will also manage updating the scroll layer position.
if (hasCoordinatedScrolling()) {
// We have to schedule a flush in order for the main TiledBacking to update its tile coverage.
scheduleLayerFlushNow();
return;
}
FrameView& frameView = m_renderView.frameView(); FrameView& frameView = m_renderView.frameView();
IntPoint scrollPosition = frameView.scrollPosition(); IntPoint scrollPosition = frameView.scrollPosition();
...@@ -1524,6 +1515,22 @@ void RenderLayerCompositor::frameViewDidScroll() ...@@ -1524,6 +1515,22 @@ void RenderLayerCompositor::frameViewDidScroll()
fixedBackgroundLayer->setPosition(IntPoint(frameView.scrollOffsetForFixedPosition())); fixedBackgroundLayer->setPosition(IntPoint(frameView.scrollOffsetForFixedPosition()));
} }
void RenderLayerCompositor::frameViewDidScroll()
{
if (!m_scrollLayer)
return;
// If there's a scrolling coordinator that manages scrolling for this frame view,
// it will also manage updating the scroll layer position.
if (hasCoordinatedScrolling()) {
// We have to schedule a flush in order for the main TiledBacking to update its tile coverage.
scheduleLayerFlushNow();
return;
}
updateScrollLayerPosition();
}
void RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars() void RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars()
{ {
updateOverflowControlsLayers(); updateOverflowControlsLayers();
...@@ -3135,8 +3142,14 @@ void RenderLayerCompositor::ensureRootLayer() ...@@ -3135,8 +3142,14 @@ void RenderLayerCompositor::ensureRootLayer()
m_clipLayer->addChild(m_scrollLayer.get()); m_clipLayer->addChild(m_scrollLayer.get());
m_scrollLayer->addChild(m_rootContentLayer.get()); m_scrollLayer->addChild(m_rootContentLayer.get());
frameViewDidChangeSize(); m_clipLayer->setSize(m_renderView.frameView().unscaledVisibleContentSize());
frameViewDidScroll();
updateOverflowControlsLayers();
if (hasCoordinatedScrolling())
scheduleLayerFlush(true);
else
updateScrollLayerPosition();
} }
} else { } else {
if (m_overflowControlsHostLayer) { if (m_overflowControlsHostLayer) {
......
...@@ -375,6 +375,8 @@ private: ...@@ -375,6 +375,8 @@ private:
void updateOverflowControlsLayers(); void updateOverflowControlsLayers();
void updateScrollLayerPosition();
void notifyIFramesOfCompositingChange(); void notifyIFramesOfCompositingChange();
bool isFlushingLayers() const { return m_flushingLayers; } bool isFlushingLayers() const { return m_flushingLayers; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment