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