| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "cc/output/managed_memory_policy.h" | 10 #include "cc/output/managed_memory_policy.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 DCHECK(context_thread_checker_.CalledOnValidThread()); | 150 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 151 | 151 |
| 152 if (gr_context_) | 152 if (gr_context_) |
| 153 return gr_context_->get(); | 153 return gr_context_->get(); |
| 154 | 154 |
| 155 gr_context_.reset(new GrContextForWebGraphicsContext3D(context3d_.get())); | 155 gr_context_.reset(new GrContextForWebGraphicsContext3D(context3d_.get())); |
| 156 return gr_context_->get(); | 156 return gr_context_->get(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void ContextProviderInProcess::SetupLock() { | 159 void ContextProviderInProcess::SetupLock() { |
| 160 context3d_->SetLock(&context_lock_); |
| 160 } | 161 } |
| 161 | 162 |
| 162 base::Lock* ContextProviderInProcess::GetLock() { | 163 base::Lock* ContextProviderInProcess::GetLock() { |
| 163 return nullptr; | 164 return &context_lock_; |
| 164 } | 165 } |
| 165 | 166 |
| 166 bool ContextProviderInProcess::IsContextLost() { | 167 bool ContextProviderInProcess::IsContextLost() { |
| 167 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | 168 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
| 168 DCHECK(context_thread_checker_.CalledOnValidThread()); | 169 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 169 | 170 |
| 170 return context3d_->isContextLost(); | 171 return context3d_->isContextLost(); |
| 171 } | 172 } |
| 172 | 173 |
| 173 void ContextProviderInProcess::VerifyContexts() { | 174 void ContextProviderInProcess::VerifyContexts() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 lost_context_callback_ = lost_context_callback; | 215 lost_context_callback_ = lost_context_callback; |
| 215 } | 216 } |
| 216 | 217 |
| 217 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( | 218 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( |
| 218 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 219 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 219 // There's no memory manager for the in-process implementation. | 220 // There's no memory manager for the in-process implementation. |
| 220 } | 221 } |
| 221 | 222 |
| 222 } // namespace gpu | 223 } // namespace gpu |
| 223 } // namespace webkit | 224 } // namespace webkit |
| OLD | NEW |