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

Unified Diff: cc/surfaces/surface_observer.h

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: track state in DisplayScheduler rather than Surface Created 3 years, 7 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_manager.cc ('k') | cc/surfaces/surface_synchronization_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_observer.h
diff --git a/cc/surfaces/surface_observer.h b/cc/surfaces/surface_observer.h
index e1c182a45c50d99b91c1a6940dd96f160d95b42f..cafcd25047b4a50396c748165e47b34387f3cebb 100644
--- a/cc/surfaces/surface_observer.h
+++ b/cc/surfaces/surface_observer.h
@@ -7,17 +7,33 @@
namespace cc {
+struct BeginFrameAck;
+struct BeginFrameArgs;
+class SurfaceId;
class SurfaceInfo;
class SurfaceObserver {
public:
- // Runs when a CompositorFrame is received for the given SurfaceInfo for the
+ // Runs when a CompositorFrame is activated for the given SurfaceInfo for the
// first time.
- virtual void OnSurfaceCreated(const SurfaceInfo& surface_info) = 0;
+ virtual void OnSurfaceCreated(const SurfaceInfo& surface_info) {}
sunnyps 2017/05/22 06:46:38 This should be a pure abstract class otherwise we
sunnyps 2017/05/22 06:46:38 Should we add the begin frame args and ack to Surf
Eric Seckler 2017/05/22 15:32:15 Done.
Eric Seckler 2017/05/22 15:32:15 We could, but it's not really relevant in that sit
- // Runs when a Surface is damaged. *changed should be set to true if this
- // causes a Display to be damaged.
- virtual void OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) = 0;
+ // Runs when a Surface was marked to be destroyed.
+ virtual void OnSurfaceDestroyed(const SurfaceId& surface_id) {}
+
+ // Runs when a Surface is damaged (a new CompositorFrame is activated).
+ // *changed should be set to true if this causes a Display to be damaged.
+ virtual void OnSurfaceDamaged(const SurfaceId& surface_id, bool* changed) {}
+
+ // Runs when a Surface's CompositorFrame producer has received a BeginFrame.
+ virtual void OnSurfaceReceivedBeginFrame(const SurfaceId& surface_id,
sunnyps 2017/05/22 06:46:38 bikeshed nit: OnSurfaceBeginFrame
Eric Seckler 2017/05/22 15:32:15 Done.
+ const BeginFrameArgs& args) {}
+
+ // Runs when a Surface's CompositorFrame producer has completed a BeginFrame
+ // either by submitting a CompositorFrame or confirming that it will not
+ // submit one.
+ virtual void OnSurfaceFinishedBeginFrame(const SurfaceId& surface_id,
sunnyps 2017/05/22 06:46:38 bikeshed nit: OnSurfaceBeginFrameAck
Eric Seckler 2017/05/22 15:32:15 Done.
+ const BeginFrameAck& ack) {}
};
} // namespace cc
« no previous file with comments | « cc/surfaces/surface_manager.cc ('k') | cc/surfaces/surface_synchronization_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698