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

Unified Diff: cc/layers/surface_holder.h

Issue 666163006: Allow layers to signal that additional sequences are needed before surface destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/layers/surface_holder.h
diff --git a/cc/layers/surface_holder.h b/cc/layers/surface_holder.h
new file mode 100644
index 0000000000000000000000000000000000000000..81305079655f3a17155163614faf822613c79244
--- /dev/null
+++ b/cc/layers/surface_holder.h
@@ -0,0 +1,48 @@
+// Copyright 2014 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_LAYERS_SURFACE_HOLDER_H_
+#define CC_LAYERS_SURFACE_HOLDER_H_
+
+#include <set>
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "cc/base/cc_export.h"
+#include "cc/surfaces/surface_id.h"
+#include "cc/surfaces/surface_sequence.h"
+
+namespace cc {
+
+class CC_EXPORT SurfaceHolder : public base::RefCounted<SurfaceHolder> {
+ public:
+ // The callback is called to satisfy a particular SurfaceSequence if the
+ // compositor is unable to.
+ typedef base::Callback<void(SurfaceSequence)> SatisfyCallback;
+ SurfaceHolder(SurfaceId id, SatisfyCallback satisfy_callback);
+
+ // Retrieves and clears the list of sequences that must be satisfied before
+ // surface destruction.
+ void GetSequenceSet(std::set<SurfaceSequence>* sequences);
+
+ // Adds a new sequence that must be satisfied before surface destruction.
+ void AddSurfaceSequence(SurfaceSequence sequence);
+
+ SatisfyCallback satisfy_callback() { return satisfy_callback_; }
+ SurfaceId surface_id() const { return id_; }
+
+ private:
+ friend class base::RefCounted<SurfaceHolder>;
+ ~SurfaceHolder();
+
+ SurfaceId id_;
+ SatisfyCallback satisfy_callback_;
+ std::set<SurfaceSequence> sequences_;
piman 2014/11/03 23:49:26 nit: hash_set? Faster/less memory? Or even, if you
danakj 2014/11/04 16:56:57 hash_set may be slower on android (due to modulo o
+
+ DISALLOW_COPY_AND_ASSIGN(SurfaceHolder);
+};
+
+} // namespace cc
+
+#endif // CC_LAYERS_SURFACE_HOLDER_H_
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/layers/surface_holder.cc » ('j') | cc/layers/surface_layer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698