| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| 11 #include <memory> |
| 11 #include <unordered_map> | 12 #include <unordered_map> |
| 12 #include <unordered_set> | 13 #include <unordered_set> |
| 13 #include <vector> | 14 #include <vector> |
| 14 | 15 |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/scoped_ptr.h" | |
| 17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 18 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
| 19 #include "cc/surfaces/surface_damage_observer.h" | 19 #include "cc/surfaces/surface_damage_observer.h" |
| 20 #include "cc/surfaces/surface_id.h" | 20 #include "cc/surfaces/surface_id.h" |
| 21 #include "cc/surfaces/surface_sequence.h" | 21 #include "cc/surfaces/surface_sequence.h" |
| 22 #include "cc/surfaces/surfaces_export.h" | 22 #include "cc/surfaces/surfaces_export.h" |
| 23 | 23 |
| 24 namespace cc { | 24 namespace cc { |
| 25 class BeginFrameSource; | 25 class BeginFrameSource; |
| 26 class CompositorFrame; | 26 class CompositorFrame; |
| 27 class Surface; | 27 class Surface; |
| 28 class SurfaceFactoryClient; | 28 class SurfaceFactoryClient; |
| 29 | 29 |
| 30 class CC_SURFACES_EXPORT SurfaceManager { | 30 class CC_SURFACES_EXPORT SurfaceManager { |
| 31 public: | 31 public: |
| 32 SurfaceManager(); | 32 SurfaceManager(); |
| 33 ~SurfaceManager(); | 33 ~SurfaceManager(); |
| 34 | 34 |
| 35 void RegisterSurface(Surface* surface); | 35 void RegisterSurface(Surface* surface); |
| 36 void DeregisterSurface(SurfaceId surface_id); | 36 void DeregisterSurface(SurfaceId surface_id); |
| 37 | 37 |
| 38 // Destroy the Surface once a set of sequence numbers has been satisfied. | 38 // Destroy the Surface once a set of sequence numbers has been satisfied. |
| 39 void Destroy(scoped_ptr<Surface> surface); | 39 void Destroy(std::unique_ptr<Surface> surface); |
| 40 | 40 |
| 41 Surface* GetSurfaceForId(SurfaceId surface_id); | 41 Surface* GetSurfaceForId(SurfaceId surface_id); |
| 42 | 42 |
| 43 void AddObserver(SurfaceDamageObserver* obs) { | 43 void AddObserver(SurfaceDamageObserver* obs) { |
| 44 observer_list_.AddObserver(obs); | 44 observer_list_.AddObserver(obs); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void RemoveObserver(SurfaceDamageObserver* obs) { | 47 void RemoveObserver(SurfaceDamageObserver* obs) { |
| 48 observer_list_.RemoveObserver(obs); | 48 observer_list_.RemoveObserver(obs); |
| 49 } | 49 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // that is implicitly using this namespace must be reachable by the | 142 // that is implicitly using this namespace must be reachable by the |
| 143 // parent in the dag. | 143 // parent in the dag. |
| 144 std::unordered_map<BeginFrameSource*, uint32_t> registered_sources_; | 144 std::unordered_map<BeginFrameSource*, uint32_t> registered_sources_; |
| 145 | 145 |
| 146 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 146 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace cc | 149 } // namespace cc |
| 150 | 150 |
| 151 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 151 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |