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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return destruction_dependencies_.size(); | 77 return destruction_dependencies_.size(); |
78 } | 78 } |
79 | 79 |
80 const std::vector<SurfaceId>& referenced_surfaces() const { | 80 const std::vector<SurfaceId>& referenced_surfaces() const { |
81 return referenced_surfaces_; | 81 return referenced_surfaces_; |
82 } | 82 } |
83 | 83 |
84 bool destroyed() const { return destroyed_; } | 84 bool destroyed() const { return destroyed_; } |
85 void set_destroyed(bool destroyed) { destroyed_ = destroyed; } | 85 void set_destroyed(bool destroyed) { destroyed_ = destroyed; } |
86 | 86 |
87 void AddBeginFrameSource(BeginFrameSource* begin_frame_source); | |
88 void RemoveBeginFrameSource(BeginFrameSource* begin_frame_source); | |
89 | |
90 private: | 87 private: |
91 void ClearCopyRequests(); | 88 void ClearCopyRequests(); |
92 void UpdatePrimaryBeginFrameSource(); | |
93 | 89 |
94 SurfaceId surface_id_; | 90 SurfaceId surface_id_; |
95 base::WeakPtr<SurfaceFactory> factory_; | 91 base::WeakPtr<SurfaceFactory> factory_; |
96 // TODO(jamesr): Support multiple frames in flight. | 92 // TODO(jamesr): Support multiple frames in flight. |
97 scoped_ptr<CompositorFrame> current_frame_; | 93 scoped_ptr<CompositorFrame> current_frame_; |
98 int frame_index_; | 94 int frame_index_; |
99 bool destroyed_; | 95 bool destroyed_; |
100 std::vector<SurfaceSequence> destruction_dependencies_; | 96 std::vector<SurfaceSequence> destruction_dependencies_; |
101 | 97 |
102 // This surface may have multiple BeginFrameSources if it is | 98 // This surface may have multiple BeginFrameSources if it is |
103 // on multiple Displays. | 99 // on multiple Displays. |
104 std::set<BeginFrameSource*> begin_frame_sources_; | 100 std::set<BeginFrameSource*> begin_frame_sources_; |
105 | 101 |
106 std::vector<SurfaceId> referenced_surfaces_; | 102 std::vector<SurfaceId> referenced_surfaces_; |
107 | 103 |
108 DrawCallback draw_callback_; | 104 DrawCallback draw_callback_; |
109 | 105 |
110 DISALLOW_COPY_AND_ASSIGN(Surface); | 106 DISALLOW_COPY_AND_ASSIGN(Surface); |
111 }; | 107 }; |
112 | 108 |
113 } // namespace cc | 109 } // namespace cc |
114 | 110 |
115 #endif // CC_SURFACES_SURFACE_H_ | 111 #endif // CC_SURFACES_SURFACE_H_ |
OLD | NEW |