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

Side by Side Diff: cc/quads/render_pass_id.h

Issue 1502373009: Allow std::unordered_*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, more HashPair -> HashInts Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « cc/quads/render_pass.h ('k') | cc/quads/render_pass_id.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_QUADS_RENDER_PASS_ID_H_ 5 #ifndef CC_QUADS_RENDER_PASS_ID_H_
6 #define CC_QUADS_RENDER_PASS_ID_H_ 6 #define CC_QUADS_RENDER_PASS_ID_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <tuple> 10 #include <tuple>
11 11
12 #include "base/containers/hash_tables.h"
13 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
14 13
15 namespace cc { 14 namespace cc {
16 15
17 class CC_EXPORT RenderPassId { 16 class CC_EXPORT RenderPassId {
18 public: 17 public:
19 int layer_id; 18 int layer_id;
20 size_t index; 19 size_t index;
21 20
22 RenderPassId() : layer_id(-1), index(0) {} 21 RenderPassId() : layer_id(-1), index(0) {}
23 RenderPassId(int layer_id, size_t index) : layer_id(layer_id), index(index) {} 22 RenderPassId(int layer_id, size_t index) : layer_id(layer_id), index(index) {}
24 void* AsTracingId() const; 23 void* AsTracingId() const;
25 24
26 bool IsValid() const { return layer_id >= 0; } 25 bool IsValid() const { return layer_id >= 0; }
27 26
28 bool operator==(const RenderPassId& other) const { 27 bool operator==(const RenderPassId& other) const {
29 return layer_id == other.layer_id && index == other.index; 28 return layer_id == other.layer_id && index == other.index;
30 } 29 }
31 bool operator!=(const RenderPassId& other) const { return !(*this == other); } 30 bool operator!=(const RenderPassId& other) const { return !(*this == other); }
32 bool operator<(const RenderPassId& other) const { 31 bool operator<(const RenderPassId& other) const {
33 return std::tie(layer_id, index) < std::tie(other.layer_id, other.index); 32 return std::tie(layer_id, index) < std::tie(other.layer_id, other.index);
34 } 33 }
35 }; 34 };
36 35
37 } // namespace cc 36 } // namespace cc
38 37
39 #endif // CC_QUADS_RENDER_PASS_ID_H_ 38 #endif // CC_QUADS_RENDER_PASS_ID_H_
OLDNEW
« no previous file with comments | « cc/quads/render_pass.h ('k') | cc/quads/render_pass_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698