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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "cc/output/gl_renderer.h" | 9 #include "cc/output/gl_renderer.h" |
10 #include "cc/quads/draw_quad.h" | 10 #include "cc/quads/draw_quad.h" |
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1698 // the size of the child render pass. | 1698 // the size of the child render pass. |
1699 gfx::Rect sub_rect = gfx::Rect(50, 50, 200, 100); | 1699 gfx::Rect sub_rect = gfx::Rect(50, 50, 200, 100); |
1700 EXPECT_NE(sub_rect.x(), child_pass->output_rect.x()); | 1700 EXPECT_NE(sub_rect.x(), child_pass->output_rect.x()); |
1701 EXPECT_NE(sub_rect.y(), child_pass->output_rect.y()); | 1701 EXPECT_NE(sub_rect.y(), child_pass->output_rect.y()); |
1702 EXPECT_NE(sub_rect.right(), child_pass->output_rect.right()); | 1702 EXPECT_NE(sub_rect.right(), child_pass->output_rect.right()); |
1703 EXPECT_NE(sub_rect.bottom(), child_pass->output_rect.bottom()); | 1703 EXPECT_NE(sub_rect.bottom(), child_pass->output_rect.bottom()); |
1704 | 1704 |
1705 // Set up a mask on the RenderPassDrawQuad. | 1705 // Set up a mask on the RenderPassDrawQuad. |
1706 RenderPassDrawQuad* mask_quad = | 1706 RenderPassDrawQuad* mask_quad = |
1707 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); | 1707 root_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); |
1708 mask_quad->SetNew(root_pass_shared_state, | 1708 mask_quad->SetNew(root_pass_shared_state, sub_rect, sub_rect, child_pass_id, |
1709 sub_rect, | |
1710 sub_rect, | |
1711 child_pass_id, | |
1712 mask_resource_id, | 1709 mask_resource_id, |
1713 gfx::Vector2dF(2.f, 1.f), // mask_uv_scale | 1710 gfx::Vector2dF(2.f / mask_rect.width(), |
| 1711 2.f / mask_rect.height()), // mask_uv_scale |
1714 gfx::Size(mask_rect.size()), // mask_texture_size | 1712 gfx::Size(mask_rect.size()), // mask_texture_size |
1715 FilterOperations(), // foreground filters | 1713 FilterOperations(), // foreground filters |
1716 gfx::Vector2dF(), // filters scale | 1714 gfx::Vector2dF(), // filters scale |
1717 FilterOperations()); // background filters | 1715 FilterOperations()); // background filters |
1718 | 1716 |
1719 // White background behind the masked render pass. | 1717 // White background behind the masked render pass. |
1720 SolidColorDrawQuad* white = | 1718 SolidColorDrawQuad* white = |
1721 root_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 1719 root_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
1722 white->SetNew(root_pass_shared_state, | 1720 white->SetNew(root_pass_shared_state, |
1723 viewport_rect, | 1721 viewport_rect, |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2975 | 2973 |
2976 EXPECT_TRUE(this->RunPixelTest( | 2974 EXPECT_TRUE(this->RunPixelTest( |
2977 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), | 2975 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), |
2978 FuzzyPixelOffByOneComparator(true))); | 2976 FuzzyPixelOffByOneComparator(true))); |
2979 } | 2977 } |
2980 | 2978 |
2981 #endif // !defined(OS_ANDROID) | 2979 #endif // !defined(OS_ANDROID) |
2982 | 2980 |
2983 } // namespace | 2981 } // namespace |
2984 } // namespace cc | 2982 } // namespace cc |
OLD | NEW |