| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get()); | 112 base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get()); |
| 113 context3d_->pushGroupMarkerEXT(unique_context_name.c_str()); | 113 context3d_->pushGroupMarkerEXT(unique_context_name.c_str()); |
| 114 | 114 |
| 115 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); | 115 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); |
| 116 context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback( | 116 context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback( |
| 117 base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged, | 117 base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged, |
| 118 base::Unretained(this))); | 118 base::Unretained(this))); |
| 119 return true; | 119 return true; |
| 120 } | 120 } |
| 121 | 121 |
| 122 blink::WebGraphicsContext3D* ContextProviderCommandBuffer::Context3d() { | |
| 123 return NULL; | |
| 124 } | |
| 125 | |
| 126 gpu::gles2::GLES2Interface* ContextProviderCommandBuffer::ContextGL() { | 122 gpu::gles2::GLES2Interface* ContextProviderCommandBuffer::ContextGL() { |
| 127 DCHECK(context3d_); | 123 DCHECK(context3d_); |
| 128 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | 124 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
| 129 DCHECK(context_thread_checker_.CalledOnValidThread()); | 125 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 130 | 126 |
| 131 return context3d_->GetImplementation(); | 127 return context3d_->GetImplementation(); |
| 132 } | 128 } |
| 133 | 129 |
| 134 gpu::ContextSupport* ContextProviderCommandBuffer::ContextSupport() { | 130 gpu::ContextSupport* ContextProviderCommandBuffer::ContextSupport() { |
| 135 return context3d_->GetContextSupport(); | 131 return context3d_->GetContextSupport(); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 230 |
| 235 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( | 231 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( |
| 236 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 232 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 237 DCHECK(context_thread_checker_.CalledOnValidThread()); | 233 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 238 DCHECK(memory_policy_changed_callback_.is_null() || | 234 DCHECK(memory_policy_changed_callback_.is_null() || |
| 239 memory_policy_changed_callback.is_null()); | 235 memory_policy_changed_callback.is_null()); |
| 240 memory_policy_changed_callback_ = memory_policy_changed_callback; | 236 memory_policy_changed_callback_ = memory_policy_changed_callback; |
| 241 } | 237 } |
| 242 | 238 |
| 243 } // namespace content | 239 } // namespace content |
| OLD | NEW |