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