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

Unified Diff: Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

Issue 7749028: Compositor leaks all resources if tab is closed and it's not the last in the process (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 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
Index: Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp (revision 93831)
+++ Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp (working copy)
@@ -187,6 +187,21 @@
cleanupSharedObjects();
}
+void LayerRendererChromium::clearRenderSurfacesOnCCLayerImplRecursive(CCLayerImpl* layer)
+{
+ for (size_t i = 0; i < layer->children().size(); ++i)
+ clearRenderSurfacesOnCCLayerImplRecursive(layer->children()[i].get());
+ layer->clearRenderSurface();
+}
+
+void LayerRendererChromium::clearRootCCLayerImpl()
+{
+ if (m_rootCCLayerImpl)
+ clearRenderSurfacesOnCCLayerImplRecursive(m_rootCCLayerImpl.get());
+ m_computedRenderSurfaceLayerList.clear();
+ m_rootCCLayerImpl.clear();
+}
+
GraphicsContext3D* LayerRendererChromium::context()
{
return m_context.get();
@@ -602,6 +617,8 @@
m_rootLayer = layer;
if (m_rootLayer)
m_rootLayer->setLayerRenderer(this);
+ else
+ clearRootCCLayerImpl();
m_rootLayerContentTiler->invalidateEntireLayer();
}
@@ -1313,15 +1330,17 @@
m_sharedGeometry.clear();
m_borderProgram.clear();
- m_canvasLayerProgram.clear();
m_headsUpDisplayProgram.clear();
- m_videoLayerRGBAProgram.clear();
- m_videoLayerYUVProgram.clear();
- m_pluginLayerProgram.clear();
m_renderSurfaceProgram.clear();
m_renderSurfaceMaskProgram.clear();
m_tilerProgram.clear();
m_tilerProgramSwizzle.clear();
+ m_tilerProgramAA.clear();
+ m_tilerProgramSwizzleAA.clear();
+ m_canvasLayerProgram.clear();
+ m_videoLayerRGBAProgram.clear();
+ m_videoLayerYUVProgram.clear();
+ m_pluginLayerProgram.clear();
if (m_offscreenFramebufferId)
GLC(m_context.get(), m_context->deleteFramebuffer(m_offscreenFramebufferId));

Powered by Google App Engine
This is Rietveld 408576698