| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 cc::SharedBitmapManager* shared_bitmap_manager = nullptr; | 206 cc::SharedBitmapManager* shared_bitmap_manager = nullptr; |
| 207 | 207 |
| 208 auto task_runner = base::ThreadTaskRunnerHandle::Get(); | 208 auto task_runner = base::ThreadTaskRunnerHandle::Get(); |
| 209 auto display_output_surface = | 209 auto display_output_surface = |
| 210 base::MakeUnique<DisplayOutputSurface>(context_provider_, task_runner); | 210 base::MakeUnique<DisplayOutputSurface>(context_provider_, task_runner); |
| 211 | 211 |
| 212 std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source( | 212 std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source( |
| 213 new cc::DelayBasedBeginFrameSource( | 213 new cc::DelayBasedBeginFrameSource( |
| 214 base::MakeUnique<cc::DelayBasedTimeSource>(task_runner.get()))); | 214 base::MakeUnique<cc::DelayBasedTimeSource>(task_runner.get()))); |
| 215 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( | 215 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( |
| 216 begin_frame_source.get(), task_runner.get(), | 216 task_runner.get(), |
| 217 display_output_surface->capabilities().max_frames_pending)); | 217 display_output_surface->capabilities().max_frames_pending)); |
| 218 | 218 |
| 219 display_ = base::MakeUnique<cc::Display>( | 219 display_ = base::MakeUnique<cc::Display>( |
| 220 shared_bitmap_manager, gpu_memory_buffer_manager, | 220 shared_bitmap_manager, gpu_memory_buffer_manager, |
| 221 host_->GetSettings().renderer_settings, frame_sink_id_, | 221 host_->GetSettings().renderer_settings, frame_sink_id_, |
| 222 std::move(begin_frame_source), std::move(display_output_surface), | 222 std::move(begin_frame_source), std::move(display_output_surface), |
| 223 std::move(scheduler), | 223 std::move(scheduler), |
| 224 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner.get())); | 224 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner.get())); |
| 225 display_->SetVisible(true); | 225 display_->SetVisible(true); |
| 226 display_->Resize(viewport_size_in_px_); | 226 display_->Resize(viewport_size_in_px_); |
| 227 | 227 |
| 228 // The Browser compositor and display share the same context provider. | 228 // The Browser compositor and display share the same context provider. |
| 229 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>( | 229 auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>( |
| 230 frame_sink_id_, compositor_dependencies_->GetSurfaceManager(), | 230 frame_sink_id_, compositor_dependencies_->GetSurfaceManager(), |
| 231 display_.get(), context_provider_, nullptr, gpu_memory_buffer_manager, | 231 display_.get(), context_provider_, nullptr, gpu_memory_buffer_manager, |
| 232 shared_bitmap_manager); | 232 shared_bitmap_manager); |
| 233 | 233 |
| 234 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); | 234 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace client | 237 } // namespace client |
| 238 } // namespace blimp | 238 } // namespace blimp |
| OLD | NEW |