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 <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 return destruction_dependencies_.size(); | 73 return destruction_dependencies_.size(); |
74 } | 74 } |
75 | 75 |
76 const std::vector<SurfaceId>& referenced_surfaces() const { | 76 const std::vector<SurfaceId>& referenced_surfaces() const { |
77 return referenced_surfaces_; | 77 return referenced_surfaces_; |
78 } | 78 } |
79 | 79 |
80 bool destroyed() const { return destroyed_; } | 80 bool destroyed() const { return destroyed_; } |
81 void set_destroyed(bool destroyed) { destroyed_ = destroyed; } | 81 void set_destroyed(bool destroyed) { destroyed_ = destroyed; } |
82 | 82 |
83 void AddBeginFrameSource(BeginFrameSource* begin_frame_source); | |
84 void RemoveBeginFrameSource(BeginFrameSource* begin_frame_source); | |
85 | |
83 private: | 86 private: |
84 void ClearCopyRequests(); | 87 void ClearCopyRequests(); |
88 void UpdatePrimaryBeginFrameSource(); | |
85 | 89 |
86 SurfaceId surface_id_; | 90 SurfaceId surface_id_; |
87 base::WeakPtr<SurfaceFactory> factory_; | 91 base::WeakPtr<SurfaceFactory> factory_; |
88 // TODO(jamesr): Support multiple frames in flight. | 92 // TODO(jamesr): Support multiple frames in flight. |
89 scoped_ptr<CompositorFrame> current_frame_; | 93 scoped_ptr<CompositorFrame> current_frame_; |
90 int frame_index_; | 94 int frame_index_; |
91 bool destroyed_; | 95 bool destroyed_; |
92 std::vector<SurfaceSequence> destruction_dependencies_; | 96 std::vector<SurfaceSequence> destruction_dependencies_; |
93 | 97 |
98 // This surface may have multiple BeginFrameSources if it is | |
99 // on multiple Displays. | |
100 std::vector<BeginFrameSource*> begin_frame_sources_; | |
mithro-old
2015/10/01 03:00:23
Can we just use an order set type here rather then
brianderson
2015/10/07 20:54:48
Done.
| |
101 | |
94 std::vector<SurfaceId> referenced_surfaces_; | 102 std::vector<SurfaceId> referenced_surfaces_; |
95 | 103 |
96 DrawCallback draw_callback_; | 104 DrawCallback draw_callback_; |
97 | 105 |
98 DISALLOW_COPY_AND_ASSIGN(Surface); | 106 DISALLOW_COPY_AND_ASSIGN(Surface); |
99 }; | 107 }; |
100 | 108 |
101 } // namespace cc | 109 } // namespace cc |
102 | 110 |
103 #endif // CC_SURFACES_SURFACE_H_ | 111 #endif // CC_SURFACES_SURFACE_H_ |
OLD | NEW |