Chromium Code Reviews| 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_) { |
|
reveman
2014/07/30 15:16:04
What if this check fails? That will cause the imag
sohanjg
2014/07/30 15:34:44
Acknowledged.
|
| gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| DCHECK(image_manager); |
| + if (image_manager->LookupImage(id)) { |
| + LOG(ERROR) << "Image already exists with same ID."; |
| + return; |
|
no sievers
2014/07/30 15:11:27
Now you can move 949-952 to before line 932.
sohanjg
2014/07/30 15:34:44
Done.
|
| + } |
|
reveman
2014/07/30 15:16:06
This check needs to happen before CreateImageForGp
sohanjg
2014/07/30 15:34:44
Done.
|
| image_manager->AddImage(image.get(), id); |
| } |
| } |
| @@ -956,6 +960,10 @@ void GpuCommandBufferStub::OnDestroyGpuMemoryBuffer(int32 id) { |
| if (decoder_) { |
|
reveman
2014/07/30 15:16:05
depending on what you do in the function above you
sohanjg
2014/07/30 15:34:44
Done.
|
| gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| DCHECK(image_manager); |
| + if (!image_manager->LookupImage(id)) { |
| + LOG(ERROR) << "Image with ID doesn't exist."; |
| + return; |
| + } |
| image_manager->RemoveImage(id); |
| } |
| } |