Chromium Code Reviews| 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> |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 #include "cc/surfaces/surfaces_export.h" | 28 #include "cc/surfaces/surfaces_export.h" |
| 29 | 29 |
| 30 #if DCHECK_IS_ON() | 30 #if DCHECK_IS_ON() |
| 31 #include <iosfwd> | 31 #include <iosfwd> |
| 32 #include <string> | 32 #include <string> |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 namespace cc { | 35 namespace cc { |
| 36 class BeginFrameSource; | 36 class BeginFrameSource; |
| 37 class CompositorFrame; | 37 class CompositorFrame; |
| 38 class Surface; | 38 class Surface; |
|
jbauman
2017/03/09 22:21:37
add "class SurfaceFactory;" here (or add it as an
Saman Sami
2017/03/09 22:32:04
Done.
| |
| 39 class SurfaceFactoryClient; | 39 class SurfaceFactoryClient; |
| 40 | 40 |
| 41 namespace test { | 41 namespace test { |
| 42 class CompositorFrameSinkSupportTest; | 42 class CompositorFrameSinkSupportTest; |
| 43 } | 43 } |
| 44 | 44 |
| 45 class CC_SURFACES_EXPORT SurfaceManager { | 45 class CC_SURFACES_EXPORT SurfaceManager { |
| 46 public: | 46 public: |
| 47 enum class LifetimeType { | 47 enum class LifetimeType { |
| 48 REFERENCES, | 48 REFERENCES, |
| 49 SEQUENCES, | 49 SEQUENCES, |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 explicit SurfaceManager(LifetimeType lifetime_type = LifetimeType::SEQUENCES); | 52 explicit SurfaceManager(LifetimeType lifetime_type = LifetimeType::SEQUENCES); |
| 53 ~SurfaceManager(); | 53 ~SurfaceManager(); |
| 54 | 54 |
| 55 #if DCHECK_IS_ON() | 55 #if DCHECK_IS_ON() |
| 56 // Returns a string representation of all reachable surface references. | 56 // Returns a string representation of all reachable surface references. |
| 57 std::string SurfaceReferencesToString(); | 57 std::string SurfaceReferencesToString(); |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 void SetDependencyTracker( | 60 void SetDependencyTracker( |
| 61 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker); | 61 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker); |
| 62 SurfaceDependencyTracker* dependency_tracker() { | 62 SurfaceDependencyTracker* dependency_tracker() { |
| 63 return dependency_tracker_.get(); | 63 return dependency_tracker_.get(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void RequestSurfaceResolution(Surface* pending_surface); | 66 void RequestSurfaceResolution(Surface* pending_surface); |
| 67 | 67 |
| 68 void RegisterSurface(Surface* surface); | |
| 69 void DeregisterSurface(const SurfaceId& surface_id); | 68 void DeregisterSurface(const SurfaceId& surface_id); |
|
jbauman
2017/03/09 22:21:37
Could you make this private while you're changing
Saman Sami
2017/03/09 22:32:04
Done.
| |
| 70 | 69 |
| 70 std::unique_ptr<Surface> CreateSurface( | |
| 71 base::WeakPtr<SurfaceFactory> surface_factory, | |
| 72 const LocalSurfaceId& local_surface_id); | |
| 73 | |
| 71 // Destroy the Surface once a set of sequence numbers has been satisfied. | 74 // Destroy the Surface once a set of sequence numbers has been satisfied. |
| 72 void Destroy(std::unique_ptr<Surface> surface); | 75 void DestroySurface(std::unique_ptr<Surface> surface); |
| 73 | 76 |
| 74 Surface* GetSurfaceForId(const SurfaceId& surface_id); | 77 Surface* GetSurfaceForId(const SurfaceId& surface_id); |
| 75 | 78 |
| 76 void AddObserver(SurfaceObserver* obs) { observer_list_.AddObserver(obs); } | 79 void AddObserver(SurfaceObserver* obs) { observer_list_.AddObserver(obs); } |
| 77 | 80 |
| 78 void RemoveObserver(SurfaceObserver* obs) { | 81 void RemoveObserver(SurfaceObserver* obs) { |
| 79 observer_list_.RemoveObserver(obs); | 82 observer_list_.RemoveObserver(obs); |
| 80 } | 83 } |
| 81 | 84 |
| 82 bool SurfaceModified(const SurfaceId& surface_id); | 85 bool SurfaceModified(const SurfaceId& surface_id); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; | 311 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; |
| 309 | 312 |
| 310 base::WeakPtrFactory<SurfaceManager> weak_factory_; | 313 base::WeakPtrFactory<SurfaceManager> weak_factory_; |
| 311 | 314 |
| 312 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 315 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 313 }; | 316 }; |
| 314 | 317 |
| 315 } // namespace cc | 318 } // namespace cc |
| 316 | 319 |
| 317 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 320 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |