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 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 void GpuCommandBufferStub::OnRegisterGpuMemoryBuffer( | 929 void GpuCommandBufferStub::OnRegisterGpuMemoryBuffer( |
930 int32 id, | 930 int32 id, |
931 gfx::GpuMemoryBufferHandle gpu_memory_buffer, | 931 gfx::GpuMemoryBufferHandle gpu_memory_buffer, |
932 uint32 width, | 932 uint32 width, |
933 uint32 height, | 933 uint32 height, |
934 uint32 internalformat) { | 934 uint32 internalformat) { |
935 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnRegisterGpuMemoryBuffer"); | 935 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnRegisterGpuMemoryBuffer"); |
936 #if defined(OS_ANDROID) | 936 #if defined(OS_ANDROID) |
937 // Verify that renderer is not trying to use a surface texture it doesn't own. | 937 // Verify that renderer is not trying to use a surface texture it doesn't own. |
938 if (gpu_memory_buffer.type == gfx::SURFACE_TEXTURE_BUFFER && | 938 if (gpu_memory_buffer.type == gfx::SURFACE_TEXTURE_BUFFER && |
939 gpu_memory_buffer.surface_texture_id.secondary_id != | 939 gpu_memory_buffer.gpu_memory_id.secondary_id != |
940 channel()->client_id()) { | 940 channel()->renderer_pid()) { |
941 LOG(ERROR) << "Illegal surface texture ID for renderer."; | 941 LOG(ERROR) << "Illegal surface texture ID for renderer."; |
942 return; | 942 return; |
943 } | 943 } |
944 #endif | 944 #endif |
945 if (gpu_control_service_) { | 945 if (gpu_control_service_) { |
946 gpu_control_service_->RegisterGpuMemoryBuffer( | 946 gpu_control_service_->RegisterGpuMemoryBuffer( |
947 id, gpu_memory_buffer, width, height, internalformat); | 947 id, gpu_memory_buffer, width, height, internalformat); |
948 } | 948 } |
949 } | 949 } |
950 | 950 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 if (decoder_) | 1046 if (decoder_) |
1047 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 1047 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
1048 command_buffer_->SetParseError(gpu::error::kLostContext); | 1048 command_buffer_->SetParseError(gpu::error::kLostContext); |
1049 } | 1049 } |
1050 | 1050 |
1051 uint64 GpuCommandBufferStub::GetMemoryUsage() const { | 1051 uint64 GpuCommandBufferStub::GetMemoryUsage() const { |
1052 return GetMemoryManager()->GetClientMemoryUsage(this); | 1052 return GetMemoryManager()->GetClientMemoryUsage(this); |
1053 } | 1053 } |
1054 | 1054 |
1055 } // namespace content | 1055 } // namespace content |
OLD | NEW |