| 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 "services/ui/surfaces/display_compositor.h" | 5 #include "services/ui/surfaces/display_compositor.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 DCHECK(thread_checker_.CalledOnValidThread()); | 99 DCHECK(thread_checker_.CalledOnValidThread()); |
| 100 DCHECK_NE(surface_handle, gpu::kNullSurfaceHandle); | 100 DCHECK_NE(surface_handle, gpu::kNullSurfaceHandle); |
| 101 DCHECK_EQ(0u, compositor_frame_sinks_.count(frame_sink_id)); | 101 DCHECK_EQ(0u, compositor_frame_sinks_.count(frame_sink_id)); |
| 102 | 102 |
| 103 std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source( | 103 std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source( |
| 104 new cc::DelayBasedBeginFrameSource( | 104 new cc::DelayBasedBeginFrameSource( |
| 105 base::MakeUnique<cc::DelayBasedTimeSource>(task_runner_.get()))); | 105 base::MakeUnique<cc::DelayBasedTimeSource>(task_runner_.get()))); |
| 106 std::unique_ptr<cc::Display> display = | 106 std::unique_ptr<cc::Display> display = |
| 107 CreateDisplay(frame_sink_id, surface_handle, begin_frame_source.get()); | 107 CreateDisplay(frame_sink_id, surface_handle, begin_frame_source.get()); |
| 108 | 108 |
| 109 if (!manager_.lock_manager()) { |
| 110 std::unique_ptr<cc::DisplayCompositorLockManager> lock_manager( |
| 111 new cc::DisplayCompositorLockManager(&manager_, |
| 112 begin_frame_source.get())); |
| 113 manager_.SetLockManager(std::move(lock_manager)); |
| 114 } |
| 115 |
| 109 compositor_frame_sinks_[frame_sink_id] = | 116 compositor_frame_sinks_[frame_sink_id] = |
| 110 base::MakeUnique<GpuDisplayCompositorFrameSink>( | 117 base::MakeUnique<GpuDisplayCompositorFrameSink>( |
| 111 this, frame_sink_id, std::move(display), | 118 this, frame_sink_id, std::move(display), |
| 112 std::move(begin_frame_source), std::move(request), | 119 std::move(begin_frame_source), std::move(request), |
| 113 std::move(private_request), std::move(client), | 120 std::move(private_request), std::move(client), |
| 114 std::move(display_private_request)); | 121 std::move(display_private_request)); |
| 115 } | 122 } |
| 116 | 123 |
| 117 void DisplayCompositor::CreateOffscreenCompositorFrameSink( | 124 void DisplayCompositor::CreateOffscreenCompositorFrameSink( |
| 118 const cc::FrameSinkId& frame_sink_id, | 125 const cc::FrameSinkId& frame_sink_id, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 DCHECK_GT(surface_info.device_scale_factor(), 0.0f); | 186 DCHECK_GT(surface_info.device_scale_factor(), 0.0f); |
| 180 | 187 |
| 181 if (client_) | 188 if (client_) |
| 182 client_->OnSurfaceCreated(surface_info); | 189 client_->OnSurfaceCreated(surface_info); |
| 183 } | 190 } |
| 184 | 191 |
| 185 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, | 192 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, |
| 186 bool* changed) {} | 193 bool* changed) {} |
| 187 | 194 |
| 188 } // namespace ui | 195 } // namespace ui |
| OLD | NEW |