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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // returns true before calling this method. | 80 // returns true before calling this method. |
81 const CompositorFrame& GetPendingFrame(); | 81 const CompositorFrame& GetPendingFrame(); |
82 | 82 |
83 // Returns a number that increments by 1 every time a new frame is enqueued. | 83 // Returns a number that increments by 1 every time a new frame is enqueued. |
84 int frame_index() const { return frame_index_; } | 84 int frame_index() const { return frame_index_; } |
85 | 85 |
86 void TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info); | 86 void TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info); |
87 void RunDrawCallbacks(); | 87 void RunDrawCallbacks(); |
88 | 88 |
89 base::WeakPtr<SurfaceFactory> factory() { return factory_; } | 89 base::WeakPtr<SurfaceFactory> factory() { return factory_; } |
| 90 void set_factory(base::WeakPtr<SurfaceFactory> factory) { |
| 91 factory_ = factory; |
| 92 } |
90 | 93 |
91 // Add a SurfaceSequence that must be satisfied before the Surface is | 94 // Add a SurfaceSequence that must be satisfied before the Surface is |
92 // destroyed. | 95 // destroyed. |
93 void AddDestructionDependency(SurfaceSequence sequence); | 96 void AddDestructionDependency(SurfaceSequence sequence); |
94 | 97 |
95 // Satisfy all destruction dependencies that are contained in sequences, and | 98 // Satisfy all destruction dependencies that are contained in sequences, and |
96 // remove them from sequences. | 99 // remove them from sequences. |
97 void SatisfyDestructionDependencies( | 100 void SatisfyDestructionDependencies( |
98 std::unordered_set<SurfaceSequence, SurfaceSequenceHash>* sequences, | 101 std::unordered_set<SurfaceSequence, SurfaceSequenceHash>* sequences, |
99 std::unordered_set<FrameSinkId, FrameSinkIdHash>* valid_id_namespaces); | 102 std::unordered_set<FrameSinkId, FrameSinkIdHash>* valid_id_namespaces); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 DrawCallback draw_callback_; | 161 DrawCallback draw_callback_; |
159 | 162 |
160 DISALLOW_COPY_AND_ASSIGN(Surface); | 163 DISALLOW_COPY_AND_ASSIGN(Surface); |
161 }; | 164 }; |
162 | 165 |
163 using PendingSurfaceSet = base::flat_set<Surface*>; | 166 using PendingSurfaceSet = base::flat_set<Surface*>; |
164 | 167 |
165 } // namespace cc | 168 } // namespace cc |
166 | 169 |
167 #endif // CC_SURFACES_SURFACE_H_ | 170 #endif // CC_SURFACES_SURFACE_H_ |
OLD | NEW |