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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 | 88 |
89 scoped_ptr<base::Value> AsValue() const; | 89 scoped_ptr<base::Value> AsValue() const; |
90 | 90 |
91 SharedQuadState* CreateAndAppendSharedQuadState(); | 91 SharedQuadState* CreateAndAppendSharedQuadState(); |
92 template <typename DrawQuadType> | 92 template <typename DrawQuadType> |
93 DrawQuadType* CreateAndAppendDrawQuad() { | 93 DrawQuadType* CreateAndAppendDrawQuad() { |
94 scoped_ptr<DrawQuadType> draw_quad = DrawQuadType::Create(); | 94 scoped_ptr<DrawQuadType> draw_quad = DrawQuadType::Create(); |
95 quad_list.push_back(draw_quad.template PassAs<DrawQuad>()); | 95 quad_list.push_back(draw_quad.template PassAs<DrawQuad>()); |
96 return static_cast<DrawQuadType*>(quad_list.back()); | 96 return static_cast<DrawQuadType*>(quad_list.back()); |
97 } | 97 } |
98 template <typename DrawQuadType> | |
99 DrawQuadType* CopyFromAndAppendDrawQuad(const DrawQuadType* quad) { | |
danakj
2014/07/07 22:30:15
Can we do two methods:
1. that takes DrawQuad* an
weiliangc
2014/07/08 21:54:38
Done.
| |
100 scoped_ptr<DrawQuadType> draw_quad = | |
101 make_scoped_ptr(new DrawQuadType(*quad)); | |
102 quad_list.push_back(draw_quad.template PassAs<DrawQuad>()); | |
103 return static_cast<DrawQuadType*>(quad_list.back()); | |
104 } | |
98 | 105 |
99 // Uniquely identifies the render pass in the compositor's current frame. | 106 // Uniquely identifies the render pass in the compositor's current frame. |
100 Id id; | 107 Id id; |
101 | 108 |
102 // These are in the space of the render pass' physical pixels. | 109 // These are in the space of the render pass' physical pixels. |
103 gfx::Rect output_rect; | 110 gfx::Rect output_rect; |
104 gfx::Rect damage_rect; | 111 gfx::Rect damage_rect; |
105 | 112 |
106 // Transforms from the origin of the |output_rect| to the origin of the root | 113 // Transforms from the origin of the |output_rect| to the origin of the root |
107 // render pass' |output_rect|. | 114 // render pass' |output_rect|. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 #error define a hash function for your compiler | 152 #error define a hash function for your compiler |
146 #endif // COMPILER | 153 #endif // COMPILER |
147 } // namespace BASE_HASH_NAMESPACE | 154 } // namespace BASE_HASH_NAMESPACE |
148 | 155 |
149 namespace cc { | 156 namespace cc { |
150 typedef ScopedPtrVector<RenderPass> RenderPassList; | 157 typedef ScopedPtrVector<RenderPass> RenderPassList; |
151 typedef base::hash_map<RenderPass::Id, RenderPass*> RenderPassIdHashMap; | 158 typedef base::hash_map<RenderPass::Id, RenderPass*> RenderPassIdHashMap; |
152 } // namespace cc | 159 } // namespace cc |
153 | 160 |
154 #endif // CC_QUADS_RENDER_PASS_H_ | 161 #endif // CC_QUADS_RENDER_PASS_H_ |
OLD | NEW |