| 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 23 matching lines...) Expand all Loading... |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 static void CompareRenderPassLists(const RenderPassList& expected_list, | 36 static void CompareRenderPassLists(const RenderPassList& expected_list, |
| 37 const RenderPassList& actual_list) { | 37 const RenderPassList& actual_list) { |
| 38 EXPECT_EQ(expected_list.size(), actual_list.size()); | 38 EXPECT_EQ(expected_list.size(), actual_list.size()); |
| 39 for (size_t i = 0; i < actual_list.size(); ++i) { | 39 for (size_t i = 0; i < actual_list.size(); ++i) { |
| 40 RenderPass* expected = expected_list[i]; | 40 RenderPass* expected = expected_list[i]; |
| 41 RenderPass* actual = actual_list[i]; | 41 RenderPass* actual = actual_list[i]; |
| 42 | 42 |
| 43 EXPECT_EQ(expected->id, actual->id); | 43 EXPECT_EQ(expected->id, actual->id); |
| 44 EXPECT_RECT_EQ(expected->output_rect, actual->output_rect); | 44 EXPECT_EQ(expected->output_rect, actual->output_rect); |
| 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_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 (auto exp_iter = expected->quad_list.cbegin(), | 55 for (auto exp_iter = expected->quad_list.cbegin(), |
| 56 act_iter = actual->quad_list.cbegin(); | 56 act_iter = actual->quad_list.cbegin(); |
| 57 exp_iter != expected->quad_list.cend(); | 57 exp_iter != expected->quad_list.cend(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 CheckerboardDrawQuad* checkerboard_quad = | 93 CheckerboardDrawQuad* checkerboard_quad = |
| 94 pass->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); | 94 pass->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); |
| 95 checkerboard_quad->SetNew( | 95 checkerboard_quad->SetNew( |
| 96 pass->shared_quad_state_list.back(), gfx::Rect(), gfx::Rect(), SkColor()); | 96 pass->shared_quad_state_list.back(), gfx::Rect(), gfx::Rect(), SkColor()); |
| 97 | 97 |
| 98 RenderPassId new_id(63, 4); | 98 RenderPassId new_id(63, 4); |
| 99 | 99 |
| 100 scoped_ptr<RenderPass> copy = pass->Copy(new_id); | 100 scoped_ptr<RenderPass> copy = pass->Copy(new_id); |
| 101 EXPECT_EQ(new_id, copy->id); | 101 EXPECT_EQ(new_id, copy->id); |
| 102 EXPECT_RECT_EQ(pass->output_rect, copy->output_rect); | 102 EXPECT_EQ(pass->output_rect, copy->output_rect); |
| 103 EXPECT_EQ(pass->transform_to_root_target, copy->transform_to_root_target); | 103 EXPECT_EQ(pass->transform_to_root_target, copy->transform_to_root_target); |
| 104 EXPECT_RECT_EQ(pass->damage_rect, copy->damage_rect); | 104 EXPECT_EQ(pass->damage_rect, copy->damage_rect); |
| 105 EXPECT_EQ(pass->has_transparent_background, copy->has_transparent_background); | 105 EXPECT_EQ(pass->has_transparent_background, copy->has_transparent_background); |
| 106 EXPECT_EQ(0u, copy->quad_list.size()); | 106 EXPECT_EQ(0u, copy->quad_list.size()); |
| 107 | 107 |
| 108 // The copy request should not be copied/duplicated. | 108 // The copy request should not be copied/duplicated. |
| 109 EXPECT_EQ(1u, pass->copy_requests.size()); | 109 EXPECT_EQ(1u, pass->copy_requests.size()); |
| 110 EXPECT_EQ(0u, copy->copy_requests.size()); | 110 EXPECT_EQ(0u, copy->copy_requests.size()); |
| 111 | 111 |
| 112 EXPECT_EQ(sizeof(RenderPassSize), sizeof(RenderPass)); | 112 EXPECT_EQ(sizeof(RenderPassSize), sizeof(RenderPass)); |
| 113 } | 113 } |
| 114 | 114 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 // Make a copy with CopyAll(). | 316 // Make a copy with CopyAll(). |
| 317 RenderPassList copy_list; | 317 RenderPassList copy_list; |
| 318 RenderPass::CopyAll(pass_list, ©_list); | 318 RenderPass::CopyAll(pass_list, ©_list); |
| 319 | 319 |
| 320 CompareRenderPassLists(pass_list, copy_list); | 320 CompareRenderPassLists(pass_list, copy_list); |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace | 323 } // namespace |
| 324 } // namespace cc | 324 } // namespace cc |
| OLD | NEW |