Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: Source/WebCore/rendering/RenderLayerCompositor.cpp

Issue 8403008: Merge 98060 - Hidden composited iframes cause infinite loop (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderLayerCompositor.cpp
===================================================================
--- Source/WebCore/rendering/RenderLayerCompositor.cpp (revision 98520)
+++ Source/WebCore/rendering/RenderLayerCompositor.cpp (working copy)
@@ -95,6 +95,7 @@
, m_updateCompositingLayersTimer(this, &RenderLayerCompositor::updateCompositingLayersTimerFired)
, m_hasAcceleratedCompositing(true)
, m_compositingTriggers(static_cast<ChromeClient::CompositingTriggerFlags>(ChromeClient::AllTriggers))
+ , m_compositedLayerCount(0)
, m_showDebugBorders(false)
, m_showRepaintCounter(false)
, m_compositingConsultsOverlap(true)
@@ -241,6 +242,11 @@
updateCompositingLayers();
}
+bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const
+{
+ return m_compositedLayerCount > rootLayer->isComposited();
+}
+
void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot)
{
m_updateCompositingLayersTimer.stop();
@@ -305,7 +311,9 @@
// Host the document layer in the RenderView's root layer.
if (updateRoot == rootRenderLayer()) {
- if (childList.isEmpty())
+ // Even when childList is empty, don't drop out of compositing mode if there are
+ // composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
+ if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(updateRoot))
destroyRootLayer();
else
m_rootContentLayer->setChildren(childList);
@@ -770,8 +778,9 @@
}
// If we're back at the root, and no other layers need to be composited, and the root layer itself doesn't need
- // to be composited, then we can drop out of compositing mode altogether.
- if (layer->isRootLayer() && !childState.m_subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode) {
+ // to be composited, then we can drop out of compositing mode altogether. However, don't drop out of compositing mode
+ // if there are composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
+ if (layer->isRootLayer() && !childState.m_subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode && !hasAnyAdditionalCompositedLayers(layer)) {
enableCompositingMode(false);
willBeComposited = false;
}
« no previous file with comments | « Source/WebCore/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698