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

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

Issue 10384160: Merge 116722 - Sync with impl thread when removing references to external textures (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 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/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();

Powered by Google App Engine
This is Rietveld 408576698