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

Unified Diff: cc/quads/draw_quad_unittest.cc

Issue 380893004: Move Copy method from DrawQuad to RenderPass (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moreRP4DQ
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/quads/draw_quad.cc ('k') | cc/quads/render_pass.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/draw_quad_unittest.cc
diff --git a/cc/quads/draw_quad_unittest.cc b/cc/quads/draw_quad_unittest.cc
index f0f77190ffbe7c2d5f07d4b93aaf53f2baf4aa7f..f810b58ba15994c11af173d7b806644a3283e624 100644
--- a/cc/quads/draw_quad_unittest.cc
+++ b/cc/quads/draw_quad_unittest.cc
@@ -104,25 +104,34 @@ void CompareDrawQuad(DrawQuad* quad,
gfx::Rect ALLOW_UNUSED quad_opaque_rect(60, 55, 10, 10); \
bool ALLOW_UNUSED needs_blending = true;
-#define SETUP_AND_COPY_QUAD_NEW(Type, quad) \
- scoped_ptr<DrawQuad> copy_new(quad_new->Copy(copy_shared_state.get())); \
- CompareDrawQuad(quad_new.get(), copy_new.get(), copy_shared_state.get()); \
- const Type* ALLOW_UNUSED copy_quad = Type::MaterialCast(copy_new.get());
+#define SETUP_AND_COPY_QUAD_NEW(Type, quad) \
+ scoped_ptr<Type> copy_new(new Type(*quad_new)); \
danakj 2014/07/09 22:36:17 This was meant to test the Copy() method on DrawQu
+ copy_new->shared_quad_state = copy_shared_state.get(); \
+ CompareDrawQuad(quad_new.get(), copy_new.get(), copy_shared_state.get()); \
+ const Type* ALLOW_UNUSED copy_quad = copy_new.get();
-#define SETUP_AND_COPY_QUAD_ALL(Type, quad) \
- scoped_ptr<DrawQuad> copy_all(quad_all->Copy(copy_shared_state.get())); \
- CompareDrawQuad(quad_all.get(), copy_all.get(), copy_shared_state.get()); \
- copy_quad = Type::MaterialCast(copy_all.get());
+#define SETUP_AND_COPY_QUAD_ALL(Type, quad) \
+ scoped_ptr<Type> copy_all(new Type(*quad_all)); \
+ copy_all->shared_quad_state = copy_shared_state.get(); \
+ CompareDrawQuad(quad_all.get(), copy_all.get(), copy_shared_state.get()); \
+ copy_quad = copy_all.get();
-#define SETUP_AND_COPY_QUAD_NEW_1(Type, quad, a) \
- scoped_ptr<DrawQuad> copy_new(quad_new->Copy(copy_shared_state.get(), a)); \
- CompareDrawQuad(quad_new.get(), copy_new.get(), copy_shared_state.get()); \
- const Type* ALLOW_UNUSED copy_quad = Type::MaterialCast(copy_new.get());
+// By moving the Copy function to RenderPass, this unit test has to make copy
+// on its own. The only case when a copy function takes in an extra parameter
+// is RenderPassDrawQuad copy where extra parameter is RenderPass::Id.
+#define SETUP_AND_COPY_QUAD_NEW_1(Type, quad, a) \
+ scoped_ptr<Type> copy_new(new Type(*quad_new)); \
+ copy_new->shared_quad_state = copy_shared_state.get(); \
+ copy_new->render_pass_id = a; \
+ CompareDrawQuad(quad_new.get(), copy_new.get(), copy_shared_state.get()); \
+ const Type* ALLOW_UNUSED copy_quad = copy_new.get();
-#define SETUP_AND_COPY_QUAD_ALL_1(Type, quad, a) \
- scoped_ptr<DrawQuad> copy_all(quad_all->Copy(copy_shared_state.get(), a)); \
- CompareDrawQuad(quad_all.get(), copy_all.get(), copy_shared_state.get()); \
- copy_quad = Type::MaterialCast(copy_all.get());
+#define SETUP_AND_COPY_QUAD_ALL_1(Type, quad, a) \
+ scoped_ptr<Type> copy_all(new Type(*quad_all)); \
+ copy_all->shared_quad_state = copy_shared_state.get(); \
+ copy_all->render_pass_id = a; \
+ CompareDrawQuad(quad_all.get(), copy_all.get(), copy_shared_state.get()); \
+ copy_quad = copy_all.get();
#define CREATE_QUAD_1_NEW(Type, a) \
scoped_ptr<Type> quad_new(Type::Create()); \
« no previous file with comments | « cc/quads/draw_quad.cc ('k') | cc/quads/render_pass.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698