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

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

Issue 2811813004: Surface Synchronization: Distinguish between dependencies and references (Closed)
Patch Set: Addressed Vlad's comments 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
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // call back into here and access |client_| so we should destroy 53 // call back into here and access |client_| so we should destroy
54 // |surface_factory_|'s resources early on. 54 // |surface_factory_|'s resources early on.
55 surface_factory_.EvictSurface(); 55 surface_factory_.EvictSurface();
56 surface_manager_->UnregisterSurfaceFactoryClient(frame_sink_id_); 56 surface_manager_->UnregisterSurfaceFactoryClient(frame_sink_id_);
57 if (handles_frame_sink_id_invalidation_) 57 if (handles_frame_sink_id_invalidation_)
58 surface_manager_->InvalidateFrameSinkId(frame_sink_id_); 58 surface_manager_->InvalidateFrameSinkId(frame_sink_id_);
59 } 59 }
60 60
61 void CompositorFrameSinkSupport::ReferencedSurfacesChanged( 61 void CompositorFrameSinkSupport::ReferencedSurfacesChanged(
62 const LocalSurfaceId& local_surface_id, 62 const LocalSurfaceId& local_surface_id,
63 const std::vector<SurfaceId>* active_referenced_surfaces, 63 const std::vector<SurfaceId>* active_referenced_surfaces) {
64 const std::vector<SurfaceId>* pending_referenced_surfaces) {
65 if (!surface_manager_->using_surface_references()) 64 if (!surface_manager_->using_surface_references())
66 return; 65 return;
67 66
68 SurfaceId last_surface_id = reference_tracker_.current_surface_id(); 67 SurfaceId last_surface_id = reference_tracker_.current_surface_id();
69 68
70 // Populate list of surface references to add and remove based on reference 69 // Populate list of surface references to add and remove based on reference
71 // surfaces in current frame compared with the last frame. The list of 70 // surfaces in current frame compared with the last frame. The list of
72 // surface references includes references from both the pending and active 71 // surface references includes references from both the pending and active
73 // frame if any. 72 // frame if any.
74 reference_tracker_.UpdateReferences(local_surface_id, 73 reference_tracker_.UpdateReferences(local_surface_id,
75 active_referenced_surfaces, 74 active_referenced_surfaces);
76 pending_referenced_surfaces);
77 75
78 UpdateSurfaceReferences(last_surface_id, local_surface_id); 76 UpdateSurfaceReferences(last_surface_id, local_surface_id);
79 } 77 }
80 78
81 void CompositorFrameSinkSupport::ReturnResources( 79 void CompositorFrameSinkSupport::ReturnResources(
82 const ReturnedResourceArray& resources) { 80 const ReturnedResourceArray& resources) {
83 if (resources.empty()) 81 if (resources.empty())
84 return; 82 return;
85 83
86 if (!ack_pending_count_ && client_) { 84 if (!ack_pending_count_ && client_) {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 else 259 else
262 begin_frame_source_->RemoveObserver(this); 260 begin_frame_source_->RemoveObserver(this);
263 } 261 }
264 262
265 void CompositorFrameSinkSupport::RequestCopyOfSurface( 263 void CompositorFrameSinkSupport::RequestCopyOfSurface(
266 std::unique_ptr<CopyOutputRequest> request) { 264 std::unique_ptr<CopyOutputRequest> request) {
267 surface_factory_.RequestCopyOfSurface(std::move(request)); 265 surface_factory_.RequestCopyOfSurface(std::move(request));
268 } 266 }
269 267
270 } // namespace cc 268 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698