OLD | NEW |
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 Loading... |
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_ |
OLD | NEW |