| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 WebGraphicsContext3DCommandBufferImpl* | 133 WebGraphicsContext3DCommandBufferImpl* |
| 134 ContextProviderCommandBuffer::Context3d() { | 134 ContextProviderCommandBuffer::Context3d() { |
| 135 DCHECK(context3d_); | 135 DCHECK(context3d_); |
| 136 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | 136 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
| 137 DCHECK(context_thread_checker_.CalledOnValidThread()); | 137 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 138 | 138 |
| 139 return context3d_.get(); | 139 return context3d_.get(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 gpu::gles2::GLES2Interface* ContextProviderCommandBuffer::ContextGL() { |
| 143 DCHECK(context3d_); |
| 144 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
| 145 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 146 |
| 147 return context3d_->GetImplementation(); |
| 148 } |
| 149 |
| 142 gpu::ContextSupport* ContextProviderCommandBuffer::ContextSupport() { | 150 gpu::ContextSupport* ContextProviderCommandBuffer::ContextSupport() { |
| 143 return context3d_->GetContextSupport(); | 151 return context3d_->GetContextSupport(); |
| 144 } | 152 } |
| 145 | 153 |
| 146 class GrContext* ContextProviderCommandBuffer::GrContext() { | 154 class GrContext* ContextProviderCommandBuffer::GrContext() { |
| 147 DCHECK(context3d_); | 155 DCHECK(context3d_); |
| 148 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | 156 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
| 149 DCHECK(context_thread_checker_.CalledOnValidThread()); | 157 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 150 | 158 |
| 151 if (gr_context_) | 159 if (gr_context_) |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 318 |
| 311 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( | 319 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( |
| 312 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 320 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 313 DCHECK(context_thread_checker_.CalledOnValidThread()); | 321 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 314 DCHECK(memory_policy_changed_callback_.is_null() || | 322 DCHECK(memory_policy_changed_callback_.is_null() || |
| 315 memory_policy_changed_callback.is_null()); | 323 memory_policy_changed_callback.is_null()); |
| 316 memory_policy_changed_callback_ = memory_policy_changed_callback; | 324 memory_policy_changed_callback_ = memory_policy_changed_callback; |
| 317 } | 325 } |
| 318 | 326 |
| 319 } // namespace content | 327 } // namespace content |
| OLD | NEW |