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

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

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 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_FACTORY_H_ 5 #ifndef CC_SURFACES_SURFACE_FACTORY_H_
6 #define CC_SURFACES_SURFACE_FACTORY_H_ 6 #define CC_SURFACES_SURFACE_FACTORY_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 Surface* current_surface_for_testing() { return current_surface_.get(); } 78 Surface* current_surface_for_testing() { return current_surface_.get(); }
79 79
80 // This can be set to false if resources from this SurfaceFactory don't need 80 // This can be set to false if resources from this SurfaceFactory don't need
81 // to have sync points set on them when returned from the Display, for 81 // to have sync points set on them when returned from the Display, for
82 // example if the Display shares a context with the creator. 82 // example if the Display shares a context with the creator.
83 bool needs_sync_points() const { return needs_sync_points_; } 83 bool needs_sync_points() const { return needs_sync_points_; }
84 void set_needs_sync_points(bool needs) { needs_sync_points_ = needs; } 84 void set_needs_sync_points(bool needs) { needs_sync_points_ = needs; }
85 85
86 private: 86 private:
87 // PendingFrameObserver implementation. 87 // PendingFrameObserver implementation.
88 void OnReferencedSurfacesChanged(
89 Surface* surface,
90 const std::vector<SurfaceId>* active_referenced_surfaces,
91 const std::vector<SurfaceId>* pending_referenced_surfaces) override;
92 void OnSurfaceActivated(Surface* surface) override; 88 void OnSurfaceActivated(Surface* surface) override;
93 void OnSurfaceDependenciesChanged( 89 void OnSurfaceDependenciesChanged(
94 Surface* surface, 90 Surface* surface,
95 const SurfaceDependencies& added_dependencies, 91 const SurfaceDependencies& added_dependencies,
96 const SurfaceDependencies& removed_dependencies) override; 92 const SurfaceDependencies& removed_dependencies) override;
97 void OnSurfaceDiscarded(Surface* surface) override; 93 void OnSurfaceDiscarded(Surface* surface) override;
98 94
99 std::unique_ptr<Surface> Create(const LocalSurfaceId& local_surface_id); 95 std::unique_ptr<Surface> Create(const LocalSurfaceId& local_surface_id);
100 void Destroy(std::unique_ptr<Surface> surface); 96 void Destroy(std::unique_ptr<Surface> surface);
101 97
102 const FrameSinkId frame_sink_id_; 98 const FrameSinkId frame_sink_id_;
103 SurfaceManager* manager_; 99 SurfaceManager* manager_;
104 SurfaceFactoryClient* client_; 100 SurfaceFactoryClient* client_;
105 SurfaceResourceHolder holder_; 101 SurfaceResourceHolder holder_;
106 bool needs_sync_points_; 102 bool needs_sync_points_;
107 bool seen_first_frame_activation_ = false; 103 bool seen_first_frame_activation_ = false;
108 std::unique_ptr<Surface> current_surface_; 104 std::unique_ptr<Surface> current_surface_;
109 base::WeakPtrFactory<SurfaceFactory> weak_factory_; 105 base::WeakPtrFactory<SurfaceFactory> weak_factory_;
110 106
111 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); 107 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory);
112 }; 108 };
113 109
114 } // namespace cc 110 } // namespace cc
115 111
116 #endif // CC_SURFACES_SURFACE_FACTORY_H_ 112 #endif // CC_SURFACES_SURFACE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698