| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "cc/quads/render_pass.h" | 5 #include "cc/quads/render_pass.h" |
| 6 | 6 |
| 7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
| 8 #include "cc/base/scoped_ptr_vector.h" | 8 #include "cc/base/scoped_ptr_vector.h" |
| 9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
| 10 #include "cc/quads/checkerboard_draw_quad.h" | 10 #include "cc/quads/checkerboard_draw_quad.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 EXPECT_EQ(expected->transform_to_root_target, | 45 EXPECT_EQ(expected->transform_to_root_target, |
| 46 actual->transform_to_root_target); | 46 actual->transform_to_root_target); |
| 47 EXPECT_RECT_EQ(expected->damage_rect, actual->damage_rect); | 47 EXPECT_RECT_EQ(expected->damage_rect, actual->damage_rect); |
| 48 EXPECT_EQ(expected->has_transparent_background, | 48 EXPECT_EQ(expected->has_transparent_background, |
| 49 actual->has_transparent_background); | 49 actual->has_transparent_background); |
| 50 | 50 |
| 51 EXPECT_EQ(expected->shared_quad_state_list.size(), | 51 EXPECT_EQ(expected->shared_quad_state_list.size(), |
| 52 actual->shared_quad_state_list.size()); | 52 actual->shared_quad_state_list.size()); |
| 53 EXPECT_EQ(expected->quad_list.size(), actual->quad_list.size()); | 53 EXPECT_EQ(expected->quad_list.size(), actual->quad_list.size()); |
| 54 | 54 |
| 55 for (size_t i = 0; i < expected->quad_list.size(); ++i) { | 55 for (QuadList::Iterator exp_iter = expected->quad_list.begin(), |
| 56 EXPECT_EQ(expected->quad_list[i]->rect.ToString(), | 56 act_iter = actual->quad_list.begin(); |
| 57 actual->quad_list[i]->rect.ToString()); | 57 exp_iter != expected->quad_list.end(); |
| 58 EXPECT_EQ( | 58 ++exp_iter, ++act_iter) { |
| 59 expected->quad_list[i]->shared_quad_state->content_bounds.ToString(), | 59 EXPECT_EQ(exp_iter->rect.ToString(), act_iter->rect.ToString()); |
| 60 actual->quad_list[i]->shared_quad_state->content_bounds.ToString()); | 60 EXPECT_EQ(exp_iter->shared_quad_state->content_bounds.ToString(), |
| 61 act_iter->shared_quad_state->content_bounds.ToString()); |
| 61 } | 62 } |
| 62 } | 63 } |
| 63 } | 64 } |
| 64 | 65 |
| 65 TEST(RenderPassTest, CopyShouldBeIdenticalExceptIdAndQuads) { | 66 TEST(RenderPassTest, CopyShouldBeIdenticalExceptIdAndQuads) { |
| 66 RenderPassId id(3, 2); | 67 RenderPassId id(3, 2); |
| 67 gfx::Rect output_rect(45, 22, 120, 13); | 68 gfx::Rect output_rect(45, 22, 120, 13); |
| 68 gfx::Transform transform_to_root = | 69 gfx::Transform transform_to_root = |
| 69 gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0); | 70 gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0); |
| 70 gfx::Rect damage_rect(56, 123, 19, 43); | 71 gfx::Rect damage_rect(56, 123, 19, 43); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 314 |
| 314 // Make a copy with CopyAll(). | 315 // Make a copy with CopyAll(). |
| 315 RenderPassList copy_list; | 316 RenderPassList copy_list; |
| 316 RenderPass::CopyAll(pass_list, ©_list); | 317 RenderPass::CopyAll(pass_list, ©_list); |
| 317 | 318 |
| 318 CompareRenderPassLists(pass_list, copy_list); | 319 CompareRenderPassLists(pass_list, copy_list); |
| 319 } | 320 } |
| 320 | 321 |
| 321 } // namespace | 322 } // namespace |
| 322 } // namespace cc | 323 } // namespace cc |
| OLD | NEW |