Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_SURFACES_SURFACE_SEQUENCE_H_ | |
| 6 #define CC_SURFACES_SURFACE_SEQUENCE_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 | |
| 10 namespace cc { | |
| 11 | |
| 12 // A per-surface-namespace sequence number that's used to coordinate | |
| 13 // dependencies between frames. A sequence number may be satisfied once, and | |
| 14 // may be depended on once. | |
| 15 struct SurfaceSequence { | |
| 16 SurfaceSequence() : id_namespace(0), sequence(0) {} | |
|
jamesr
2014/09/12 01:08:55
nit: 0u
jbauman
2014/09/23 01:58:05
Done.
| |
| 17 explicit SurfaceSequence(uint32_t id_namespace, uint32_t sequence) | |
| 18 : id_namespace(id_namespace), sequence(sequence) {} | |
| 19 | |
| 20 uint32_t id_namespace; | |
| 21 uint32_t sequence; | |
| 22 }; | |
| 23 | |
| 24 inline bool operator==(const SurfaceSequence& a, const SurfaceSequence& b) { | |
| 25 return a.id_namespace == b.id_namespace && a.sequence == b.sequence; | |
| 26 } | |
| 27 | |
| 28 inline bool operator!=(const SurfaceSequence& a, const SurfaceSequence& b) { | |
| 29 return !(a == b); | |
| 30 } | |
| 31 | |
| 32 inline bool operator<(const SurfaceSequence& a, const SurfaceSequence& b) { | |
| 33 if (a.id_namespace != b.id_namespace) | |
| 34 return a.id_namespace < b.id_namespace; | |
| 35 return a.sequence < b.sequence; | |
| 36 } | |
| 37 | |
| 38 } // namespace cc | |
| 39 | |
| 40 #endif // CC_SURFACES_SURFACE_SEQUENCE_H_ | |
| OLD | NEW |