Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/hash.h" | 9 #include "base/hash.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 939 if (!image) | 939 if (!image) |
| 940 return; | 940 return; |
| 941 | 941 |
| 942 // For Android specific workaround. | 942 // For Android specific workaround. |
| 943 if (context_group_->feature_info()->workarounds().release_image_after_use) | 943 if (context_group_->feature_info()->workarounds().release_image_after_use) |
| 944 image->SetReleaseAfterUse(); | 944 image->SetReleaseAfterUse(); |
| 945 | 945 |
| 946 if (decoder_) { | 946 if (decoder_) { |
| 947 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); | 947 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| 948 DCHECK(image_manager); | 948 DCHECK(image_manager); |
| 949 image_manager->AddImage(image.get(), id); | 949 if (!image_manager->AddImage(image.get(), id)) |
| 950 return; | |
|
reveman
2014/07/30 14:11:12
I just remembered the second reason to why I prefe
no sievers
2014/07/30 14:46:46
Normally I'd say it makes more sense to optimize i
sohanjg
2014/07/30 15:02:44
thanks :)
| |
| 950 } | 951 } |
| 951 } | 952 } |
| 952 | 953 |
| 953 void GpuCommandBufferStub::OnDestroyGpuMemoryBuffer(int32 id) { | 954 void GpuCommandBufferStub::OnDestroyGpuMemoryBuffer(int32 id) { |
| 954 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDestroyGpuMemoryBuffer"); | 955 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDestroyGpuMemoryBuffer"); |
| 955 | 956 |
| 956 if (decoder_) { | 957 if (decoder_) { |
| 957 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); | 958 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| 958 DCHECK(image_manager); | 959 DCHECK(image_manager); |
| 959 image_manager->RemoveImage(id); | 960 image_manager->RemoveImage(id); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1052 if (decoder_) | 1053 if (decoder_) |
| 1053 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 1054 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
| 1054 command_buffer_->SetParseError(gpu::error::kLostContext); | 1055 command_buffer_->SetParseError(gpu::error::kLostContext); |
| 1055 } | 1056 } |
| 1056 | 1057 |
| 1057 uint64 GpuCommandBufferStub::GetMemoryUsage() const { | 1058 uint64 GpuCommandBufferStub::GetMemoryUsage() const { |
| 1058 return GetMemoryManager()->GetClientMemoryUsage(this); | 1059 return GetMemoryManager()->GetClientMemoryUsage(this); |
| 1059 } | 1060 } |
| 1060 | 1061 |
| 1061 } // namespace content | 1062 } // namespace content |
| OLD | NEW |