| 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 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // Disconnect lost callbacks during destruction. | 104 // Disconnect lost callbacks during destruction. |
| 105 gles2_impl_->SetLostContextCallback(base::Closure()); | 105 gles2_impl_->SetLostContextCallback(base::Closure()); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 gpu::CommandBufferProxyImpl* | 109 gpu::CommandBufferProxyImpl* |
| 110 ContextProviderCommandBuffer::GetCommandBufferProxy() { | 110 ContextProviderCommandBuffer::GetCommandBufferProxy() { |
| 111 return command_buffer_.get(); | 111 return command_buffer_.get(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 uint32_t ContextProviderCommandBuffer::GetCopyTextureInternalFormat() { |
| 115 if (attributes_.alpha_size > 0) |
| 116 return GL_RGBA; |
| 117 DCHECK_NE(attributes_.red_size, 0); |
| 118 DCHECK_NE(attributes_.green_size, 0); |
| 119 DCHECK_NE(attributes_.blue_size, 0); |
| 120 return GL_RGB; |
| 121 } |
| 122 |
| 114 bool ContextProviderCommandBuffer::BindToCurrentThread() { | 123 bool ContextProviderCommandBuffer::BindToCurrentThread() { |
| 115 // This is called on the thread the context will be used. | 124 // This is called on the thread the context will be used. |
| 116 DCHECK(context_thread_checker_.CalledOnValidThread()); | 125 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 117 | 126 |
| 118 if (bind_failed_) | 127 if (bind_failed_) |
| 119 return false; | 128 return false; |
| 120 if (bind_succeeded_) | 129 if (bind_succeeded_) |
| 121 return true; | 130 return true; |
| 122 | 131 |
| 123 // Early outs should report failure. | 132 // Early outs should report failure. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 337 |
| 329 void ContextProviderCommandBuffer::SetLostContextCallback( | 338 void ContextProviderCommandBuffer::SetLostContextCallback( |
| 330 const LostContextCallback& lost_context_callback) { | 339 const LostContextCallback& lost_context_callback) { |
| 331 DCHECK(context_thread_checker_.CalledOnValidThread()); | 340 DCHECK(context_thread_checker_.CalledOnValidThread()); |
| 332 DCHECK(lost_context_callback_.is_null() || | 341 DCHECK(lost_context_callback_.is_null() || |
| 333 lost_context_callback.is_null()); | 342 lost_context_callback.is_null()); |
| 334 lost_context_callback_ = lost_context_callback; | 343 lost_context_callback_ = lost_context_callback; |
| 335 } | 344 } |
| 336 | 345 |
| 337 } // namespace content | 346 } // namespace content |
| OLD | NEW |