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

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

Issue 623383002: Align base::hash_map with C++11, part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hash-1
Patch Set: clean up stale includes 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 unified diff | Download patch
« no previous file with comments | « base/strings/string_piece.h ('k') | cc/surfaces/surface_id.h » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_H_ 5 #ifndef CC_QUADS_RENDER_PASS_H_
6 #define CC_QUADS_RENDER_PASS_H_ 6 #define CC_QUADS_RENDER_PASS_H_
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { 126 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) {
127 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); 127 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad));
128 } 128 }
129 129
130 DISALLOW_COPY_AND_ASSIGN(RenderPass); 130 DISALLOW_COPY_AND_ASSIGN(RenderPass);
131 }; 131 };
132 132
133 } // namespace cc 133 } // namespace cc
134 134
135 namespace BASE_HASH_NAMESPACE { 135 namespace BASE_HASH_NAMESPACE {
136 #if defined(COMPILER_MSVC)
137 inline size_t hash_value(const cc::RenderPassId& key) {
138 return base::HashPair(key.layer_id, key.index);
139 }
140 #elif defined(COMPILER_GCC)
141 template <> 136 template <>
142 struct hash<cc::RenderPassId> { 137 struct hash<cc::RenderPassId> {
143 size_t operator()(cc::RenderPassId key) const { 138 size_t operator()(cc::RenderPassId key) const {
144 return base::HashPair(key.layer_id, key.index); 139 return base::HashPair(key.layer_id, key.index);
145 } 140 }
146 }; 141 };
147 #else
148 #error define a hash function for your compiler
149 #endif // COMPILER
150 } // namespace BASE_HASH_NAMESPACE 142 } // namespace BASE_HASH_NAMESPACE
151 143
152 namespace cc { 144 namespace cc {
153 typedef ScopedPtrVector<RenderPass> RenderPassList; 145 typedef ScopedPtrVector<RenderPass> RenderPassList;
154 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; 146 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap;
155 } // namespace cc 147 } // namespace cc
156 148
157 #endif // CC_QUADS_RENDER_PASS_H_ 149 #endif // CC_QUADS_RENDER_PASS_H_
OLDNEW
« no previous file with comments | « base/strings/string_piece.h ('k') | cc/surfaces/surface_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698