| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void UnrefResources(const ReturnedResourceArray& resources); | 76 void UnrefResources(const ReturnedResourceArray& resources); |
| 77 | 77 |
| 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 void onSurfaceManagerDestroyed() { manager_ = nullptr; } |
| 87 |
| 86 private: | 88 private: |
| 87 SurfaceManager* manager_; | 89 SurfaceManager* manager_; |
| 88 SurfaceFactoryClient* client_; | 90 SurfaceFactoryClient* client_; |
| 89 SurfaceResourceHolder holder_; | 91 SurfaceResourceHolder holder_; |
| 90 | 92 |
| 91 bool needs_sync_points_; | 93 bool needs_sync_points_; |
| 92 | 94 |
| 93 using OwningSurfaceMap = | 95 using OwningSurfaceMap = |
| 94 std::unordered_map<SurfaceId, std::unique_ptr<Surface>, SurfaceIdHash>; | 96 std::unordered_map<SurfaceId, std::unique_ptr<Surface>, SurfaceIdHash>; |
| 95 OwningSurfaceMap surface_map_; | 97 OwningSurfaceMap surface_map_; |
| 96 | 98 |
| 97 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 99 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
| 98 }; | 100 }; |
| 99 | 101 |
| 100 } // namespace cc | 102 } // namespace cc |
| 101 | 103 |
| 102 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 104 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
| OLD | NEW |