Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: cc/surfaces/surface_manager.h

Issue 2403573002: cc: Introduce mechanism to observe CompositorFrames submitted to new surfaceIDs (Closed)
Patch Set: Updated changes missed Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_manager.h
diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h
index 3420a0730fe4b0c72833cae7c6883562fc38ba55..9ba2eea2543043d8f7d06e6a5c9738185924b25d 100644
--- a/cc/surfaces/surface_manager.h
+++ b/cc/surfaces/surface_manager.h
@@ -17,8 +17,8 @@
#include "base/observer_list.h"
#include "base/threading/thread_checker.h"
#include "cc/surfaces/frame_sink_id.h"
-#include "cc/surfaces/surface_damage_observer.h"
#include "cc/surfaces/surface_id.h"
+#include "cc/surfaces/surface_observer.h"
#include "cc/surfaces/surface_sequence.h"
#include "cc/surfaces/surfaces_export.h"
@@ -41,16 +41,20 @@ class CC_SURFACES_EXPORT SurfaceManager {
Surface* GetSurfaceForId(const SurfaceId& surface_id);
- void AddObserver(SurfaceDamageObserver* obs) {
- observer_list_.AddObserver(obs);
- }
+ void AddObserver(SurfaceObserver* obs) { observer_list_.AddObserver(obs); }
- void RemoveObserver(SurfaceDamageObserver* obs) {
+ void RemoveObserver(SurfaceObserver* obs) {
observer_list_.RemoveObserver(obs);
}
bool SurfaceModified(const SurfaceId& surface_id);
+ // Called when a CompositorFrame is submitted to a SurfaceFactory for a given
+ // |surface_id| for the first time.
+ void SurfaceCreated(const SurfaceId& surface_id,
+ const gfx::Size& frame_size,
+ float device_scale_factor);
+
// A frame for a surface satisfies a set of sequence numbers in a particular
// id namespace.
void DidSatisfySequences(const FrameSinkId& frame_sink_id,
@@ -110,7 +114,7 @@ class CC_SURFACES_EXPORT SurfaceManager {
using SurfaceMap = std::unordered_map<SurfaceId, Surface*, SurfaceIdHash>;
SurfaceMap surface_map_;
- base::ObserverList<SurfaceDamageObserver> observer_list_;
+ base::ObserverList<SurfaceObserver> observer_list_;
base::ThreadChecker thread_checker_;
// List of surfaces to be destroyed, along with what sequences they're still
« no previous file with comments | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698