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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void GpuCompositorFrameSink::ReclaimResources( | 79 void GpuCompositorFrameSink::ReclaimResources( |
80 const cc::ReturnedResourceArray& resources) { | 80 const cc::ReturnedResourceArray& resources) { |
81 if (client_) | 81 if (client_) |
82 client_->ReclaimResources(resources); | 82 client_->ReclaimResources(resources); |
83 } | 83 } |
84 | 84 |
85 void GpuCompositorFrameSink::WillDrawSurface( | 85 void GpuCompositorFrameSink::WillDrawSurface( |
86 const cc::LocalSurfaceId& local_surface_id, | 86 const cc::LocalSurfaceId& local_surface_id, |
87 const gfx::Rect& damage_rect) {} | 87 const gfx::Rect& damage_rect) {} |
88 | 88 |
| 89 void GpuCompositorFrameSink::DidRejectCompositorFrame() { |
| 90 compositor_frame_sink_binding_.Close(); |
| 91 client_connection_lost_ = true; |
| 92 } |
| 93 |
89 void GpuCompositorFrameSink::OnClientConnectionLost() { | 94 void GpuCompositorFrameSink::OnClientConnectionLost() { |
90 client_connection_lost_ = true; | 95 client_connection_lost_ = true; |
91 // Request destruction of |this| only if both connections are lost. | 96 // Request destruction of |this| only if both connections are lost. |
92 delegate_->OnClientConnectionLost(support_->frame_sink_id(), | 97 delegate_->OnClientConnectionLost(support_->frame_sink_id(), |
93 private_connection_lost_); | 98 private_connection_lost_); |
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 |