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

Unified Diff: gpu/command_buffer/service/image_manager.cc

Issue 301793003: During image destroy, delete textures only if we have a GL context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change destroy flow for all GLImage types. Created 6 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: gpu/command_buffer/service/image_manager.cc
diff --git a/gpu/command_buffer/service/image_manager.cc b/gpu/command_buffer/service/image_manager.cc
index a3ac4350c875fabb11f6e53375bfeef68d158e6f..c3bf760853a57a37020db8bca38249dd52fffb35 100644
--- a/gpu/command_buffer/service/image_manager.cc
+++ b/gpu/command_buffer/service/image_manager.cc
@@ -15,6 +15,13 @@ ImageManager::ImageManager() : release_after_use_(false) {
ImageManager::~ImageManager() {
}
+void ImageManager::Destroy(bool have_context) {
+ for (GLImageMap::const_iterator iter = gl_images_.begin();
+ iter != gl_images_.end();
+ ++iter)
+ iter->second.get()->Destroy(have_context);
+}
sohanjg 2014/06/02 13:59:42 If we clear the hash map here, we would need to en
reveman 2014/06/02 14:34:47 I'm not following. How can this cause a leak?
+
void ImageManager::RegisterGpuMemoryBuffer(int32 id,
gfx::GpuMemoryBufferHandle buffer,
size_t width,

Powered by Google App Engine
This is Rietveld 408576698