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

Unified Diff: cc/trees/surface_sequence_generator.h

Issue 2323423002: cc: Add SwapPromiseManager and SurfaceSequenceGenerator. (Closed)
Patch Set: rebase Created 4 years, 3 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/trees/surface_sequence_generator.h
diff --git a/cc/trees/surface_sequence_generator.h b/cc/trees/surface_sequence_generator.h
new file mode 100644
index 0000000000000000000000000000000000000000..10b880ad5fb84d3ac2143b1e54a60abe1aa8446f
--- /dev/null
+++ b/cc/trees/surface_sequence_generator.h
@@ -0,0 +1,37 @@
+// Copyright 2016 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_TREES_SURFACE_SEQUENCE_GENERATOR_H_
+#define CC_TREES_SURFACE_SEQUENCE_GENERATOR_H_
+
+#include <stdint.h>
+
+#include "base/macros.h"
+#include "cc/base/cc_export.h"
+
+namespace cc {
+struct SurfaceSequence;
+
+// Generates unique surface sequences for a surface client id.
+class CC_EXPORT SurfaceSequenceGenerator {
+ public:
+ SurfaceSequenceGenerator();
+ ~SurfaceSequenceGenerator();
+
+ void set_surface_client_id(uint32_t client_id) {
+ surface_client_id_ = client_id;
+ }
+
+ SurfaceSequence CreateSurfaceSequence();
+
+ private:
+ uint32_t surface_client_id_;
+ uint32_t next_surface_sequence_;
+
+ DISALLOW_COPY_AND_ASSIGN(SurfaceSequenceGenerator);
+};
+
+} // namespace cc
+
+#endif // CC_TREES_SURFACE_SEQUENCE_GENERATOR_H_

Powered by Google App Engine
This is Rietveld 408576698