Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2795683003: [cc]Replace use of SurfaceFactory with CompositorFrameSinkSupport in tests (Closed)
Patch Set: Update returned_resources_ in FakeCompositorFrameSinkSupportClient::DidReceiveCompositorFrameAck Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/BUILD.gn ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/surfaces/compositor_frame_sink_support.h" 5 #include "cc/surfaces/compositor_frame_sink_support.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 reference_tracker_.UpdateReferences(local_surface_id, 67 reference_tracker_.UpdateReferences(local_surface_id,
68 active_referenced_surfaces); 68 active_referenced_surfaces);
69 69
70 UpdateSurfaceReferences(last_surface_id, local_surface_id); 70 UpdateSurfaceReferences(last_surface_id, local_surface_id);
71 } 71 }
72 72
73 void CompositorFrameSinkSupport::ReturnResources( 73 void CompositorFrameSinkSupport::ReturnResources(
74 const ReturnedResourceArray& resources) { 74 const ReturnedResourceArray& resources) {
75 if (resources.empty()) 75 if (resources.empty())
76 return; 76 return;
77
78 if (!ack_pending_count_ && client_) { 77 if (!ack_pending_count_ && client_) {
79 client_->ReclaimResources(resources); 78 client_->ReclaimResources(resources);
80 return; 79 return;
81 } 80 }
82 81
83 std::copy(resources.begin(), resources.end(), 82 std::copy(resources.begin(), resources.end(),
84 std::back_inserter(surface_returned_resources_)); 83 std::back_inserter(surface_returned_resources_));
85 } 84 }
86 85
87 void CompositorFrameSinkSupport::SetBeginFrameSource( 86 void CompositorFrameSinkSupport::SetBeginFrameSource(
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 begin_frame_source_->RemoveObserver(this); 272 begin_frame_source_->RemoveObserver(this);
274 } 273 }
275 274
276 void CompositorFrameSinkSupport::RequestCopyOfSurface( 275 void CompositorFrameSinkSupport::RequestCopyOfSurface(
277 std::unique_ptr<CopyOutputRequest> request) { 276 std::unique_ptr<CopyOutputRequest> request) {
278 DCHECK(surface_factory_); 277 DCHECK(surface_factory_);
279 surface_factory_->RequestCopyOfSurface(std::move(request)); 278 surface_factory_->RequestCopyOfSurface(std::move(request));
280 } 279 }
281 280
282 } // namespace cc 281 } // namespace cc
OLDNEW
« no previous file with comments | « cc/BUILD.gn ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698