Remote Layer Tree: Hook up setLayerTreeStateIsFrozen

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

Reviewed by Brent Fulgham.

setLayerTreeStateIsFrozen is the mechanism used to ensure that
layer property changes (including new backing store) aren't committed
while e.g. the page is reconfigured for printing.

* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::RemoteLayerTreeContext):
(WebKit::RemoteLayerTreeContext::flushLayers):
(WebKit::RemoteLayerTreeContext::setIsFlushingSuspended):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a8192012
2013-12-02 Tim Horton <timothy_horton@apple.com>
Remote Layer Tree: Hook up setLayerTreeStateIsFrozen
https://bugs.webkit.org/show_bug.cgi?id=124872
Reviewed by Brent Fulgham.
setLayerTreeStateIsFrozen is the mechanism used to ensure that
layer property changes (including new backing store) aren't committed
while e.g. the page is reconfigured for printing.
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::RemoteLayerTreeContext):
(WebKit::RemoteLayerTreeContext::flushLayers):
(WebKit::RemoteLayerTreeContext::setIsFlushingSuspended):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
2013-12-02 Tim Horton <timothy_horton@apple.com>
Remote Layer Tree: Disable direct image compositing
......
......@@ -56,6 +56,8 @@ public:
LayerHostingMode layerHostingMode() const { return m_webPage->layerHostingMode(); }
void setIsFlushingSuspended(bool);
private:
// WebCore::GraphicsLayerFactory
virtual std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE;
......@@ -71,6 +73,9 @@ private:
Vector<RemoteLayerTreeTransaction::LayerCreationProperties> m_createdLayers;
Vector<RemoteLayerTreeTransaction::LayerID> m_destroyedLayers;
bool m_isFlushingSuspended;
bool m_hasDeferredFlush;
};
} // namespace WebKit
......
......@@ -43,6 +43,8 @@ namespace WebKit {
RemoteLayerTreeContext::RemoteLayerTreeContext(WebPage* webPage)
: m_webPage(webPage)
, m_layerFlushTimer(this, &RemoteLayerTreeContext::layerFlushTimerFired)
, m_isFlushingSuspended(false)
, m_hasDeferredFlush(false)
{
}
......@@ -114,6 +116,11 @@ void RemoteLayerTreeContext::flushLayers()
if (!m_rootLayer)
return;
if (m_isFlushingSuspended) {
m_hasDeferredFlush = true;
return;
}
RemoteLayerTreeTransaction transaction;
transaction.setRootLayerID(m_rootLayer->layerID());
......@@ -131,4 +138,17 @@ void RemoteLayerTreeContext::flushLayers()
m_webPage->send(Messages::RemoteLayerTreeHost::Commit(transaction));
}
void RemoteLayerTreeContext::setIsFlushingSuspended(bool isFrozen)
{
if (m_isFlushingSuspended == isFrozen)
return;
m_isFlushingSuspended = isFrozen;
if (!m_isFlushingSuspended && m_hasDeferredFlush) {
m_hasDeferredFlush = false;
scheduleLayerFlush();
}
}
} // namespace WebKit
......@@ -64,6 +64,8 @@ private:
virtual void setPageOverlayNeedsDisplay(PageOverlay*, const WebCore::IntRect&) OVERRIDE;
virtual void setPageOverlayOpacity(PageOverlay*, float) OVERRIDE;
virtual void setLayerTreeStateIsFrozen(bool) OVERRIDE;
// WebCore::GraphicsLayerClient
virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) OVERRIDE { }
virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) OVERRIDE { }
......
......@@ -187,4 +187,9 @@ float RemoteLayerTreeDrawingArea::deviceScaleFactor() const
return m_webPage->corePage()->deviceScaleFactor();
}
void RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen(bool isFrozen)
{
m_remoteLayerTreeContext->setIsFlushingSuspended(isFrozen);
}
} // namespace WebKit
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