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 "services/ui/gpu/display_compositor/compositor_frame_sink_impl.h" | 5 #include "services/ui/gpu/display_compositor/compositor_frame_sink_impl.h" |
6 | 6 |
7 #include "cc/ipc/compositor_frame.mojom.h" | 7 #include "cc/ipc/compositor_frame.mojom.h" |
8 #include "cc/surfaces/surface_factory.h" | 8 #include "cc/surfaces/surface_factory.h" |
9 #include "services/ui/gpu/display_compositor/compositor_frame_sink_delegate.h" | 9 #include "services/ui/gpu/display_compositor/compositor_frame_sink_delegate.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 CompositorFrameSinkDelegate* delegate, | 24 CompositorFrameSinkDelegate* delegate, |
25 int sink_id, | 25 int sink_id, |
26 const scoped_refptr<SurfacesState>& surfaces_state, | 26 const scoped_refptr<SurfacesState>& surfaces_state, |
27 mojo::InterfaceRequest<mojom::CompositorFrameSink> request, | 27 mojo::InterfaceRequest<mojom::CompositorFrameSink> request, |
28 mojom::CompositorFrameSinkClientPtr client) | 28 mojom::CompositorFrameSinkClientPtr client) |
29 : delegate_(delegate), | 29 : delegate_(delegate), |
30 surfaces_state_(surfaces_state), | 30 surfaces_state_(surfaces_state), |
31 sink_id_(sink_id), | 31 sink_id_(sink_id), |
32 begin_frame_source_(nullptr), | 32 begin_frame_source_(nullptr), |
33 needs_begin_frame_(false), | 33 needs_begin_frame_(false), |
34 factory_(surfaces_state->manager(), this), | 34 factory_(sink_id, surfaces_state->manager(), this), |
35 client_(std::move(client)), | 35 client_(std::move(client)), |
36 binding_(this, std::move(request)) { | 36 binding_(this, std::move(request)) { |
37 DCHECK(delegate_); | 37 DCHECK(delegate_); |
38 binding_.set_connection_error_handler(base::Bind( | 38 binding_.set_connection_error_handler(base::Bind( |
39 &CompositorFrameSinkImpl::OnConnectionLost, base::Unretained(this))); | 39 &CompositorFrameSinkImpl::OnConnectionLost, base::Unretained(this))); |
40 } | 40 } |
41 | 41 |
42 CompositorFrameSinkImpl::~CompositorFrameSinkImpl() {} | 42 CompositorFrameSinkImpl::~CompositorFrameSinkImpl() {} |
43 | 43 |
44 void CompositorFrameSinkImpl::SetNeedsBeginFrame(bool needs_begin_frame) { | 44 void CompositorFrameSinkImpl::SetNeedsBeginFrame(bool needs_begin_frame) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 void CompositorFrameSinkImpl::OnBeginFrameSourcePausedChanged(bool paused) { | 103 void CompositorFrameSinkImpl::OnBeginFrameSourcePausedChanged(bool paused) { |
104 // TODO(fsamuel): Implement this. | 104 // TODO(fsamuel): Implement this. |
105 } | 105 } |
106 | 106 |
107 void CompositorFrameSinkImpl::OnConnectionLost() { | 107 void CompositorFrameSinkImpl::OnConnectionLost() { |
108 delegate_->CompositorFrameSinkConnectionLost(sink_id_); | 108 delegate_->CompositorFrameSinkConnectionLost(sink_id_); |
109 } | 109 } |
110 | 110 |
111 } // namespace gpu | 111 } // namespace gpu |
112 } // namespace ui | 112 } // namespace ui |
OLD | NEW |