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 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "cc/base/math_util.h" |
10 #include "cc/output/gl_renderer.h" | 11 #include "cc/output/gl_renderer.h" |
11 #include "cc/quads/draw_quad.h" | 12 #include "cc/quads/draw_quad.h" |
12 #include "cc/quads/picture_draw_quad.h" | 13 #include "cc/quads/picture_draw_quad.h" |
13 #include "cc/quads/texture_draw_quad.h" | 14 #include "cc/quads/texture_draw_quad.h" |
14 #include "cc/resources/video_resource_updater.h" | 15 #include "cc/resources/video_resource_updater.h" |
15 #include "cc/test/fake_raster_source.h" | 16 #include "cc/test/fake_raster_source.h" |
16 #include "cc/test/fake_recording_source.h" | 17 #include "cc/test/fake_recording_source.h" |
17 #include "cc/test/pixel_test.h" | 18 #include "cc/test/pixel_test.h" |
18 #include "gpu/command_buffer/client/gles2_interface.h" | 19 #include "gpu/command_buffer/client/gles2_interface.h" |
19 #include "media/base/video_frame.h" | 20 #include "media/base/video_frame.h" |
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 | 1711 |
1711 SharedQuadState* pass_shared_state = | 1712 SharedQuadState* pass_shared_state = |
1712 CreateTestSharedQuadState(gfx::Transform(), pass_rect, root_pass.get()); | 1713 CreateTestSharedQuadState(gfx::Transform(), pass_rect, root_pass.get()); |
1713 CreateTestRenderPassDrawQuad( | 1714 CreateTestRenderPassDrawQuad( |
1714 pass_shared_state, pass_rect, child_pass_id, root_pass.get()); | 1715 pass_shared_state, pass_rect, child_pass_id, root_pass.get()); |
1715 | 1716 |
1716 RenderPassList pass_list; | 1717 RenderPassList pass_list; |
1717 pass_list.push_back(std::move(child_pass)); | 1718 pass_list.push_back(std::move(child_pass)); |
1718 pass_list.push_back(std::move(root_pass)); | 1719 pass_list.push_back(std::move(root_pass)); |
1719 | 1720 |
1720 this->renderer_->SetEnlargePassTextureAmount(gfx::Size(50, 75)); | 1721 this->renderer_->SetEnlargePassTextureAmountForTesting(gfx::Size(50, 75)); |
1721 | 1722 |
1722 EXPECT_TRUE(this->RunPixelTest( | 1723 EXPECT_TRUE(this->RunPixelTest( |
1723 &pass_list, | 1724 &pass_list, |
1724 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")), | 1725 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")), |
1725 ExactPixelComparator(true))); | 1726 ExactPixelComparator(true))); |
1726 } | 1727 } |
1727 | 1728 |
1728 TYPED_TEST(RendererPixelTest, EnlargedRenderPassTextureWithAntiAliasing) { | 1729 TYPED_TEST(RendererPixelTest, EnlargedRenderPassTextureWithAntiAliasing) { |
1729 gfx::Rect viewport_rect(this->device_viewport_size_); | 1730 gfx::Rect viewport_rect(this->device_viewport_size_); |
1730 | 1731 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 background->SetNew(root_shared_state, | 1773 background->SetNew(root_shared_state, |
1773 gfx::Rect(this->device_viewport_size_), | 1774 gfx::Rect(this->device_viewport_size_), |
1774 gfx::Rect(this->device_viewport_size_), | 1775 gfx::Rect(this->device_viewport_size_), |
1775 SK_ColorWHITE, | 1776 SK_ColorWHITE, |
1776 false); | 1777 false); |
1777 | 1778 |
1778 RenderPassList pass_list; | 1779 RenderPassList pass_list; |
1779 pass_list.push_back(std::move(child_pass)); | 1780 pass_list.push_back(std::move(child_pass)); |
1780 pass_list.push_back(std::move(root_pass)); | 1781 pass_list.push_back(std::move(root_pass)); |
1781 | 1782 |
1782 this->renderer_->SetEnlargePassTextureAmount(gfx::Size(50, 75)); | 1783 this->renderer_->SetEnlargePassTextureAmountForTesting(gfx::Size(50, 75)); |
1783 | 1784 |
1784 EXPECT_TRUE(this->RunPixelTest( | 1785 EXPECT_TRUE(this->RunPixelTest( |
1785 &pass_list, | 1786 &pass_list, |
1786 base::FilePath(FILE_PATH_LITERAL("blue_yellow_anti_aliasing.png")), | 1787 base::FilePath(FILE_PATH_LITERAL("blue_yellow_anti_aliasing.png")), |
1787 FuzzyPixelOffByOneComparator(true))); | 1788 FuzzyPixelOffByOneComparator(true))); |
1788 } | 1789 } |
1789 | 1790 |
1790 // This tests the case where we have a RenderPass with a mask, but the quad | 1791 // This tests the case where we have a RenderPass with a mask, but the quad |
1791 // for the masked surface does not include the full surface texture. | 1792 // for the masked surface does not include the full surface texture. |
1792 TYPED_TEST(RendererPixelTest, RenderPassAndMaskWithPartialQuad) { | 1793 TYPED_TEST(RendererPixelTest, RenderPassAndMaskWithPartialQuad) { |
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3195 | 3196 |
3196 EXPECT_TRUE(this->RunPixelTest( | 3197 EXPECT_TRUE(this->RunPixelTest( |
3197 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), | 3198 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), |
3198 FuzzyPixelOffByOneComparator(true))); | 3199 FuzzyPixelOffByOneComparator(true))); |
3199 } | 3200 } |
3200 | 3201 |
3201 #endif // !defined(OS_ANDROID) | 3202 #endif // !defined(OS_ANDROID) |
3202 | 3203 |
3203 } // namespace | 3204 } // namespace |
3204 } // namespace cc | 3205 } // namespace cc |
OLD | NEW |