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 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 SurfaceManager* manager() { return manager_; } | 78 SurfaceManager* manager() { return manager_; } |
79 | 79 |
80 // This can be set to false if resources from this SurfaceFactory don't need | 80 // This can be set to false if resources from this SurfaceFactory don't need |
81 // to have sync points set on them when returned from the Display, for | 81 // to have sync points set on them when returned from the Display, for |
82 // example if the Display shares a context with the creator. | 82 // example if the Display shares a context with the creator. |
83 bool needs_sync_points() const { return needs_sync_points_; } | 83 bool needs_sync_points() const { return needs_sync_points_; } |
84 void set_needs_sync_points(bool needs) { needs_sync_points_ = needs; } | 84 void set_needs_sync_points(bool needs) { needs_sync_points_ = needs; } |
85 | 85 |
86 // SurfaceFactory's owner can call this when it finds out that SurfaceManager | 86 // SurfaceFactory's owner can call this when it finds out that SurfaceManager |
87 // is no longer alive during destruction. | 87 // is no longer alive during destruction. |
88 void didDestroySurfaceManager() { manager_ = nullptr; } | 88 void did_destroy_surface_manager() { manager_ = nullptr; } |
xlai (Olivia)
2016/06/28 21:16:19
The previous function name uses Blink style instea
danakj
2016/06/28 22:13:14
I think I prefer DidDestroySurfaceManager instead.
| |
89 | 89 |
90 private: | 90 private: |
91 SurfaceManager* manager_; | 91 SurfaceManager* manager_; |
92 SurfaceFactoryClient* client_; | 92 SurfaceFactoryClient* client_; |
93 SurfaceResourceHolder holder_; | 93 SurfaceResourceHolder holder_; |
94 | 94 |
95 bool needs_sync_points_; | 95 bool needs_sync_points_; |
96 | 96 |
97 using OwningSurfaceMap = | 97 using OwningSurfaceMap = |
98 std::unordered_map<SurfaceId, std::unique_ptr<Surface>, SurfaceIdHash>; | 98 std::unordered_map<SurfaceId, std::unique_ptr<Surface>, SurfaceIdHash>; |
99 OwningSurfaceMap surface_map_; | 99 OwningSurfaceMap surface_map_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 101 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace cc | 104 } // namespace cc |
105 | 105 |
106 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 106 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
OLD | NEW |