Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: cc/quads/render_pass.h

Issue 368403003: Use RenderPass to create DrawQuad in unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@layerrawptrDQ
Patch Set: actually fix error this time Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698