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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 base::AutoLock hold(shared_providers_->lock); | 143 base::AutoLock hold(shared_providers_->lock); |
144 | 144 |
145 if (!shared_providers_->list.empty()) { | 145 if (!shared_providers_->list.empty()) { |
146 shared_context_provider = shared_providers_->list.front(); | 146 shared_context_provider = shared_providers_->list.front(); |
147 shared_command_buffer = shared_context_provider->command_buffer_.get(); | 147 shared_command_buffer = shared_context_provider->command_buffer_.get(); |
148 share_group = shared_context_provider->gles2_impl_->share_group(); | 148 share_group = shared_context_provider->gles2_impl_->share_group(); |
149 DCHECK_EQ(!!shared_command_buffer, !!share_group); | 149 DCHECK_EQ(!!shared_command_buffer, !!share_group); |
150 } | 150 } |
151 | 151 |
152 DCHECK(attributes_.buffer_preserved); | |
153 | |
154 // This command buffer is a client-side proxy to the command buffer in the | 152 // This command buffer is a client-side proxy to the command buffer in the |
155 // GPU process. | 153 // GPU process. |
156 scoped_refptr<base::SingleThreadTaskRunner> task_runner = | 154 scoped_refptr<base::SingleThreadTaskRunner> task_runner = |
157 default_task_runner_; | 155 default_task_runner_; |
158 if (!task_runner) | 156 if (!task_runner) |
159 task_runner = base::ThreadTaskRunnerHandle::Get(); | 157 task_runner = base::ThreadTaskRunnerHandle::Get(); |
160 command_buffer_ = gpu::CommandBufferProxyImpl::Create( | 158 command_buffer_ = gpu::CommandBufferProxyImpl::Create( |
161 std::move(channel_), surface_handle_, shared_command_buffer, stream_id_, | 159 std::move(channel_), surface_handle_, shared_command_buffer, stream_id_, |
162 stream_priority_, attributes_, active_url_, std::move(task_runner)); | 160 stream_priority_, attributes_, active_url_, std::move(task_runner)); |
163 if (!command_buffer_) { | 161 if (!command_buffer_) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 331 |
334 void ContextProviderCommandBuffer::SetLostContextCallback( | 332 void ContextProviderCommandBuffer::SetLostContextCallback( |
335 const LostContextCallback& lost_context_callback) { | 333 const LostContextCallback& lost_context_callback) { |
336 DCHECK(context_thread_checker_.CalledOnValidThread()); | 334 DCHECK(context_thread_checker_.CalledOnValidThread()); |
337 DCHECK(lost_context_callback_.is_null() || | 335 DCHECK(lost_context_callback_.is_null() || |
338 lost_context_callback.is_null()); | 336 lost_context_callback.is_null()); |
339 lost_context_callback_ = lost_context_callback; | 337 lost_context_callback_ = lost_context_callback; |
340 } | 338 } |
341 | 339 |
342 } // namespace content | 340 } // namespace content |
OLD | NEW |