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/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 return; | 976 return; |
977 } | 977 } |
978 | 978 |
979 GpuChannelManager* manager = channel_->gpu_channel_manager(); | 979 GpuChannelManager* manager = channel_->gpu_channel_manager(); |
980 scoped_refptr<gfx::GLImage> image = | 980 scoped_refptr<gfx::GLImage> image = |
981 manager->gpu_memory_buffer_factory()->CreateImageForGpuMemoryBuffer( | 981 manager->gpu_memory_buffer_factory()->CreateImageForGpuMemoryBuffer( |
982 handle, | 982 handle, |
983 gfx::Size(width, height), | 983 gfx::Size(width, height), |
984 internalformat, | 984 internalformat, |
985 channel()->client_id()); | 985 channel()->client_id()); |
986 if (!image) | 986 if (!image.get()) |
987 return; | 987 return; |
988 | 988 |
989 // For Android specific workaround. | 989 // For Android specific workaround. |
990 if (context_group_->feature_info()->workarounds().release_image_after_use) | 990 if (context_group_->feature_info()->workarounds().release_image_after_use) |
991 image->SetReleaseAfterUse(); | 991 image->SetReleaseAfterUse(); |
992 | 992 |
993 image_manager->AddImage(image.get(), id); | 993 image_manager->AddImage(image.get(), id); |
994 } | 994 } |
995 | 995 |
996 void GpuCommandBufferStub::OnUnregisterGpuMemoryBuffer(int32 id) { | 996 void GpuCommandBufferStub::OnUnregisterGpuMemoryBuffer(int32 id) { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 if (decoder_) | 1101 if (decoder_) |
1102 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 1102 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
1103 command_buffer_->SetParseError(gpu::error::kLostContext); | 1103 command_buffer_->SetParseError(gpu::error::kLostContext); |
1104 } | 1104 } |
1105 | 1105 |
1106 uint64 GpuCommandBufferStub::GetMemoryUsage() const { | 1106 uint64 GpuCommandBufferStub::GetMemoryUsage() const { |
1107 return GetMemoryManager()->GetClientMemoryUsage(this); | 1107 return GetMemoryManager()->GetClientMemoryUsage(this); |
1108 } | 1108 } |
1109 | 1109 |
1110 } // namespace content | 1110 } // namespace content |
OLD | NEW |