| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/common/gpu/client/context_provider_command_buffer.h" | 5 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 lost_context_callback_proxy_.reset(); | 71 lost_context_callback_proxy_.reset(); |
| 72 | 72 |
| 73 if (leak_on_destroy_) { | 73 if (leak_on_destroy_) { |
| 74 WebGraphicsContext3DCommandBufferImpl* context3d ALLOW_UNUSED = | 74 WebGraphicsContext3DCommandBufferImpl* context3d ALLOW_UNUSED = |
| 75 context3d_.release(); | 75 context3d_.release(); |
| 76 webkit::gpu::GrContextForWebGraphicsContext3D* gr_context ALLOW_UNUSED = | 76 webkit::gpu::GrContextForWebGraphicsContext3D* gr_context ALLOW_UNUSED = |
| 77 gr_context_.release(); | 77 gr_context_.release(); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 |
| 82 CommandBufferProxyImpl* ContextProviderCommandBuffer::GetCommandBufferProxy() { |
| 83 return context3d_->GetCommandBufferProxy(); |
| 84 } |
| 85 |
| 86 int ContextProviderCommandBuffer::GetGPUProcessID() { |
| 87 return context3d_->GetGPUProcessID(); |
| 88 } |
| 89 |
| 81 bool ContextProviderCommandBuffer::BindToCurrentThread() { | 90 bool ContextProviderCommandBuffer::BindToCurrentThread() { |
| 82 // This is called on the thread the context will be used. | 91 // This is called on the thread the context will be used. |
| 83 DCHECK(context_thread_checker_.CalledOnValidThread()); | 92 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 84 | 93 |
| 85 if (lost_context_callback_proxy_) | 94 if (lost_context_callback_proxy_) |
| 86 return true; | 95 return true; |
| 87 | 96 |
| 88 if (!context3d_->makeContextCurrent()) | 97 if (!context3d_->makeContextCurrent()) |
| 89 return false; | 98 return false; |
| 90 | 99 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 229 |
| 221 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( | 230 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( |
| 222 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 231 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 223 DCHECK(context_thread_checker_.CalledOnValidThread()); | 232 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 224 DCHECK(memory_policy_changed_callback_.is_null() || | 233 DCHECK(memory_policy_changed_callback_.is_null() || |
| 225 memory_policy_changed_callback.is_null()); | 234 memory_policy_changed_callback.is_null()); |
| 226 memory_policy_changed_callback_ = memory_policy_changed_callback; | 235 memory_policy_changed_callback_ = memory_policy_changed_callback; |
| 227 } | 236 } |
| 228 | 237 |
| 229 } // namespace content | 238 } // namespace content |
| OLD | NEW |