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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <unordered_map> |
10 #include <utility> | 11 #include <utility> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/callback.h" | 14 #include "base/callback.h" |
14 #include "base/containers/hash_tables.h" | |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "cc/base/cc_export.h" | 16 #include "cc/base/cc_export.h" |
17 #include "cc/base/list_container.h" | 17 #include "cc/base/list_container.h" |
18 #include "cc/quads/render_pass_id.h" | 18 #include "cc/quads/render_pass_id.h" |
19 #include "cc/surfaces/surface_id.h" | 19 #include "cc/surfaces/surface_id.h" |
20 #include "skia/ext/refptr.h" | 20 #include "skia/ext/refptr.h" |
21 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
22 #include "ui/gfx/geometry/rect_f.h" | 22 #include "ui/gfx/geometry/rect_f.h" |
23 #include "ui/gfx/transform.h" | 23 #include "ui/gfx/transform.h" |
24 | 24 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 template <typename DrawQuadType> | 128 template <typename DrawQuadType> |
129 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { | 129 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { |
130 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); | 130 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); |
131 } | 131 } |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(RenderPass); | 133 DISALLOW_COPY_AND_ASSIGN(RenderPass); |
134 }; | 134 }; |
135 | 135 |
136 } // namespace cc | 136 } // namespace cc |
137 | 137 |
138 namespace BASE_HASH_NAMESPACE { | |
139 template <> | |
140 struct hash<cc::RenderPassId> { | |
141 size_t operator()(cc::RenderPassId key) const { | |
142 return base::HashPair(key.layer_id, static_cast<int>(key.index)); | |
143 } | |
144 }; | |
145 } // namespace BASE_HASH_NAMESPACE | |
146 | |
147 namespace cc { | 138 namespace cc { |
148 typedef std::vector<scoped_ptr<RenderPass>> RenderPassList; | 139 typedef std::vector<scoped_ptr<RenderPass>> RenderPassList; |
149 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; | 140 typedef std::unordered_map<RenderPassId, RenderPass*, RenderPassIdHash> |
| 141 RenderPassIdHashMap; |
150 } // namespace cc | 142 } // namespace cc |
151 | 143 |
152 #endif // CC_QUADS_RENDER_PASS_H_ | 144 #endif // CC_QUADS_RENDER_PASS_H_ |
OLD | NEW |