summaryrefslogtreecommitdiffstats
path: root/cc/surfaces/surface_manager.h
diff options
context:
space:
mode:
authorjbauman <jbauman@chromium.org>2014-11-06 15:26:44 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-06 23:27:33 +0000
commitdbccae1ab081972ddee790058d817721d94d55dd (patch)
tree3b021ea9c528970a56343e79ee725f68db8a787d /cc/surfaces/surface_manager.h
parent78e3d60d83366c66e82ec147a061be200088a656 (diff)
downloadchromium_src-dbccae1ab081972ddee790058d817721d94d55dd.zip
chromium_src-dbccae1ab081972ddee790058d817721d94d55dd.tar.gz
chromium_src-dbccae1ab081972ddee790058d817721d94d55dd.tar.bz2
Allow layers to signal that additional sequences are needed before surface destruction
A single surface can be referenced by multiple layers in separate compositors, so we need to be able to have every layer individually signal the manager that the Surface shouldn't be released until it's done with it. When a SurfaceLayer's added to a LayerTreeHost, a new SurfaceSequence is created for that compositor and sent to the SurfaceManager for it to wait on before the Surface is destroyed. When the Surface is destroyed, that set of sequences is waited for. When the SurfaceLayer is removed from a compositor, a SwapPromise is created on that compositor that will satisfy its SurfaceSequence in the next frame (which won't reference the Surface). BUG=411118 Review URL: https://codereview.chromium.org/666163006 Cr-Commit-Position: refs/heads/master@{#303119}
Diffstat (limited to 'cc/surfaces/surface_manager.h')
-rw-r--r--cc/surfaces/surface_manager.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h
index 66db9d9..d630352 100644
--- a/cc/surfaces/surface_manager.h
+++ b/cc/surfaces/surface_manager.h
@@ -6,7 +6,6 @@
#define CC_SURFACES_SURFACE_MANAGER_H_
#include <list>
-#include <set>
#include <vector>
#include "base/containers/hash_tables.h"
@@ -31,8 +30,7 @@ class CC_SURFACES_EXPORT SurfaceManager {
void DeregisterSurface(SurfaceId surface_id);
// Destroy the Surface once a set of sequence numbers has been satisfied.
- void DestroyOnSequence(scoped_ptr<Surface> surface,
- const std::set<SurfaceSequence>& dependency_set);
+ void Destroy(scoped_ptr<Surface> surface);
Surface* GetSurfaceForId(SurfaceId surface_id);
@@ -46,8 +44,10 @@ class CC_SURFACES_EXPORT SurfaceManager {
void SurfaceModified(SurfaceId surface_id);
- // A frame for a surface satisfies a set of sequence numbers.
- void DidSatisfySequences(SurfaceId id, std::vector<uint32_t>* sequence);
+ // A frame for a surface satisfies a set of sequence numbers in a particular
+ // id namespace.
+ void DidSatisfySequences(uint32_t id_namespace,
+ std::vector<uint32_t>* sequence);
private:
void SearchForSatisfaction();
@@ -59,13 +59,12 @@ class CC_SURFACES_EXPORT SurfaceManager {
// List of surfaces to be destroyed, along with what sequences they're still
// waiting on.
- typedef std::list<std::pair<Surface*, std::set<SurfaceSequence>>>
- SurfaceDestroyList;
+ typedef std::list<Surface*> SurfaceDestroyList;
SurfaceDestroyList surfaces_to_destroy_;
// Set of SurfaceSequences that have been satisfied by a frame but not yet
// waited on.
- std::set<SurfaceSequence> satisfied_sequences_;
+ base::hash_set<SurfaceSequence> satisfied_sequences_;
DISALLOW_COPY_AND_ASSIGN(SurfaceManager);
};