| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 DCHECK(main_thread_checker_.CalledOnValidThread()); | 70 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 71 DCHECK(context3d_); | 71 DCHECK(context3d_); |
| 72 context_thread_checker_.DetachFromThread(); | 72 context_thread_checker_.DetachFromThread(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 ContextProviderInProcess::~ContextProviderInProcess() { | 75 ContextProviderInProcess::~ContextProviderInProcess() { |
| 76 DCHECK(main_thread_checker_.CalledOnValidThread() || | 76 DCHECK(main_thread_checker_.CalledOnValidThread() || |
| 77 context_thread_checker_.CalledOnValidThread()); | 77 context_thread_checker_.CalledOnValidThread()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 blink::WebGraphicsContext3D* ContextProviderInProcess::WebContext3D() { | |
| 81 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | |
| 82 DCHECK(context_thread_checker_.CalledOnValidThread()); | |
| 83 | |
| 84 return context3d_.get(); | |
| 85 } | |
| 86 | |
| 87 bool ContextProviderInProcess::BindToCurrentThread() { | 80 bool ContextProviderInProcess::BindToCurrentThread() { |
| 88 DCHECK(context3d_); | 81 DCHECK(context3d_); |
| 89 | 82 |
| 90 // This is called on the thread the context will be used. | 83 // This is called on the thread the context will be used. |
| 91 DCHECK(context_thread_checker_.CalledOnValidThread()); | 84 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 92 | 85 |
| 93 if (lost_context_callback_proxy_) | 86 if (lost_context_callback_proxy_) |
| 94 return true; | 87 return true; |
| 95 | 88 |
| 96 if (!context3d_->makeContextCurrent()) | 89 if (!context3d_->makeContextCurrent()) |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 lost_context_callback_ = lost_context_callback; | 197 lost_context_callback_ = lost_context_callback; |
| 205 } | 198 } |
| 206 | 199 |
| 207 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( | 200 void ContextProviderInProcess::SetMemoryPolicyChangedCallback( |
| 208 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 201 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 209 // There's no memory manager for the in-process implementation. | 202 // There's no memory manager for the in-process implementation. |
| 210 } | 203 } |
| 211 | 204 |
| 212 } // namespace gpu | 205 } // namespace gpu |
| 213 } // namespace webkit | 206 } // namespace webkit |
| OLD | NEW |