| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "cc/test/test_compositor_frame_sink.h" | 5 #include "cc/test/test_compositor_frame_sink.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 void TestCompositorFrameSink::ForceReclaimResources() { | 160 void TestCompositorFrameSink::ForceReclaimResources() { |
| 161 if (capabilities_.can_force_reclaim_resources && | 161 if (capabilities_.can_force_reclaim_resources && |
| 162 delegated_local_surface_id_.is_valid()) { | 162 delegated_local_surface_id_.is_valid()) { |
| 163 support_->ForceReclaimResources(); | 163 support_->ForceReclaimResources(); |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 | 166 |
| 167 void TestCompositorFrameSink::DidReceiveCompositorFrameAck() { | 167 void TestCompositorFrameSink::DidReceiveCompositorFrameAck( |
| 168 const ReturnedResourceArray& resources) { |
| 169 ReclaimResources(resources); |
| 168 // In synchronous mode, we manually send acks and this method should not be | 170 // In synchronous mode, we manually send acks and this method should not be |
| 169 // used. | 171 // used. |
| 170 if (!display_->has_scheduler()) | 172 if (!display_->has_scheduler()) |
| 171 return; | 173 return; |
| 172 client_->DidReceiveCompositorFrameAck(); | 174 client_->DidReceiveCompositorFrameAck(); |
| 173 } | 175 } |
| 174 | 176 |
| 175 void TestCompositorFrameSink::OnBeginFrame(const BeginFrameArgs& args) { | 177 void TestCompositorFrameSink::OnBeginFrame(const BeginFrameArgs& args) { |
| 176 external_begin_frame_source_.OnBeginFrame(args); | 178 external_begin_frame_source_.OnBeginFrame(args); |
| 177 } | 179 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 203 support_->SetNeedsBeginFrame(needs_begin_frames); | 205 support_->SetNeedsBeginFrame(needs_begin_frames); |
| 204 } | 206 } |
| 205 | 207 |
| 206 void TestCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) {} | 208 void TestCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) {} |
| 207 | 209 |
| 208 void TestCompositorFrameSink::SendCompositorFrameAckToClient() { | 210 void TestCompositorFrameSink::SendCompositorFrameAckToClient() { |
| 209 client_->DidReceiveCompositorFrameAck(); | 211 client_->DidReceiveCompositorFrameAck(); |
| 210 } | 212 } |
| 211 | 213 |
| 212 } // namespace cc | 214 } // namespace cc |
| OLD | NEW |