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

Side by Side Diff: cc/surfaces/surface_manager.h

Issue 2687433002: Move surface reference code to CompositorFrameSinkSupport. (Closed)
Patch Set: Revert to patch 2 to reland. 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CC_SURFACES_SURFACE_MANAGER_H_ 5 #ifndef CC_SURFACES_SURFACE_MANAGER_H_
6 #define CC_SURFACES_SURFACE_MANAGER_H_ 6 #define CC_SURFACES_SURFACE_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 void AddSurfaceReferences(const std::vector<SurfaceReference>& references); 149 void AddSurfaceReferences(const std::vector<SurfaceReference>& references);
150 150
151 // Removes all surface references in |references| then runs garbage 151 // Removes all surface references in |references| then runs garbage
152 // collection to delete unreachable surfaces. 152 // collection to delete unreachable surfaces.
153 void RemoveSurfaceReferences(const std::vector<SurfaceReference>& references); 153 void RemoveSurfaceReferences(const std::vector<SurfaceReference>& references);
154 154
155 scoped_refptr<SurfaceReferenceFactory> reference_factory() { 155 scoped_refptr<SurfaceReferenceFactory> reference_factory() {
156 return reference_factory_; 156 return reference_factory_;
157 } 157 }
158 158
159 bool using_surface_references() const {
160 return lifetime_type_ == LifetimeType::REFERENCES;
161 }
162
159 private: 163 private:
160 friend class SurfaceManagerRefTest; 164 friend class SurfaceManagerRefTest;
161 165
162 using SurfaceIdSet = std::unordered_set<SurfaceId, SurfaceIdHash>; 166 using SurfaceIdSet = std::unordered_set<SurfaceId, SurfaceIdHash>;
163 167
164 void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id, 168 void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id,
165 BeginFrameSource* source); 169 BeginFrameSource* source);
166 void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id, 170 void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id,
167 BeginFrameSource* source); 171 BeginFrameSource* source);
168 172
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; 277 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_;
274 278
275 base::WeakPtrFactory<SurfaceManager> weak_factory_; 279 base::WeakPtrFactory<SurfaceManager> weak_factory_;
276 280
277 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); 281 DISALLOW_COPY_AND_ASSIGN(SurfaceManager);
278 }; 282 };
279 283
280 } // namespace cc 284 } // namespace cc
281 285
282 #endif // CC_SURFACES_SURFACE_MANAGER_H_ 286 #endif // CC_SURFACES_SURFACE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/surfaces/referenced_surface_tracker.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