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

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

Issue 2714973002: Fix check for changing SurfaceId. (Closed)
Patch Set: Add test for display root references. Created 3 years, 9 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 | « no previous file | cc/surfaces/compositor_frame_sink_support_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 #include <vector> 9 #include <vector>
10 10
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 surface_factory_.ClearSurface(); 151 surface_factory_.ClearSurface();
152 } 152 }
153 153
154 void CompositorFrameSinkSupport::ReferencedSurfacesChanged( 154 void CompositorFrameSinkSupport::ReferencedSurfacesChanged(
155 const LocalSurfaceId& local_surface_id, 155 const LocalSurfaceId& local_surface_id,
156 const std::vector<SurfaceId>* active_referenced_surfaces, 156 const std::vector<SurfaceId>* active_referenced_surfaces,
157 const std::vector<SurfaceId>* pending_referenced_surfaces) { 157 const std::vector<SurfaceId>* pending_referenced_surfaces) {
158 if (!surface_manager_->using_surface_references()) 158 if (!surface_manager_->using_surface_references())
159 return; 159 return;
160 160
161 SurfaceId last_surface_id = reference_tracker_.current_surface_id();
162
161 // Populate list of surface references to add and remove based on reference 163 // Populate list of surface references to add and remove based on reference
162 // surfaces in current frame compared with the last frame. The list of 164 // surfaces in current frame compared with the last frame. The list of
163 // surface references includes references from both the pending and active 165 // surface references includes references from both the pending and active
164 // frame if any. 166 // frame if any.
165 reference_tracker_.UpdateReferences(local_surface_id, 167 reference_tracker_.UpdateReferences(local_surface_id,
166 active_referenced_surfaces, 168 active_referenced_surfaces,
167 pending_referenced_surfaces); 169 pending_referenced_surfaces);
168 170
169 SurfaceId last_surface_id = reference_tracker_.current_surface_id();
170 UpdateSurfaceReferences(last_surface_id, local_surface_id); 171 UpdateSurfaceReferences(last_surface_id, local_surface_id);
171 } 172 }
172 173
173 void CompositorFrameSinkSupport::ReturnResources( 174 void CompositorFrameSinkSupport::ReturnResources(
174 const ReturnedResourceArray& resources) { 175 const ReturnedResourceArray& resources) {
175 if (resources.empty()) 176 if (resources.empty())
176 return; 177 return;
177 178
178 if (!ack_pending_count_ && client_) { 179 if (!ack_pending_count_ && client_) {
179 client_->ReclaimResources(resources); 180 client_->ReclaimResources(resources);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 else 229 else
229 begin_frame_source_->RemoveObserver(this); 230 begin_frame_source_->RemoveObserver(this);
230 } 231 }
231 232
232 void CompositorFrameSinkSupport::RequestCopyOfSurface( 233 void CompositorFrameSinkSupport::RequestCopyOfSurface(
233 std::unique_ptr<CopyOutputRequest> request) { 234 std::unique_ptr<CopyOutputRequest> request) {
234 surface_factory_.RequestCopyOfSurface(std::move(request)); 235 surface_factory_.RequestCopyOfSurface(std::move(request));
235 } 236 }
236 237
237 } // namespace cc 238 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/compositor_frame_sink_support_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698