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 <stddef.h> | 7 #include <stddef.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 ContextProviderCommandBuffer::~ContextProviderCommandBuffer() { | 61 ContextProviderCommandBuffer::~ContextProviderCommandBuffer() { |
62 DCHECK(main_thread_checker_.CalledOnValidThread() || | 62 DCHECK(main_thread_checker_.CalledOnValidThread() || |
63 context_thread_checker_.CalledOnValidThread()); | 63 context_thread_checker_.CalledOnValidThread()); |
64 | 64 |
65 // Destroy references to the context3d_ before leaking it. | 65 // Destroy references to the context3d_ before leaking it. |
66 if (WebContext3DNoChecks()->GetCommandBufferProxy()) | 66 if (WebContext3DNoChecks()->GetCommandBufferProxy()) |
67 WebContext3DNoChecks()->GetCommandBufferProxy()->SetLock(nullptr); | 67 WebContext3DNoChecks()->GetCommandBufferProxy()->SetLock(nullptr); |
68 lost_context_callback_proxy_.reset(); | 68 lost_context_callback_proxy_.reset(); |
69 } | 69 } |
70 | 70 |
71 | 71 gpu::CommandBufferProxyImpl* |
72 CommandBufferProxyImpl* ContextProviderCommandBuffer::GetCommandBufferProxy() { | 72 ContextProviderCommandBuffer::GetCommandBufferProxy() { |
73 return WebContext3DNoChecks()->GetCommandBufferProxy(); | 73 return WebContext3DNoChecks()->GetCommandBufferProxy(); |
74 } | 74 } |
75 | 75 |
76 WebGraphicsContext3DCommandBufferImpl* | 76 WebGraphicsContext3DCommandBufferImpl* |
77 ContextProviderCommandBuffer::WebContext3D() { | 77 ContextProviderCommandBuffer::WebContext3D() { |
78 DCHECK(gr_interface_); | 78 DCHECK(gr_interface_); |
79 DCHECK(gr_interface_->WebContext3D()); | 79 DCHECK(gr_interface_->WebContext3D()); |
80 DCHECK(lost_context_callback_proxy_); // Is bound to thread. | 80 DCHECK(lost_context_callback_proxy_); // Is bound to thread. |
81 DCHECK(context_thread_checker_.CalledOnValidThread()); | 81 DCHECK(context_thread_checker_.CalledOnValidThread()); |
82 | 82 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 void ContextProviderCommandBuffer::SetLostContextCallback( | 200 void ContextProviderCommandBuffer::SetLostContextCallback( |
201 const LostContextCallback& lost_context_callback) { | 201 const LostContextCallback& lost_context_callback) { |
202 DCHECK(context_thread_checker_.CalledOnValidThread()); | 202 DCHECK(context_thread_checker_.CalledOnValidThread()); |
203 DCHECK(lost_context_callback_.is_null() || | 203 DCHECK(lost_context_callback_.is_null() || |
204 lost_context_callback.is_null()); | 204 lost_context_callback.is_null()); |
205 lost_context_callback_ = lost_context_callback; | 205 lost_context_callback_ = lost_context_callback; |
206 } | 206 } |
207 | 207 |
208 } // namespace content | 208 } // namespace content |
OLD | NEW |