Index: Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp |
=================================================================== |
--- Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp (revision 116981) |
+++ Source/WebCore/platform/graphics/chromium/TextureLayerChromium.cpp (working copy) |
@@ -54,8 +54,12 @@ |
TextureLayerChromium::~TextureLayerChromium() |
{ |
- if (m_rateLimitContext && m_client && layerTreeHost()) |
- layerTreeHost()->stopRateLimiter(m_client->context()); |
+ if (layerTreeHost()) { |
+ if (m_textureId) |
+ layerTreeHost()->acquireLayerTextures(); |
+ if (m_rateLimitContext && m_client) |
+ layerTreeHost()->stopRateLimiter(m_client->context()); |
+ } |
} |
PassOwnPtr<CCLayerImpl> TextureLayerChromium::createCCLayerImpl() |
@@ -91,6 +95,10 @@ |
void TextureLayerChromium::setTextureId(unsigned id) |
{ |
+ if (m_textureId == id) |
+ return; |
+ if (m_textureId && layerTreeHost()) |
+ layerTreeHost()->acquireLayerTextures(); |
m_textureId = id; |
setNeedsCommit(); |
} |
@@ -103,6 +111,13 @@ |
layerTreeHost()->startRateLimiter(m_client->context()); |
} |
+void TextureLayerChromium::setLayerTreeHost(CCLayerTreeHost* host) |
+{ |
+ if (m_textureId && layerTreeHost() && host != layerTreeHost()) |
+ layerTreeHost()->acquireLayerTextures(); |
+ LayerChromium::setLayerTreeHost(host); |
+} |
+ |
bool TextureLayerChromium::drawsContent() const |
{ |
return (m_client || m_textureId) && !m_contextLost && LayerChromium::drawsContent(); |