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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { | 123 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { |
124 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); | 124 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); |
125 } | 125 } |
126 | 126 |
127 DISALLOW_COPY_AND_ASSIGN(RenderPass); | 127 DISALLOW_COPY_AND_ASSIGN(RenderPass); |
128 }; | 128 }; |
129 | 129 |
130 } // namespace cc | 130 } // namespace cc |
131 | 131 |
132 namespace BASE_HASH_NAMESPACE { | 132 namespace BASE_HASH_NAMESPACE { |
133 #if defined(COMPILER_MSVC) | |
134 inline size_t hash_value(const cc::RenderPassId& key) { | |
135 return base::HashPair(key.layer_id, key.index); | |
136 } | |
137 #elif defined(COMPILER_GCC) | |
138 template <> | 133 template <> |
139 struct hash<cc::RenderPassId> { | 134 struct hash<cc::RenderPassId> { |
140 size_t operator()(cc::RenderPassId key) const { | 135 size_t operator()(cc::RenderPassId key) const { |
141 return base::HashPair(key.layer_id, key.index); | 136 return base::HashPair(key.layer_id, key.index); |
142 } | 137 } |
143 }; | 138 }; |
144 #else | |
145 #error define a hash function for your compiler | |
146 #endif // COMPILER | |
147 } // namespace BASE_HASH_NAMESPACE | 139 } // namespace BASE_HASH_NAMESPACE |
148 | 140 |
149 namespace cc { | 141 namespace cc { |
150 typedef ScopedPtrVector<RenderPass> RenderPassList; | 142 typedef ScopedPtrVector<RenderPass> RenderPassList; |
151 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; | 143 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; |
152 } // namespace cc | 144 } // namespace cc |
153 | 145 |
154 #endif // CC_QUADS_RENDER_PASS_H_ | 146 #endif // CC_QUADS_RENDER_PASS_H_ |
OLD | NEW |