summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/image_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/service/image_manager.cc')
-rw-r--r--gpu/command_buffer/service/image_manager.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/image_manager.cc b/gpu/command_buffer/service/image_manager.cc
index a09af15..f39eba2 100644
--- a/gpu/command_buffer/service/image_manager.cc
+++ b/gpu/command_buffer/service/image_manager.cc
@@ -9,7 +9,7 @@
namespace gpu {
namespace gles2 {
-ImageManager::ImageManager() {
+ImageManager::ImageManager() : release_after_use_(false) {
}
ImageManager::~ImageManager() {
@@ -37,6 +37,9 @@ bool ImageManager::RegisterGpuMemoryBuffer(int32 id,
if (!gl_image)
return false;
+ if (release_after_use_)
+ gl_image->SetReleaseAfterUse();
+
AddImage(gl_image.get(), id);
return true;
}
@@ -61,5 +64,9 @@ gfx::GLImage* ImageManager::LookupImage(int32 service_id) {
return NULL;
}
+void ImageManager::SetReleaseAfterUse() {
+ release_after_use_ = true;
+}
+
} // namespace gles2
} // namespace gpu