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/viz/frame_sinks/gpu_compositor_frame_sink.h" | 5 #include "components/viz/frame_sinks/gpu_compositor_frame_sink.h" |
6 | 6 |
7 namespace viz { | 7 namespace viz { |
8 | 8 |
9 GpuCompositorFrameSink::GpuCompositorFrameSink( | 9 GpuCompositorFrameSink::GpuCompositorFrameSink( |
10 GpuCompositorFrameSinkDelegate* delegate, | 10 GpuCompositorFrameSinkDelegate* delegate, |
(...skipping 16 matching lines...) Expand all Loading... |
27 compositor_frame_sink_private_binding_( | 27 compositor_frame_sink_private_binding_( |
28 this, | 28 this, |
29 std::move(compositor_frame_sink_private_request)) { | 29 std::move(compositor_frame_sink_private_request)) { |
30 compositor_frame_sink_binding_.set_connection_error_handler(base::Bind( | 30 compositor_frame_sink_binding_.set_connection_error_handler(base::Bind( |
31 &GpuCompositorFrameSink::OnClientConnectionLost, base::Unretained(this))); | 31 &GpuCompositorFrameSink::OnClientConnectionLost, base::Unretained(this))); |
32 compositor_frame_sink_private_binding_.set_connection_error_handler( | 32 compositor_frame_sink_private_binding_.set_connection_error_handler( |
33 base::Bind(&GpuCompositorFrameSink::OnPrivateConnectionLost, | 33 base::Bind(&GpuCompositorFrameSink::OnPrivateConnectionLost, |
34 base::Unretained(this))); | 34 base::Unretained(this))); |
35 } | 35 } |
36 | 36 |
37 GpuCompositorFrameSink::~GpuCompositorFrameSink() {} | 37 GpuCompositorFrameSink::~GpuCompositorFrameSink() = default; |
38 | |
39 void GpuCompositorFrameSink::EvictCurrentSurface() { | |
40 support_->EvictCurrentSurface(); | |
41 } | |
42 | 38 |
43 void GpuCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) { | 39 void GpuCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) { |
44 support_->SetNeedsBeginFrame(needs_begin_frame); | 40 support_->SetNeedsBeginFrame(needs_begin_frame); |
45 } | 41 } |
46 | 42 |
47 void GpuCompositorFrameSink::SubmitCompositorFrame( | 43 void GpuCompositorFrameSink::SubmitCompositorFrame( |
48 const cc::LocalSurfaceId& local_surface_id, | 44 const cc::LocalSurfaceId& local_surface_id, |
49 cc::CompositorFrame frame) { | 45 cc::CompositorFrame frame) { |
50 if (!support_->SubmitCompositorFrame(local_surface_id, std::move(frame))) { | 46 if (!support_->SubmitCompositorFrame(local_surface_id, std::move(frame))) { |
51 compositor_frame_sink_binding_.Close(); | 47 compositor_frame_sink_binding_.Close(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 93 } |
98 | 94 |
99 void GpuCompositorFrameSink::OnPrivateConnectionLost() { | 95 void GpuCompositorFrameSink::OnPrivateConnectionLost() { |
100 private_connection_lost_ = true; | 96 private_connection_lost_ = true; |
101 // Request destruction of |this| only if both connections are lost. | 97 // Request destruction of |this| only if both connections are lost. |
102 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), | 98 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), |
103 client_connection_lost_); | 99 client_connection_lost_); |
104 } | 100 } |
105 | 101 |
106 } // namespace viz | 102 } // namespace viz |
OLD | NEW |