| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SURFACE_MANAGER_H_ | 5 #ifndef CC_SURFACES_SURFACE_MANAGER_H_ |
| 6 #define CC_SURFACES_SURFACE_MANAGER_H_ | 6 #define CC_SURFACES_SURFACE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "cc/surfaces/surface_reference_factory.h" | 28 #include "cc/surfaces/surface_reference_factory.h" |
| 29 #include "cc/surfaces/surface_sequence.h" | 29 #include "cc/surfaces/surface_sequence.h" |
| 30 #include "cc/surfaces/surfaces_export.h" | 30 #include "cc/surfaces/surfaces_export.h" |
| 31 | 31 |
| 32 #if DCHECK_IS_ON() | 32 #if DCHECK_IS_ON() |
| 33 #include <iosfwd> | 33 #include <iosfwd> |
| 34 #include <string> | 34 #include <string> |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 namespace cc { | 37 namespace cc { |
| 38 |
| 39 struct BeginFrameAck; |
| 40 struct BeginFrameArgs; |
| 38 class BeginFrameSource; | 41 class BeginFrameSource; |
| 39 class CompositorFrame; | 42 class CompositorFrame; |
| 40 class FrameSinkManagerClient; | 43 class FrameSinkManagerClient; |
| 41 class Surface; | 44 class Surface; |
| 42 | 45 |
| 43 namespace test { | 46 namespace test { |
| 44 class SurfaceSynchronizationTest; | 47 class SurfaceSynchronizationTest; |
| 45 } | 48 } |
| 46 | 49 |
| 47 class CC_SURFACES_EXPORT SurfaceManager { | 50 class CC_SURFACES_EXPORT SurfaceManager { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 75 void DestroySurface(std::unique_ptr<Surface> surface); | 78 void DestroySurface(std::unique_ptr<Surface> surface); |
| 76 | 79 |
| 77 Surface* GetSurfaceForId(const SurfaceId& surface_id); | 80 Surface* GetSurfaceForId(const SurfaceId& surface_id); |
| 78 | 81 |
| 79 void AddObserver(SurfaceObserver* obs) { observer_list_.AddObserver(obs); } | 82 void AddObserver(SurfaceObserver* obs) { observer_list_.AddObserver(obs); } |
| 80 | 83 |
| 81 void RemoveObserver(SurfaceObserver* obs) { | 84 void RemoveObserver(SurfaceObserver* obs) { |
| 82 observer_list_.RemoveObserver(obs); | 85 observer_list_.RemoveObserver(obs); |
| 83 } | 86 } |
| 84 | 87 |
| 85 bool SurfaceModified(const SurfaceId& surface_id); | 88 // Called when a Surface is modified, e.g. when a CompositorFrame is |
| 89 // activated, its producer confirms that no CompositorFrame will be submitted |
| 90 // in response to a BeginFrame, or a CopyOutputRequest is issued. |
| 91 // |
| 92 // |ack.sequence_number| is only valid if called in response to a BeginFrame. |
| 93 bool SurfaceModified(const SurfaceId& surface_id, const BeginFrameAck& ack); |
| 86 | 94 |
| 87 // Called when a CompositorFrame is submitted to a CompositorFrameSinkSupport | 95 // Called when a CompositorFrame is submitted to a CompositorFrameSinkSupport |
| 88 // for a given |surface_id| for the first time. | 96 // for a given |surface_id| for the first time. |
| 89 void SurfaceCreated(const SurfaceInfo& surface_info); | 97 void SurfaceCreated(const SurfaceInfo& surface_info); |
| 90 | 98 |
| 91 // Called when a CompositorFrame within |surface| has activated. | 99 // Called when a CompositorFrame within |surface| has activated. |
| 92 void SurfaceActivated(Surface* surface); | 100 void SurfaceActivated(Surface* surface); |
| 93 | 101 |
| 94 // Called when the dependencies of a pending CompositorFrame within |surface| | 102 // Called when the dependencies of a pending CompositorFrame within |surface| |
| 95 // has changed. | 103 // has changed. |
| 96 void SurfaceDependenciesChanged( | 104 void SurfaceDependenciesChanged( |
| 97 Surface* surface, | 105 Surface* surface, |
| 98 const base::flat_set<SurfaceId>& added_dependencies, | 106 const base::flat_set<SurfaceId>& added_dependencies, |
| 99 const base::flat_set<SurfaceId>& removed_dependencies); | 107 const base::flat_set<SurfaceId>& removed_dependencies); |
| 100 | 108 |
| 101 // Called when |surface| is being destroyed. | 109 // Called when |surface| is being destroyed. |
| 102 void SurfaceDiscarded(Surface* surface); | 110 void SurfaceDiscarded(Surface* surface); |
| 103 | 111 |
| 112 // Called when a Surface's CompositorFrame producer has received a BeginFrame |
| 113 // and, thus, is expected to produce damage soon. |
| 114 void SurfaceDamageExpected(const SurfaceId& surface_id, |
| 115 const BeginFrameArgs& args); |
| 116 |
| 104 // Require that the given sequence number must be satisfied (using | 117 // Require that the given sequence number must be satisfied (using |
| 105 // SatisfySequence) before the given surface can be destroyed. | 118 // SatisfySequence) before the given surface can be destroyed. |
| 106 void RequireSequence(const SurfaceId& surface_id, | 119 void RequireSequence(const SurfaceId& surface_id, |
| 107 const SurfaceSequence& sequence); | 120 const SurfaceSequence& sequence); |
| 108 | 121 |
| 109 // Satisfies the given sequence number. Once all sequence numbers that | 122 // Satisfies the given sequence number. Once all sequence numbers that |
| 110 // a surface depends on are satisfied, the surface can be destroyed. | 123 // a surface depends on are satisfied, the surface can be destroyed. |
| 111 void SatisfySequence(const SurfaceSequence& sequence); | 124 void SatisfySequence(const SurfaceSequence& sequence); |
| 112 | 125 |
| 113 void RegisterFrameSinkId(const FrameSinkId& frame_sink_id); | 126 void RegisterFrameSinkId(const FrameSinkId& frame_sink_id); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; | 304 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; |
| 292 | 305 |
| 293 base::WeakPtrFactory<SurfaceManager> weak_factory_; | 306 base::WeakPtrFactory<SurfaceManager> weak_factory_; |
| 294 | 307 |
| 295 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 308 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 296 }; | 309 }; |
| 297 | 310 |
| 298 } // namespace cc | 311 } // namespace cc |
| 299 | 312 |
| 300 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 313 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |