| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "cc/base/switches.h" | 11 #include "cc/base/switches.h" |
| 12 #include "cc/scheduler/begin_frame_source.h" | 12 #include "cc/scheduler/begin_frame_source.h" |
| 13 #include "cc/surfaces/display.h" | 13 #include "cc/surfaces/display.h" |
| 14 #include "cc/surfaces/surface_dependency_tracker.h" | 14 #include "cc/surfaces/surface_dependency_tracker.h" |
| 15 #include "components/display_compositor/gpu_compositor_frame_sink.h" | 15 #include "components/display_compositor/gpu_compositor_frame_sink.h" |
| 16 #include "components/display_compositor/gpu_root_compositor_frame_sink.h" | 16 #include "components/display_compositor/gpu_root_compositor_frame_sink.h" |
| 17 #include "services/ui/surfaces/display_provider.h" | 17 #include "services/ui/surfaces/display_provider.h" |
| 18 | 18 |
| 19 namespace ui { | 19 namespace ui { |
| 20 | 20 |
| 21 DisplayCompositor::DisplayCompositor( | 21 DisplayCompositor::DisplayCompositor( |
| 22 DisplayProvider* display_provider, | 22 DisplayProvider* display_provider, |
| 23 cc::mojom::DisplayCompositorRequest request, | 23 cc::mojom::DisplayCompositorRequest request, |
| 24 cc::mojom::DisplayCompositorClientPtr client) | 24 cc::mojom::DisplayCompositorClientPtr client) |
| 25 : manager_(cc::SurfaceManager::LifetimeType::REFERENCES), | 25 : manager_(cc::SurfaceManager::LifetimeType::SEQUENCES), |
| 26 display_provider_(display_provider), | 26 display_provider_(display_provider), |
| 27 client_(std::move(client)), | 27 client_(std::move(client)), |
| 28 binding_(this, std::move(request)) { | 28 binding_(this, std::move(request)) { |
| 29 manager_.AddObserver(this); | 29 manager_.AddObserver(this); |
| 30 } | 30 } |
| 31 | 31 |
| 32 DisplayCompositor::~DisplayCompositor() { | 32 DisplayCompositor::~DisplayCompositor() { |
| 33 DCHECK(thread_checker_.CalledOnValidThread()); | 33 DCHECK(thread_checker_.CalledOnValidThread()); |
| 34 manager_.RemoveObserver(this); | 34 manager_.RemoveObserver(this); |
| 35 } | 35 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 void DisplayCompositor::OnPrivateConnectionLost( | 135 void DisplayCompositor::OnPrivateConnectionLost( |
| 136 const cc::FrameSinkId& frame_sink_id, | 136 const cc::FrameSinkId& frame_sink_id, |
| 137 bool destroy_compositor_frame_sink) { | 137 bool destroy_compositor_frame_sink) { |
| 138 DCHECK(thread_checker_.CalledOnValidThread()); | 138 DCHECK(thread_checker_.CalledOnValidThread()); |
| 139 if (destroy_compositor_frame_sink) | 139 if (destroy_compositor_frame_sink) |
| 140 DestroyCompositorFrameSink(frame_sink_id); | 140 DestroyCompositorFrameSink(frame_sink_id); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace ui | 143 } // namespace ui |
| OLD | NEW |