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

Side by Side Diff: cc/surfaces/pending_frame_observer.h

Issue 2811813004: Surface Synchronization: Distinguish between dependencies and references (Closed)
Patch Set: Addressed Vlad's comments Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_PENDING_FRAME_OBSERVER_H_ 5 #ifndef CC_SURFACES_PENDING_FRAME_OBSERVER_H_
6 #define CC_SURFACES_PENDING_FRAME_OBSERVER_H_ 6 #define CC_SURFACES_PENDING_FRAME_OBSERVER_H_
7 7
8 #include "base/containers/flat_set.h" 8 #include "base/containers/flat_set.h"
9 #include "cc/surfaces/surface_id.h" 9 #include "cc/surfaces/surface_id.h"
10 #include "cc/surfaces/surfaces_export.h" 10 #include "cc/surfaces/surfaces_export.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 using SurfaceDependencies = base::flat_set<SurfaceId>; 14 using SurfaceDependencies = base::flat_set<SurfaceId>;
15 15
16 class Surface; 16 class Surface;
17 17
18 // Clients that wish to observe when the state of a pending CompostiorFrame 18 // Clients that wish to observe when the state of a pending CompostiorFrame
19 // changes should implement this class. 19 // changes should implement this class.
20 class CC_SURFACES_EXPORT PendingFrameObserver { 20 class CC_SURFACES_EXPORT PendingFrameObserver {
21 public: 21 public:
22 // Called when one or both of the sets of referenced surfaces have changed.
23 virtual void OnReferencedSurfacesChanged(
24 Surface* surface,
25 const std::vector<SurfaceId>* active_referenced_surfaces,
26 const std::vector<SurfaceId>* pending_referenced_surfaces) = 0;
27
28 // Called when a CompositorFrame within |surface| has activated. 22 // Called when a CompositorFrame within |surface| has activated.
29 virtual void OnSurfaceActivated(Surface* surface) = 0; 23 virtual void OnSurfaceActivated(Surface* surface) = 0;
30 24
31 // Called when the dependencies of a pending CompositorFrame within |surface| 25 // Called when the dependencies of a pending CompositorFrame within |surface|
32 // have changed. 26 // have changed.
33 virtual void OnSurfaceDependenciesChanged( 27 virtual void OnSurfaceDependenciesChanged(
34 Surface* surface, 28 Surface* surface,
35 const SurfaceDependencies& added_dependencies, 29 const SurfaceDependencies& added_dependencies,
36 const SurfaceDependencies& removed_dependencies) = 0; 30 const SurfaceDependencies& removed_dependencies) = 0;
37 31
38 // Called when |surface| is being destroyed. 32 // Called when |surface| is being destroyed.
39 virtual void OnSurfaceDiscarded(Surface* surface) = 0; 33 virtual void OnSurfaceDiscarded(Surface* surface) = 0;
40 34
41 protected: 35 protected:
42 virtual ~PendingFrameObserver() = default; 36 virtual ~PendingFrameObserver() = default;
43 }; 37 };
44 38
45 } // namespace cc 39 } // namespace cc
46 40
47 #endif // CC_SURFACES_PENDING_FRAME_OBSERVER_H_ 41 #endif // CC_SURFACES_PENDING_FRAME_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698