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)); |