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

Unified Diff: cc/surfaces/pending_frame_observer.h

Issue 2676373004: Implement service-side surface synchronization (Closed)
Patch Set: Better unit test name Created 3 years, 10 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
Index: cc/surfaces/pending_frame_observer.h
diff --git a/cc/surfaces/pending_frame_observer.h b/cc/surfaces/pending_frame_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..ec7acab2e2a83e490a956f8ecf0501c1d5919092
--- /dev/null
+++ b/cc/surfaces/pending_frame_observer.h
@@ -0,0 +1,41 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_SURFACES_PENDING_FRAME_OBSERVER_H_
+#define CC_SURFACES_PENDING_FRAME_OBSERVER_H_
+
+#include "base/containers/flat_set.h"
+#include "cc/surfaces/surface_id.h"
+#include "cc/surfaces/surfaces_export.h"
+
+namespace cc {
+
+using SurfaceDependencies = base::flat_set<SurfaceId>;
+
+class Surface;
+
+// Clients that wish to observe when the state of a pending CompostiorFrame
+// changes should implement this class.
+class CC_SURFACES_EXPORT PendingFrameObserver {
+ public:
+ // Called when a CompositorFrame within |surface| has activated.
+ virtual void OnSurfaceActivated(Surface* surface) = 0;
+
+ // Called when the dependencies of a pending CompositorFrame within |surface|
+ // have changed.
+ virtual void OnSurfaceDependenciesChanged(
+ Surface* surface,
+ const SurfaceDependencies& added_dependencies,
+ const SurfaceDependencies& removed_dependencies) = 0;
+
+ // Called when |surface| is being destroyed.
+ virtual void OnSurfaceDiscarded(Surface* surface) = 0;
+
+ protected:
+ virtual ~PendingFrameObserver() = default;
+};
+
+} // namespace cc
+
+#endif // CC_SURFACES_PENDING_FRAME_OBSERVER_H_
« no previous file with comments | « cc/surfaces/local_surface_id.h ('k') | cc/surfaces/surface.h » ('j') | cc/surfaces/surface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698