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 29 matching lines...) Expand all Loading... | |
40 support_->EvictCurrentSurface(); | 40 support_->EvictCurrentSurface(); |
41 } | 41 } |
42 | 42 |
43 void GpuCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) { | 43 void GpuCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) { |
44 support_->SetNeedsBeginFrame(needs_begin_frame); | 44 support_->SetNeedsBeginFrame(needs_begin_frame); |
45 } | 45 } |
46 | 46 |
47 void GpuCompositorFrameSink::SubmitCompositorFrame( | 47 void GpuCompositorFrameSink::SubmitCompositorFrame( |
48 const cc::LocalSurfaceId& local_surface_id, | 48 const cc::LocalSurfaceId& local_surface_id, |
49 cc::CompositorFrame frame) { | 49 cc::CompositorFrame frame) { |
50 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); | 50 bool result = |
danakj
2017/05/19 19:31:39
it's okay to keep this without the bool var, I thi
| |
51 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); | |
52 if (!result) { | |
53 compositor_frame_sink_binding_.Close(); | |
54 OnClientConnectionLost(); | |
55 } | |
51 } | 56 } |
52 | 57 |
53 void GpuCompositorFrameSink::BeginFrameDidNotSwap( | 58 void GpuCompositorFrameSink::BeginFrameDidNotSwap( |
54 const cc::BeginFrameAck& begin_frame_ack) { | 59 const cc::BeginFrameAck& begin_frame_ack) { |
55 support_->BeginFrameDidNotSwap(begin_frame_ack); | 60 support_->BeginFrameDidNotSwap(begin_frame_ack); |
56 } | 61 } |
57 | 62 |
58 void GpuCompositorFrameSink::DidReceiveCompositorFrameAck( | 63 void GpuCompositorFrameSink::DidReceiveCompositorFrameAck( |
59 const cc::ReturnedResourceArray& resources) { | 64 const cc::ReturnedResourceArray& resources) { |
60 if (client_) | 65 if (client_) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 } | 99 } |
95 | 100 |
96 void GpuCompositorFrameSink::OnPrivateConnectionLost() { | 101 void GpuCompositorFrameSink::OnPrivateConnectionLost() { |
97 private_connection_lost_ = true; | 102 private_connection_lost_ = true; |
98 // Request destruction of |this| only if both connections are lost. | 103 // Request destruction of |this| only if both connections are lost. |
99 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), | 104 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), |
100 client_connection_lost_); | 105 client_connection_lost_); |
101 } | 106 } |
102 | 107 |
103 } // namespace viz | 108 } // namespace viz |
OLD | NEW |