OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_root_compositor_frame_sink.h" | 5 #include "components/viz/frame_sinks/gpu_root_compositor_frame_sink.h" |
6 | 6 |
7 #include "cc/surfaces/compositor_frame_sink_support.h" | 7 #include "cc/surfaces/compositor_frame_sink_support.h" |
8 #include "cc/surfaces/display.h" | 8 #include "cc/surfaces/display.h" |
9 | 9 |
10 namespace viz { | 10 namespace viz { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 void GpuRootCompositorFrameSink::ReclaimResources( | 128 void GpuRootCompositorFrameSink::ReclaimResources( |
129 const cc::ReturnedResourceArray& resources) { | 129 const cc::ReturnedResourceArray& resources) { |
130 if (client_) | 130 if (client_) |
131 client_->ReclaimResources(resources); | 131 client_->ReclaimResources(resources); |
132 } | 132 } |
133 | 133 |
134 void GpuRootCompositorFrameSink::WillDrawSurface( | 134 void GpuRootCompositorFrameSink::WillDrawSurface( |
135 const cc::LocalSurfaceId& local_surface_id, | 135 const cc::LocalSurfaceId& local_surface_id, |
136 const gfx::Rect& damage_rect) { | 136 const gfx::Rect& damage_rect) {} |
137 if (client_) | |
138 client_->WillDrawSurface(local_surface_id, damage_rect); | |
139 } | |
140 | 137 |
141 void GpuRootCompositorFrameSink::OnClientConnectionLost() { | 138 void GpuRootCompositorFrameSink::OnClientConnectionLost() { |
142 client_connection_lost_ = true; | 139 client_connection_lost_ = true; |
143 // Request destruction of |this| only if both connections are lost. | 140 // Request destruction of |this| only if both connections are lost. |
144 delegate_->OnClientConnectionLost(support_->frame_sink_id(), | 141 delegate_->OnClientConnectionLost(support_->frame_sink_id(), |
145 private_connection_lost_); | 142 private_connection_lost_); |
146 } | 143 } |
147 | 144 |
148 void GpuRootCompositorFrameSink::OnPrivateConnectionLost() { | 145 void GpuRootCompositorFrameSink::OnPrivateConnectionLost() { |
149 private_connection_lost_ = true; | 146 private_connection_lost_ = true; |
150 // Request destruction of |this| only if both connections are lost. | 147 // Request destruction of |this| only if both connections are lost. |
151 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), | 148 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), |
152 client_connection_lost_); | 149 client_connection_lost_); |
153 } | 150 } |
154 | 151 |
155 } // namespace viz | 152 } // namespace viz |
OLD | NEW |