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_H_ | 5 #ifndef CC_SURFACES_SURFACE_H_ |
6 #define CC_SURFACES_SURFACE_H_ | 6 #define CC_SURFACES_SURFACE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 size_t GetDestructionDependencyCount() const { | 107 size_t GetDestructionDependencyCount() const { |
108 return destruction_dependencies_.size(); | 108 return destruction_dependencies_.size(); |
109 } | 109 } |
110 | 110 |
111 const std::vector<SurfaceId>* active_referenced_surfaces() const { | 111 const std::vector<SurfaceId>* active_referenced_surfaces() const { |
112 return active_frame_data_ | 112 return active_frame_data_ |
113 ? &active_frame_data_->frame.metadata.referenced_surfaces | 113 ? &active_frame_data_->frame.metadata.referenced_surfaces |
114 : nullptr; | 114 : nullptr; |
115 } | 115 } |
116 | 116 |
117 const SurfaceDependencies& blocking_surfaces() const { | 117 const base::flat_set<SurfaceId>& blocking_surfaces() const { |
118 return blocking_surfaces_; | 118 return blocking_surfaces_; |
119 } | 119 } |
120 | 120 |
121 bool HasActiveFrame() const { return active_frame_data_.has_value(); } | 121 bool HasActiveFrame() const { return active_frame_data_.has_value(); } |
122 bool HasPendingFrame() const { return pending_frame_data_.has_value(); } | 122 bool HasPendingFrame() const { return pending_frame_data_.has_value(); } |
123 | 123 |
124 bool destroyed() const { return destroyed_; } | 124 bool destroyed() const { return destroyed_; } |
125 void set_destroyed(bool destroyed) { destroyed_ = destroyed; } | 125 void set_destroyed(bool destroyed) { destroyed_ = destroyed; } |
126 | 126 |
127 private: | 127 private: |
(...skipping 28 matching lines...) Expand all Loading... |
156 SurfaceId surface_id_; | 156 SurfaceId surface_id_; |
157 SurfaceId previous_frame_surface_id_; | 157 SurfaceId previous_frame_surface_id_; |
158 base::WeakPtr<SurfaceFactory> factory_; | 158 base::WeakPtr<SurfaceFactory> factory_; |
159 | 159 |
160 base::Optional<FrameData> pending_frame_data_; | 160 base::Optional<FrameData> pending_frame_data_; |
161 base::Optional<FrameData> active_frame_data_; | 161 base::Optional<FrameData> active_frame_data_; |
162 int frame_index_; | 162 int frame_index_; |
163 bool destroyed_; | 163 bool destroyed_; |
164 std::vector<SurfaceSequence> destruction_dependencies_; | 164 std::vector<SurfaceSequence> destruction_dependencies_; |
165 | 165 |
166 SurfaceDependencies blocking_surfaces_; | 166 base::flat_set<SurfaceId> blocking_surfaces_; |
167 base::ObserverList<PendingFrameObserver, true> observers_; | 167 base::ObserverList<PendingFrameObserver, true> observers_; |
168 | 168 |
169 DISALLOW_COPY_AND_ASSIGN(Surface); | 169 DISALLOW_COPY_AND_ASSIGN(Surface); |
170 }; | 170 }; |
171 | 171 |
172 } // namespace cc | 172 } // namespace cc |
173 | 173 |
174 #endif // CC_SURFACES_SURFACE_H_ | 174 #endif // CC_SURFACES_SURFACE_H_ |
OLD | NEW |