| 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/display_compositor/gpu_compositor_frame_sink.h" | 5 #include "components/display_compositor/gpu_compositor_frame_sink.h" |
| 6 | 6 |
| 7 #include "cc/surfaces/surface_reference.h" | 7 #include "cc/surfaces/surface_reference.h" |
| 8 | 8 |
| 9 namespace display_compositor { | 9 namespace display_compositor { |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 if (client_) | 69 if (client_) |
| 70 client_->OnBeginFrame(args); | 70 client_->OnBeginFrame(args); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void GpuCompositorFrameSink::ReclaimResources( | 73 void GpuCompositorFrameSink::ReclaimResources( |
| 74 const cc::ReturnedResourceArray& resources) { | 74 const cc::ReturnedResourceArray& resources) { |
| 75 if (client_) | 75 if (client_) |
| 76 client_->ReclaimResources(resources); | 76 client_->ReclaimResources(resources); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void GpuCompositorFrameSink::WillDrawSurface() { | 79 void GpuCompositorFrameSink::WillDrawSurface( |
| 80 const cc::LocalSurfaceId& local_surface_id, |
| 81 const gfx::Rect& damage_rect) { |
| 80 if (client_) | 82 if (client_) |
| 81 client_->WillDrawSurface(); | 83 client_->WillDrawSurface(local_surface_id, damage_rect); |
| 82 } | 84 } |
| 83 | 85 |
| 84 void GpuCompositorFrameSink::OnClientConnectionLost() { | 86 void GpuCompositorFrameSink::OnClientConnectionLost() { |
| 85 client_connection_lost_ = true; | 87 client_connection_lost_ = true; |
| 86 // Request destruction of |this| only if both connections are lost. | 88 // Request destruction of |this| only if both connections are lost. |
| 87 delegate_->OnClientConnectionLost(support_->frame_sink_id(), | 89 delegate_->OnClientConnectionLost(support_->frame_sink_id(), |
| 88 private_connection_lost_); | 90 private_connection_lost_); |
| 89 } | 91 } |
| 90 | 92 |
| 91 void GpuCompositorFrameSink::OnPrivateConnectionLost() { | 93 void GpuCompositorFrameSink::OnPrivateConnectionLost() { |
| 92 private_connection_lost_ = true; | 94 private_connection_lost_ = true; |
| 93 // Request destruction of |this| only if both connections are lost. | 95 // Request destruction of |this| only if both connections are lost. |
| 94 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), | 96 delegate_->OnPrivateConnectionLost(support_->frame_sink_id(), |
| 95 client_connection_lost_); | 97 client_connection_lost_); |
| 96 } | 98 } |
| 97 | 99 |
| 98 } // namespace display_compositor | 100 } // namespace display_compositor |
| OLD | NEW |