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

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

Issue 2715663007: Implement temporary reference assignment with DisplayCompositor. (Closed)
Patch Set: Rebase. 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
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>
10 9
11 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
12 #include "cc/scheduler/begin_frame_source.h" 11 #include "cc/scheduler/begin_frame_source.h"
13 #include "cc/surfaces/compositor_frame_sink_support_client.h" 12 #include "cc/surfaces/compositor_frame_sink_support_client.h"
14 #include "cc/surfaces/display.h" 13 #include "cc/surfaces/display.h"
15 #include "cc/surfaces/surface.h" 14 #include "cc/surfaces/surface.h"
16 #include "cc/surfaces/surface_manager.h" 15 #include "cc/surfaces/surface_manager.h"
17 #include "cc/surfaces/surface_reference.h" 16 #include "cc/surfaces/surface_reference.h"
18 17
19 namespace cc { 18 namespace cc {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (!surface_returned_resources_.empty()) { 133 if (!surface_returned_resources_.empty()) {
135 client_->ReclaimResources(surface_returned_resources_); 134 client_->ReclaimResources(surface_returned_resources_);
136 surface_returned_resources_.clear(); 135 surface_returned_resources_.clear();
137 } 136 }
138 } 137 }
139 138
140 void CompositorFrameSinkSupport::ForceReclaimResources() { 139 void CompositorFrameSinkSupport::ForceReclaimResources() {
141 surface_factory_.ClearSurface(); 140 surface_factory_.ClearSurface();
142 } 141 }
143 142
143 void CompositorFrameSinkSupport::ClaimTemporaryReference(
144 const SurfaceId& surface_id) {
145 surface_manager_->AssignTemporaryReference(surface_id, frame_sink_id_);
146 }
147
144 void CompositorFrameSinkSupport::ReferencedSurfacesChanged( 148 void CompositorFrameSinkSupport::ReferencedSurfacesChanged(
145 const LocalSurfaceId& local_surface_id, 149 const LocalSurfaceId& local_surface_id,
146 const std::vector<SurfaceId>* active_referenced_surfaces, 150 const std::vector<SurfaceId>* active_referenced_surfaces,
147 const std::vector<SurfaceId>* pending_referenced_surfaces) { 151 const std::vector<SurfaceId>* pending_referenced_surfaces) {
148 if (!surface_manager_->using_surface_references()) 152 if (!surface_manager_->using_surface_references())
149 return; 153 return;
150 154
151 SurfaceId last_surface_id = reference_tracker_.current_surface_id(); 155 SurfaceId last_surface_id = reference_tracker_.current_surface_id();
152 156
153 // Populate list of surface references to add and remove based on reference 157 // Populate list of surface references to add and remove based on reference
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 else 223 else
220 begin_frame_source_->RemoveObserver(this); 224 begin_frame_source_->RemoveObserver(this);
221 } 225 }
222 226
223 void CompositorFrameSinkSupport::RequestCopyOfSurface( 227 void CompositorFrameSinkSupport::RequestCopyOfSurface(
224 std::unique_ptr<CopyOutputRequest> request) { 228 std::unique_ptr<CopyOutputRequest> request) {
225 surface_factory_.RequestCopyOfSurface(std::move(request)); 229 surface_factory_.RequestCopyOfSurface(std::move(request));
226 } 230 }
227 231
228 } // namespace cc 232 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.h ('k') | components/display_compositor/gpu_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698