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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.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: review comment addressed. Created 6 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
« no previous file with comments | « no previous file | content/common/gpu/stream_texture_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 189215122af0bff2aeb71e88d7364c1a7ad0fe21..f002bb105f2c0ba73d3cf2da534ab99b17114c3b 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -946,6 +946,10 @@ void GpuCommandBufferStub::OnRegisterGpuMemoryBuffer(
if (decoder_) {
gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
DCHECK(image_manager);
+ if (image_manager->LookupImage(id)) {
+ LOG(ERROR) << "Image already exists with same ID.";
+ return;
+ }
image_manager->AddImage(image.get(), id);
}
}
@@ -956,6 +960,10 @@ void GpuCommandBufferStub::OnDestroyGpuMemoryBuffer(int32 id) {
if (decoder_) {
gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
DCHECK(image_manager);
+ if (!image_manager->LookupImage(id)) {
+ LOG(ERROR) << "Image with ID doesn't exist.";
no sievers 2014/07/28 17:38:25 nit: maybe the checks here and above fit better in
reveman 2014/07/28 18:00:00 I suggested we check this here and just DCHECK in
sohanjg 2014/07/30 10:30:26 sievers@ should we take the checks back to imagema
+ return;
+ }
image_manager->RemoveImage(id);
}
}
« no previous file with comments | « no previous file | content/common/gpu/stream_texture_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698