OLD | NEW |
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // to have sync points set on them when returned from the Display, for | 79 // to have sync points set on them when returned from the Display, for |
80 // example if the Display shares a context with the creator. | 80 // example if the Display shares a context with the creator. |
81 bool needs_sync_points() const { return needs_sync_points_; } | 81 bool needs_sync_points() const { return needs_sync_points_; } |
82 void set_needs_sync_points(bool needs) { needs_sync_points_ = needs; } | 82 void set_needs_sync_points(bool needs) { needs_sync_points_ = needs; } |
83 | 83 |
84 private: | 84 private: |
85 // PendingFrameObserver implementation. | 85 // PendingFrameObserver implementation. |
86 void OnSurfaceActivated(Surface* surface) override; | 86 void OnSurfaceActivated(Surface* surface) override; |
87 void OnSurfaceDependenciesChanged( | 87 void OnSurfaceDependenciesChanged( |
88 Surface* surface, | 88 Surface* surface, |
89 const SurfaceDependencies& added_dependencies, | 89 const base::flat_set<SurfaceId>& added_dependencies, |
90 const SurfaceDependencies& removed_dependencies) override; | 90 const base::flat_set<SurfaceId>& removed_dependencies) override; |
91 void OnSurfaceDiscarded(Surface* surface) override; | 91 void OnSurfaceDiscarded(Surface* surface) override; |
92 | 92 |
93 std::unique_ptr<Surface> Create(const LocalSurfaceId& local_surface_id); | 93 std::unique_ptr<Surface> Create(const LocalSurfaceId& local_surface_id); |
94 void Destroy(std::unique_ptr<Surface> surface); | 94 void Destroy(std::unique_ptr<Surface> surface); |
95 | 95 |
96 const FrameSinkId frame_sink_id_; | 96 const FrameSinkId frame_sink_id_; |
97 SurfaceManager* manager_; | 97 SurfaceManager* manager_; |
98 SurfaceFactoryClient* client_; | 98 SurfaceFactoryClient* client_; |
99 SurfaceResourceHolder holder_; | 99 SurfaceResourceHolder holder_; |
100 bool needs_sync_points_; | 100 bool needs_sync_points_; |
101 bool seen_first_frame_activation_ = false; | 101 bool seen_first_frame_activation_ = false; |
102 std::unique_ptr<Surface> current_surface_; | 102 std::unique_ptr<Surface> current_surface_; |
103 base::WeakPtrFactory<SurfaceFactory> weak_factory_; | 103 base::WeakPtrFactory<SurfaceFactory> weak_factory_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 105 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace cc | 108 } // namespace cc |
109 | 109 |
110 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 110 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
OLD | NEW |