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

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

Issue 2716553004: Add temporary reference ownership to SurfaceManager. (Closed)
Patch Set: Cleanup. Created 3 years, 10 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
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 #include <vector> 9 #include <vector>
10 10
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 surface_factory_.ClearSurface(); 173 surface_factory_.ClearSurface();
174 } 174 }
175 175
176 void CompositorFrameSinkSupport::ReferencedSurfacesChanged( 176 void CompositorFrameSinkSupport::ReferencedSurfacesChanged(
177 const LocalSurfaceId& local_surface_id, 177 const LocalSurfaceId& local_surface_id,
178 const std::vector<SurfaceId>* active_referenced_surfaces, 178 const std::vector<SurfaceId>* active_referenced_surfaces,
179 const std::vector<SurfaceId>* pending_referenced_surfaces) { 179 const std::vector<SurfaceId>* pending_referenced_surfaces) {
180 if (!surface_manager_->using_surface_references()) 180 if (!surface_manager_->using_surface_references())
181 return; 181 return;
182 182
183 SurfaceId last_surface_id = reference_tracker_.current_surface_id();
Fady Samuel 2017/02/24 18:10:14 Why did you move this?
kylechar 2017/02/24 19:28:01 The order was backwards. Moved change to https://c
184
183 // Populate list of surface references to add and remove based on reference 185 // Populate list of surface references to add and remove based on reference
184 // surfaces in current frame compared with the last frame. The list of 186 // surfaces in current frame compared with the last frame. The list of
185 // surface references includes references from both the pending and active 187 // surface references includes references from both the pending and active
186 // frame if any. 188 // frame if any.
187 reference_tracker_.UpdateReferences(local_surface_id, 189 reference_tracker_.UpdateReferences(local_surface_id,
188 active_referenced_surfaces, 190 active_referenced_surfaces,
189 pending_referenced_surfaces); 191 pending_referenced_surfaces);
190 192
191 SurfaceId last_surface_id = reference_tracker_.current_surface_id();
192 UpdateSurfaceReferences(last_surface_id, local_surface_id); 193 UpdateSurfaceReferences(last_surface_id, local_surface_id);
193 } 194 }
194 195
195 void CompositorFrameSinkSupport::ReturnResources( 196 void CompositorFrameSinkSupport::ReturnResources(
196 const ReturnedResourceArray& resources) { 197 const ReturnedResourceArray& resources) {
197 if (resources.empty()) 198 if (resources.empty())
198 return; 199 return;
199 200
200 if (!ack_pending_count_ && client_) { 201 if (!ack_pending_count_ && client_) {
201 client_->ReclaimResources(resources); 202 client_->ReclaimResources(resources);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 else 251 else
251 begin_frame_source_->RemoveObserver(this); 252 begin_frame_source_->RemoveObserver(this);
252 } 253 }
253 254
254 void CompositorFrameSinkSupport::RequestCopyOfSurface( 255 void CompositorFrameSinkSupport::RequestCopyOfSurface(
255 std::unique_ptr<CopyOutputRequest> request) { 256 std::unique_ptr<CopyOutputRequest> request) {
256 surface_factory_.RequestCopyOfSurface(std::move(request)); 257 surface_factory_.RequestCopyOfSurface(std::move(request));
257 } 258 }
258 259
259 } // namespace cc 260 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/compositor_frame_sink_support_unittest.cc » ('j') | cc/surfaces/surface_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698