| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/core/compositor/blimp_compositor.h" | 5 #include "blimp/client/core/compositor/blimp_compositor.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // Try again if the context creation failed. | 234 // Try again if the context creation failed. |
| 235 if (!compositor_context_provider) { | 235 if (!compositor_context_provider) { |
| 236 GetEmbedderDeps()->GetContextProviders( | 236 GetEmbedderDeps()->GetContextProviders( |
| 237 base::Bind(&BlimpCompositor::OnContextProvidersCreated, | 237 base::Bind(&BlimpCompositor::OnContextProvidersCreated, |
| 238 weak_ptr_factory_.GetWeakPtr())); | 238 weak_ptr_factory_.GetWeakPtr())); |
| 239 return; | 239 return; |
| 240 } | 240 } |
| 241 | 241 |
| 242 auto compositor_frame_sink = base::MakeUnique<BlimpCompositorFrameSink>( | 242 auto compositor_frame_sink = base::MakeUnique<BlimpCompositorFrameSink>( |
| 243 std::move(compositor_context_provider), | 243 std::move(compositor_context_provider), |
| 244 std::move(worker_context_provider), base::ThreadTaskRunnerHandle::Get(), | 244 std::move(worker_context_provider), |
| 245 weak_ptr_factory_.GetWeakPtr()); | 245 GetEmbedderDeps()->GetGpuMemoryBufferManager(), nullptr, |
| 246 base::ThreadTaskRunnerHandle::Get(), weak_ptr_factory_.GetWeakPtr()); |
| 246 | 247 |
| 247 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); | 248 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
| 248 } | 249 } |
| 249 | 250 |
| 250 void BlimpCompositor::BindToProxyClient( | 251 void BlimpCompositor::BindToProxyClient( |
| 251 base::WeakPtr<BlimpCompositorFrameSinkProxyClient> proxy_client) { | 252 base::WeakPtr<BlimpCompositorFrameSinkProxyClient> proxy_client) { |
| 252 DCHECK(thread_checker_.CalledOnValidThread()); | 253 DCHECK(thread_checker_.CalledOnValidThread()); |
| 253 DCHECK(!surface_factory_); | 254 DCHECK(!surface_factory_); |
| 254 | 255 |
| 255 proxy_client_ = proxy_client; | 256 proxy_client_ = proxy_client; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } | 357 } |
| 357 | 358 |
| 358 void BlimpCompositor::CreateLayerTreeHost() { | 359 void BlimpCompositor::CreateLayerTreeHost() { |
| 359 DCHECK(!host_); | 360 DCHECK(!host_); |
| 360 VLOG(1) << "Creating LayerTreeHost."; | 361 VLOG(1) << "Creating LayerTreeHost."; |
| 361 | 362 |
| 362 // Create the LayerTreeHost | 363 // Create the LayerTreeHost |
| 363 cc::LayerTreeHostInProcess::InitParams params; | 364 cc::LayerTreeHostInProcess::InitParams params; |
| 364 params.client = this; | 365 params.client = this; |
| 365 params.task_graph_runner = compositor_dependencies_->GetTaskGraphRunner(); | 366 params.task_graph_runner = compositor_dependencies_->GetTaskGraphRunner(); |
| 366 params.gpu_memory_buffer_manager = | |
| 367 GetEmbedderDeps()->GetGpuMemoryBufferManager(); | |
| 368 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 367 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
| 369 if (!use_threaded_layer_tree_host_) { | 368 if (!use_threaded_layer_tree_host_) { |
| 370 params.image_serialization_processor = | 369 params.image_serialization_processor = |
| 371 compositor_dependencies_->GetImageSerializationProcessor(); | 370 compositor_dependencies_->GetImageSerializationProcessor(); |
| 372 } | 371 } |
| 373 | 372 |
| 374 cc::LayerTreeSettings* settings = | 373 cc::LayerTreeSettings* settings = |
| 375 compositor_dependencies_->GetLayerTreeSettings(); | 374 compositor_dependencies_->GetLayerTreeSettings(); |
| 376 params.settings = settings; | 375 params.settings = settings; |
| 377 | 376 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 it->second.Run(); | 415 it->second.Run(); |
| 417 it = pending_commit_trackers_.erase(it); | 416 it = pending_commit_trackers_.erase(it); |
| 418 } else { | 417 } else { |
| 419 ++it; | 418 ++it; |
| 420 } | 419 } |
| 421 } | 420 } |
| 422 } | 421 } |
| 423 | 422 |
| 424 } // namespace client | 423 } // namespace client |
| 425 } // namespace blimp | 424 } // namespace blimp |
| OLD | NEW |