| 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 "webkit/common/gpu/context_provider_in_process.h" | 5 #include "webkit/common/gpu/context_provider_in_process.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 DCHECK(context_thread_checker_.CalledOnValidThread()); | 140 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 141 | 141 |
| 142 if (gr_context_) | 142 if (gr_context_) |
| 143 return gr_context_->get(); | 143 return gr_context_->get(); |
| 144 | 144 |
| 145 gr_context_.reset( | 145 gr_context_.reset( |
| 146 new webkit::gpu::GrContextForWebGraphicsContext3D(context3d_.get())); | 146 new webkit::gpu::GrContextForWebGraphicsContext3D(context3d_.get())); |
| 147 return gr_context_->get(); | 147 return gr_context_->get(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void ContextProviderInProcess::MakeGrContextCurrent() { | |
| 151 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | |
| 152 DCHECK(context_thread_checker_.CalledOnValidThread()); | |
| 153 DCHECK(gr_context_); | |
| 154 | |
| 155 context3d_->makeContextCurrent(); | |
| 156 } | |
| 157 | |
| 158 bool ContextProviderInProcess::IsContextLost() { | 150 bool ContextProviderInProcess::IsContextLost() { |
| 159 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | 151 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
| 160 DCHECK(context_thread_checker_.CalledOnValidThread()); | 152 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 161 | 153 |
| 162 return context3d_->isContextLost(); | 154 return context3d_->isContextLost(); |
| 163 } | 155 } |
| 164 | 156 |
| 165 void ContextProviderInProcess::VerifyContexts() { | 157 void ContextProviderInProcess::VerifyContexts() { |
| 166 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | 158 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
| 167 DCHECK(context_thread_checker_.CalledOnValidThread()); | 159 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 197 lost_context_callback_ = lost_context_callback; | 189 lost_context_callback_ = lost_context_callback; |
| 198 } | 190 } |
| 199 | 191 |
| 200 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( | 192 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( |
| 201 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 193 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 202 // There's no memory manager for the in-process implementation. | 194 // There's no memory manager for the in-process implementation. |
| 203 } | 195 } |
| 204 | 196 |
| 205 } // namespace gpu | 197 } // namespace gpu |
| 206 } // namespace webkit | 198 } // namespace webkit |
| OLD | NEW |