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

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

Issue 10690121: Merge 121076 - [chromium] LayerRendererChromium is not getting visibility messages in single thread… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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/TrackingTextureAllocator.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.cpp (revision 122257)
+++ Source/WebCore/platform/graphics/chromium/TrackingTextureAllocator.cpp (working copy)
@@ -89,6 +89,7 @@
extensions->texStorage2DEXT(GraphicsContext3D::TEXTURE_2D, 1, storageFormat, size.width(), size.height());
} else
GLC(m_context.get(), m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, format, size.width(), size.height(), 0, format, GraphicsContext3D::UNSIGNED_BYTE));
+ m_allocatedTextureIds.add(textureId);
return textureId;
}
@@ -96,7 +97,17 @@
{
m_currentMemoryUseBytes -= TextureManager::memoryUseBytes(size, format);
GLC(m_context.get(), m_context->deleteTexture(textureId));
+ ASSERT(m_allocatedTextureIds.contains(textureId));
+ m_allocatedTextureIds.remove(textureId);
}
+void TrackingTextureAllocator::deleteAllTextures()
+{
+ for (HashSet<unsigned>::const_iterator it = m_allocatedTextureIds.begin(); it != m_allocatedTextureIds.end(); ++it)
+ GLC(m_context.get(), m_context->deleteTexture(*it));
+ m_currentMemoryUseBytes = 0;
+ m_allocatedTextureIds.clear();
}
+}
+

Powered by Google App Engine
This is Rietveld 408576698