| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/support/compositor/blimp_embedder_compositor.h" | 5 #include "blimp/client/support/compositor/blimp_embedder_compositor.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source( | 210 std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source( |
| 211 new cc::DelayBasedBeginFrameSource( | 211 new cc::DelayBasedBeginFrameSource( |
| 212 base::MakeUnique<cc::DelayBasedTimeSource>(task_runner.get()))); | 212 base::MakeUnique<cc::DelayBasedTimeSource>(task_runner.get()))); |
| 213 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( | 213 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( |
| 214 begin_frame_source.get(), task_runner.get(), | 214 begin_frame_source.get(), task_runner.get(), |
| 215 display_output_surface->capabilities().max_frames_pending)); | 215 display_output_surface->capabilities().max_frames_pending)); |
| 216 | 216 |
| 217 display_ = base::MakeUnique<cc::Display>( | 217 display_ = base::MakeUnique<cc::Display>( |
| 218 shared_bitmap_manager, gpu_memory_buffer_manager, | 218 shared_bitmap_manager, gpu_memory_buffer_manager, |
| 219 host_->GetSettings().renderer_settings, std::move(begin_frame_source), | 219 host_->GetSettings().renderer_settings, frame_sink_id_, |
| 220 std::move(display_output_surface), std::move(scheduler), | 220 std::move(begin_frame_source), std::move(display_output_surface), |
| 221 std::move(scheduler), |
| 221 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner.get())); | 222 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner.get())); |
| 222 display_->SetVisible(true); | 223 display_->SetVisible(true); |
| 223 display_->Resize(viewport_size_in_px_); | 224 display_->Resize(viewport_size_in_px_); |
| 224 | 225 |
| 225 // The Browser compositor and display share the same context provider. | 226 // The Browser compositor and display share the same context provider. |
| 226 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>( | 227 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>( |
| 227 frame_sink_id_, compositor_dependencies_->GetSurfaceManager(), | 228 frame_sink_id_, compositor_dependencies_->GetSurfaceManager(), |
| 228 display_.get(), context_provider_, nullptr, gpu_memory_buffer_manager, | 229 display_.get(), context_provider_, nullptr, gpu_memory_buffer_manager, |
| 229 shared_bitmap_manager); | 230 shared_bitmap_manager); |
| 230 | 231 |
| 231 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); | 232 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
| 232 } | 233 } |
| 233 | 234 |
| 234 } // namespace client | 235 } // namespace client |
| 235 } // namespace blimp | 236 } // namespace blimp |
| OLD | NEW |