Chromium Code Reviews| 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 "components/display_compositor/gpu_compositor_frame_sink.h" | 5 #include "components/display_compositor/gpu_compositor_frame_sink.h" |
| 6 | 6 |
| 7 #include "cc/surfaces/surface_reference.h" | 7 #include "cc/surfaces/surface_reference.h" |
| 8 | 8 |
| 9 namespace display_compositor { | 9 namespace display_compositor { |
| 10 | 10 |
| 11 GpuCompositorFrameSink::GpuCompositorFrameSink( | 11 GpuCompositorFrameSink::GpuCompositorFrameSink( |
| 12 GpuCompositorFrameSinkDelegate* delegate, | 12 GpuCompositorFrameSinkDelegate* delegate, |
| 13 cc::SurfaceManager* surface_manager, | 13 cc::SurfaceManager* surface_manager, |
| 14 const cc::FrameSinkId& frame_sink_id, | 14 const cc::FrameSinkId& frame_sink_id, |
| 15 std::unique_ptr<cc::Display> display, | 15 cc::Display* display, |
| 16 std::unique_ptr<cc::BeginFrameSource> begin_frame_source, | |
| 17 cc::mojom::MojoCompositorFrameSinkPrivateRequest | 16 cc::mojom::MojoCompositorFrameSinkPrivateRequest |
| 18 compositor_frame_sink_private_request, | 17 compositor_frame_sink_private_request, |
| 19 cc::mojom::MojoCompositorFrameSinkClientPtr client) | 18 cc::mojom::MojoCompositorFrameSinkClientPtr client) |
| 20 : delegate_(delegate), | 19 : delegate_(delegate), |
| 21 support_(this, | 20 support_(this, surface_manager, frame_sink_id, display, true, true), |
|
Fady Samuel
2017/02/07 17:42:18
Please specify what these trues mean: e.g. true /*
Alex Z.
2017/02/07 17:47:50
Done.
danakj
2017/02/07 17:47:55
can you put a comment beside these boolean literal
Alex Z.
2017/02/07 17:51:33
Done.
| |
| 22 surface_manager, | |
| 23 frame_sink_id, | |
| 24 std::move(display), | |
| 25 std::move(begin_frame_source)), | |
| 26 surface_manager_(surface_manager), | 21 surface_manager_(surface_manager), |
| 27 surface_tracker_(frame_sink_id), | 22 surface_tracker_(frame_sink_id), |
| 28 client_(std::move(client)), | 23 client_(std::move(client)), |
| 29 compositor_frame_sink_private_binding_( | 24 compositor_frame_sink_private_binding_( |
| 30 this, | 25 this, |
| 31 std::move(compositor_frame_sink_private_request)) { | 26 std::move(compositor_frame_sink_private_request)) { |
| 32 compositor_frame_sink_private_binding_.set_connection_error_handler( | 27 compositor_frame_sink_private_binding_.set_connection_error_handler( |
| 33 base::Bind(&GpuCompositorFrameSink::OnPrivateConnectionLost, | 28 base::Bind(&GpuCompositorFrameSink::OnPrivateConnectionLost, |
| 34 base::Unretained(this))); | 29 base::Unretained(this))); |
| 35 } | 30 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 } | 139 } |
| 145 | 140 |
| 146 void GpuCompositorFrameSink::OnPrivateConnectionLost() { | 141 void GpuCompositorFrameSink::OnPrivateConnectionLost() { |
| 147 private_connection_lost_ = true; | 142 private_connection_lost_ = true; |
| 148 // Request destruction of |this| only if both connections are lost. | 143 // Request destruction of |this| only if both connections are lost. |
| 149 delegate_->OnPrivateConnectionLost(support_.frame_sink_id(), | 144 delegate_->OnPrivateConnectionLost(support_.frame_sink_id(), |
| 150 client_connection_lost_); | 145 client_connection_lost_); |
| 151 } | 146 } |
| 152 | 147 |
| 153 } // namespace display_compositor | 148 } // namespace display_compositor |
| OLD | NEW |