| 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_MANAGER_H_ | 5 #ifndef CC_SURFACES_SURFACE_MANAGER_H_ |
| 6 #define CC_SURFACES_SURFACE_MANAGER_H_ | 6 #define CC_SURFACES_SURFACE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 void AddObserver(SurfaceDamageObserver* obs) { | 39 void AddObserver(SurfaceDamageObserver* obs) { |
| 40 observer_list_.AddObserver(obs); | 40 observer_list_.AddObserver(obs); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void RemoveObserver(SurfaceDamageObserver* obs) { | 43 void RemoveObserver(SurfaceDamageObserver* obs) { |
| 44 observer_list_.RemoveObserver(obs); | 44 observer_list_.RemoveObserver(obs); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void SurfaceModified(SurfaceId surface_id); | 47 void SurfaceModified(SurfaceId surface_id); |
| 48 | 48 |
| 49 // A frame for a surface satisfies a set of sequence numbers. | 49 // A frame for a surface satisfies a set of sequence numbers in a particular |
| 50 void DidSatisfySequences(SurfaceId id, std::vector<uint32_t>* sequence); | 50 // id namespace. |
| 51 void DidSatisfySequences(uint32_t id_namespace, |
| 52 std::vector<uint32_t>* sequence); |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 void SearchForSatisfaction(); | 55 void SearchForSatisfaction(); |
| 54 | 56 |
| 55 typedef base::hash_map<SurfaceId, Surface*> SurfaceMap; | 57 typedef base::hash_map<SurfaceId, Surface*> SurfaceMap; |
| 56 SurfaceMap surface_map_; | 58 SurfaceMap surface_map_; |
| 57 ObserverList<SurfaceDamageObserver> observer_list_; | 59 ObserverList<SurfaceDamageObserver> observer_list_; |
| 58 base::ThreadChecker thread_checker_; | 60 base::ThreadChecker thread_checker_; |
| 59 | 61 |
| 60 // List of surfaces to be destroyed, along with what sequences they're still | 62 // List of surfaces to be destroyed, along with what sequences they're still |
| 61 // waiting on. | 63 // waiting on. |
| 62 typedef std::list<std::pair<Surface*, std::set<SurfaceSequence>>> | 64 typedef std::list<std::pair<Surface*, std::set<SurfaceSequence>>> |
| 63 SurfaceDestroyList; | 65 SurfaceDestroyList; |
| 64 SurfaceDestroyList surfaces_to_destroy_; | 66 SurfaceDestroyList surfaces_to_destroy_; |
| 65 | 67 |
| 66 // Set of SurfaceSequences that have been satisfied by a frame but not yet | 68 // Set of SurfaceSequences that have been satisfied by a frame but not yet |
| 67 // waited on. | 69 // waited on. |
| 68 std::set<SurfaceSequence> satisfied_sequences_; | 70 std::set<SurfaceSequence> satisfied_sequences_; |
| 69 | 71 |
| 70 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 72 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 } // namespace cc | 75 } // namespace cc |
| 74 | 76 |
| 75 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 77 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |