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>
[CSS Background Blending] -webkit-background-blend-mode fails for certain SVG files
......@@ -1496,18 +1496,9 @@ bool RenderLayerCompositor::hasCoordinatedScrolling() const
return scrollingCoordinator && scrollingCoordinator->coordinatesScrollingForFrameView(&m_renderView.frameView());
}
void RenderLayerCompositor::frameViewDidScroll()
void RenderLayerCompositor::updateScrollLayerPosition()
{
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;
}
ASSERT(m_scrollLayer);
FrameView& frameView = m_renderView.frameView();
IntPoint scrollPosition = frameView.scrollPosition();
......@@ -1524,6 +1515,22 @@ void RenderLayerCompositor::frameViewDidScroll()
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()
{
updateOverflowControlsLayers();
......@@ -3135,8 +3142,14 @@ void RenderLayerCompositor::ensureRootLayer()
m_clipLayer->addChild(m_scrollLayer.get());
m_scrollLayer->addChild(m_rootContentLayer.get());
frameViewDidChangeSize();
frameViewDidScroll();
m_clipLayer->setSize(m_renderView.frameView().unscaledVisibleContentSize());
updateOverflowControlsLayers();
if (hasCoordinatedScrolling())
scheduleLayerFlush(true);
else
updateScrollLayerPosition();
}
} else {
if (m_overflowControlsHostLayer) {
......
......@@ -375,6 +375,8 @@ private:
void updateOverflowControlsLayers();
void updateScrollLayerPosition();
void notifyIFramesOfCompositingChange();
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