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/render_pass.h" | 5 #include "cc/render_pass.h" |
6 | 6 |
7 #include "cc/checkerboard_draw_quad.h" | 7 #include "cc/checkerboard_draw_quad.h" |
8 #include "cc/math_util.h" | 8 #include "cc/math_util.h" |
9 #include "cc/test/geometry_test_utils.h" | 9 #include "cc/test/geometry_test_utils.h" |
10 #include "cc/test/render_pass_test_common.h" | 10 #include "cc/test/render_pass_test_common.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 scoped_ptr<TestRenderPass> pass = TestRenderPass::Create(); | 42 scoped_ptr<TestRenderPass> pass = TestRenderPass::Create(); |
43 pass->SetAll(id, | 43 pass->SetAll(id, |
44 outputRect, | 44 outputRect, |
45 damageRect, | 45 damageRect, |
46 transformToRoot, | 46 transformToRoot, |
47 hasTransparentBackground, | 47 hasTransparentBackground, |
48 hasOcclusionFromOutsideTargetSurface); | 48 hasOcclusionFromOutsideTargetSurface); |
49 | 49 |
50 // Stick a quad in the pass, this should not get copied. | 50 // Stick a quad in the pass, this should not get copied. |
51 scoped_ptr<SharedQuadState> sharedState = SharedQuadState::Create(); | 51 scoped_ptr<SharedQuadState> sharedState = SharedQuadState::Create(); |
52 sharedState->SetAll(gfx::Transform(), gfx::Rect(), gfx::Rect(), false, 1); | 52 sharedState->SetAll(gfx::Transform(), gfx::Size(), gfx::Rect(), gfx::Rect(),
false, 1); |
53 pass->AppendSharedQuadState(sharedState.Pass()); | 53 pass->AppendSharedQuadState(sharedState.Pass()); |
54 | 54 |
55 scoped_ptr<CheckerboardDrawQuad> checkerboardQuad = CheckerboardDrawQuad::Cr
eate(); | 55 scoped_ptr<CheckerboardDrawQuad> checkerboardQuad = CheckerboardDrawQuad::Cr
eate(); |
56 checkerboardQuad->SetNew(pass->shared_quad_state_list.back(), gfx::Rect(), S
kColor()); | 56 checkerboardQuad->SetNew(pass->shared_quad_state_list.back(), gfx::Rect(), S
kColor()); |
57 pass->quad_list.push_back(checkerboardQuad.PassAs<DrawQuad>()); | 57 pass->quad_list.push_back(checkerboardQuad.PassAs<DrawQuad>()); |
58 | 58 |
59 RenderPass::Id newId(63, 4); | 59 RenderPass::Id newId(63, 4); |
60 | 60 |
61 scoped_ptr<RenderPass> copy = pass->Copy(newId); | 61 scoped_ptr<RenderPass> copy = pass->Copy(newId); |
62 EXPECT_EQ(newId, copy->id); | 62 EXPECT_EQ(newId, copy->id); |
63 EXPECT_RECT_EQ(pass->output_rect, copy->output_rect); | 63 EXPECT_RECT_EQ(pass->output_rect, copy->output_rect); |
64 EXPECT_EQ(pass->transform_to_root_target, copy->transform_to_root_target); | 64 EXPECT_EQ(pass->transform_to_root_target, copy->transform_to_root_target); |
65 EXPECT_RECT_EQ(pass->damage_rect, copy->damage_rect); | 65 EXPECT_RECT_EQ(pass->damage_rect, copy->damage_rect); |
66 EXPECT_EQ(pass->has_transparent_background, copy->has_transparent_background
); | 66 EXPECT_EQ(pass->has_transparent_background, copy->has_transparent_background
); |
67 EXPECT_EQ(pass->has_occlusion_from_outside_target_surface, copy->has_occlusi
on_from_outside_target_surface); | 67 EXPECT_EQ(pass->has_occlusion_from_outside_target_surface, copy->has_occlusi
on_from_outside_target_surface); |
68 EXPECT_EQ(0u, copy->quad_list.size()); | 68 EXPECT_EQ(0u, copy->quad_list.size()); |
69 | 69 |
70 EXPECT_EQ(sizeof(RenderPassSize), sizeof(RenderPass)); | 70 EXPECT_EQ(sizeof(RenderPassSize), sizeof(RenderPass)); |
71 } | 71 } |
72 | 72 |
73 } // namespace | 73 } // namespace |
74 } // namespace cc | 74 } // namespace cc |
OLD | NEW |