Chromium Code Reviews| Index: cc/surfaces/surface_manager.h |
| diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h |
| index 40e55f1fc7ee1f522b550cb392fe6e79f7ca2399..e029760a98573767f19b3bfc03b7497aeed36639 100644 |
| --- a/cc/surfaces/surface_manager.h |
| +++ b/cc/surfaces/surface_manager.h |
| @@ -5,8 +5,11 @@ |
| #ifndef CC_SURFACES_SURFACE_MANAGER_H_ |
| #define CC_SURFACES_SURFACE_MANAGER_H_ |
| +#include <set> |
| + |
| #include "base/containers/hash_tables.h" |
| #include "base/macros.h" |
| +#include "base/observer_list.h" |
| #include "cc/surfaces/surface_id.h" |
| #include "cc/surfaces/surfaces_export.h" |
| @@ -24,9 +27,25 @@ class CC_SURFACES_EXPORT SurfaceManager { |
| Surface* GetSurfaceForId(SurfaceId surface_id); |
| + class CC_SURFACES_EXPORT SurfaceDamageObserver { |
|
jamesr
2014/08/11 16:58:02
no export needed, this doesn't have any symbols to
|
| + public: |
| + virtual void OnSurfaceDamaged(SurfaceId surface_id) = 0; |
| + }; |
| + |
| + void AddObserver(SurfaceDamageObserver* obs) { |
| + observer_list_.AddObserver(obs); |
| + } |
| + |
| + void RemoveObserver(SurfaceDamageObserver* obs) { |
| + observer_list_.RemoveObserver(obs); |
| + } |
| + |
| + void SurfaceModified(SurfaceId surface_id); |
| + |
| private: |
| typedef base::hash_map<SurfaceId, Surface*> SurfaceMap; |
| SurfaceMap surface_map_; |
| + ObserverList<SurfaceDamageObserver> observer_list_; |
| DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| }; |