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

Unified Diff: Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

Issue 7873004: Merge 94964 - [chromium] REGRESSION(94353): Compositor textures and resources leaked when tab clo... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 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/platform/graphics/chromium/cc/CCLayerTreeHost.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (revision 94966)
+++ Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (working copy)
@@ -202,12 +202,32 @@
#endif
}
+void CCLayerTreeHost::clearRenderSurfacesRecursive(LayerChromium* layer)
+{
+ for (size_t i = 0; i < layer->children().size(); ++i)
+ clearRenderSurfacesRecursive(layer->children()[i].get());
+
+ if (layer->replicaLayer())
+ clearRenderSurfacesRecursive(layer->replicaLayer());
+
+ if (layer->maskLayer())
+ clearRenderSurfacesRecursive(layer->maskLayer());
+
+ layer->clearRenderSurface();
+}
+
+
void CCLayerTreeHost::setRootLayer(GraphicsLayer* layer)
{
m_nonCompositedContentHost->graphicsLayer()->removeAllChildren();
m_nonCompositedContentHost->invalidateEntireLayer();
if (layer)
m_nonCompositedContentHost->graphicsLayer()->addChild(layer);
+ else {
+ clearRenderSurfacesRecursive(rootLayer()->platformLayer());
+ m_nonCompositedContentHost->graphicsLayer()->platformLayer()->setLayerTreeHost(0);
+ m_rootLayer->platformLayer()->setLayerTreeHost(0);
+ }
}
void CCLayerTreeHost::setViewport(const IntSize& viewportSize, const IntSize& contentsSize, const IntPoint& scrollPosition)
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698