| OLD | NEW |
| 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>; | |
| 15 | |
| 16 class Surface; | 14 class Surface; |
| 17 | 15 |
| 18 // Clients that wish to observe when the state of a pending CompostiorFrame | 16 // Clients that wish to observe when the state of a pending CompostiorFrame |
| 19 // changes should implement this class. | 17 // changes should implement this class. |
| 20 class CC_SURFACES_EXPORT PendingFrameObserver { | 18 class CC_SURFACES_EXPORT PendingFrameObserver { |
| 21 public: | 19 public: |
| 22 // Called when a CompositorFrame within |surface| has activated. | 20 // Called when a CompositorFrame within |surface| has activated. |
| 23 virtual void OnSurfaceActivated(Surface* surface) = 0; | 21 virtual void OnSurfaceActivated(Surface* surface) = 0; |
| 24 | 22 |
| 25 // Called when the dependencies of a pending CompositorFrame within |surface| | 23 // Called when the dependencies of a pending CompositorFrame within |surface| |
| 26 // have changed. | 24 // have changed. |
| 27 virtual void OnSurfaceDependenciesChanged( | 25 virtual void OnSurfaceDependenciesChanged( |
| 28 Surface* surface, | 26 Surface* surface, |
| 29 const SurfaceDependencies& added_dependencies, | 27 const base::flat_set<SurfaceId>& added_dependencies, |
| 30 const SurfaceDependencies& removed_dependencies) = 0; | 28 const base::flat_set<SurfaceId>& removed_dependencies) = 0; |
| 31 | 29 |
| 32 // Called when |surface| is being destroyed. | 30 // Called when |surface| is being destroyed. |
| 33 virtual void OnSurfaceDiscarded(Surface* surface) = 0; | 31 virtual void OnSurfaceDiscarded(Surface* surface) = 0; |
| 34 | 32 |
| 35 protected: | 33 protected: |
| 36 virtual ~PendingFrameObserver() = default; | 34 virtual ~PendingFrameObserver() = default; |
| 37 }; | 35 }; |
| 38 | 36 |
| 39 } // namespace cc | 37 } // namespace cc |
| 40 | 38 |
| 41 #endif // CC_SURFACES_PENDING_FRAME_OBSERVER_H_ | 39 #endif // CC_SURFACES_PENDING_FRAME_OBSERVER_H_ |
| OLD | NEW |