Chromium Code Reviews| Index: cc/surfaces/surface_sequence.h |
| diff --git a/cc/surfaces/surface_sequence.h b/cc/surfaces/surface_sequence.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ed6cfc6ea894b36ad9de05634e2d5795745306ea |
| --- /dev/null |
| +++ b/cc/surfaces/surface_sequence.h |
| @@ -0,0 +1,40 @@ |
| +// 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_SURFACES_SURFACE_SEQUENCE_H_ |
| +#define CC_SURFACES_SURFACE_SEQUENCE_H_ |
| + |
| +#include "base/compiler_specific.h" |
| + |
| +namespace cc { |
| + |
| +// A per-surface-namespace sequence number that's used to coordinate |
| +// dependencies between frames. A sequence number may be satisfied once, and |
| +// may be depended on once. |
| +struct SurfaceSequence { |
| + SurfaceSequence() : id_namespace(0), sequence(0) {} |
|
jamesr
2014/09/12 01:08:55
nit: 0u
jbauman
2014/09/23 01:58:05
Done.
|
| + explicit SurfaceSequence(uint32_t id_namespace, uint32_t sequence) |
| + : id_namespace(id_namespace), sequence(sequence) {} |
| + |
| + uint32_t id_namespace; |
| + uint32_t sequence; |
| +}; |
| + |
| +inline bool operator==(const SurfaceSequence& a, const SurfaceSequence& b) { |
| + return a.id_namespace == b.id_namespace && a.sequence == b.sequence; |
| +} |
| + |
| +inline bool operator!=(const SurfaceSequence& a, const SurfaceSequence& b) { |
| + return !(a == b); |
| +} |
| + |
| +inline bool operator<(const SurfaceSequence& a, const SurfaceSequence& b) { |
| + if (a.id_namespace != b.id_namespace) |
| + return a.id_namespace < b.id_namespace; |
| + return a.sequence < b.sequence; |
| +} |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_SURFACES_SURFACE_SEQUENCE_H_ |