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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "cc/layers/append_quads_data.h" | 6 #include "cc/layers/append_quads_data.h" |
7 #include "cc/output/gl_renderer.h" | 7 #include "cc/output/gl_renderer.h" |
8 #include "cc/quads/draw_quad.h" | 8 #include "cc/quads/draw_quad.h" |
9 #include "cc/quads/picture_draw_quad.h" | 9 #include "cc/quads/picture_draw_quad.h" |
10 #include "cc/resources/platform_color.h" | 10 #include "cc/resources/platform_color.h" |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 FROM_HERE, | 696 FROM_HERE, |
697 base::Bind(&OtherCallback, &other_callback_count)); | 697 base::Bind(&OtherCallback, &other_callback_count)); |
698 | 698 |
699 base::MessageLoop::current()->Run(); | 699 base::MessageLoop::current()->Run(); |
700 | 700 |
701 // The sync point should have happened. | 701 // The sync point should have happened. |
702 EXPECT_EQ(1, sync_point_callback_count); | 702 EXPECT_EQ(1, sync_point_callback_count); |
703 EXPECT_EQ(1, other_callback_count); | 703 EXPECT_EQ(1, other_callback_count); |
704 } | 704 } |
705 | 705 |
706 TEST_F(GLRendererPixelTest, PictureDrawQuadIdentityScale) { | 706 TYPED_TEST(RendererPixelTest, PictureDrawQuadIdentityScale) { |
707 gfx::Size pile_tile_size(1000, 1000); | 707 gfx::Size pile_tile_size(1000, 1000); |
708 gfx::Rect viewport(this->device_viewport_size_); | 708 gfx::Rect viewport(this->device_viewport_size_); |
709 // TODO(enne): the renderer should figure this out on its own. | 709 // TODO(enne): the renderer should figure this out on its own. |
710 bool contents_swizzled = !PlatformColor::SameComponentOrder(GL_RGBA); | 710 bool contents_swizzled = !PlatformColor::SameComponentOrder(GL_RGBA); |
711 | 711 |
712 RenderPass::Id id(1, 1); | 712 RenderPass::Id id(1, 1); |
713 gfx::Transform transform_to_root; | 713 gfx::Transform transform_to_root; |
714 scoped_ptr<RenderPass> pass = | 714 scoped_ptr<RenderPass> pass = |
715 CreateTestRenderPass(id, viewport, transform_to_root); | 715 CreateTestRenderPass(id, viewport, transform_to_root); |
716 | 716 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 | 777 |
778 RenderPassList pass_list; | 778 RenderPassList pass_list; |
779 pass_list.push_back(pass.Pass()); | 779 pass_list.push_back(pass.Pass()); |
780 | 780 |
781 EXPECT_TRUE(this->RunPixelTest( | 781 EXPECT_TRUE(this->RunPixelTest( |
782 &pass_list, | 782 &pass_list, |
783 base::FilePath(FILE_PATH_LITERAL("green_with_blue_corner.png")), | 783 base::FilePath(FILE_PATH_LITERAL("green_with_blue_corner.png")), |
784 ExactPixelComparator(true))); | 784 ExactPixelComparator(true))); |
785 } | 785 } |
786 | 786 |
787 TEST_F(GLRendererPixelTest, PictureDrawQuadNonIdentityScale) { | 787 TYPED_TEST(RendererPixelTest, PictureDrawQuadNonIdentityScale) { |
788 gfx::Size pile_tile_size(1000, 1000); | 788 gfx::Size pile_tile_size(1000, 1000); |
789 gfx::Rect viewport(gfx::Size(200, 200)); | 789 gfx::Rect viewport(gfx::Size(200, 200)); |
790 // TODO(enne): the renderer should figure this out on its own. | 790 // TODO(enne): the renderer should figure this out on its own. |
791 bool contents_swizzled = !PlatformColor::SameComponentOrder(GL_RGBA); | 791 bool contents_swizzled = !PlatformColor::SameComponentOrder(GL_RGBA); |
792 | 792 |
793 RenderPass::Id id(1, 1); | 793 RenderPass::Id id(1, 1); |
794 gfx::Transform transform_to_root; | 794 gfx::Transform transform_to_root; |
795 scoped_ptr<RenderPass> pass = | 795 scoped_ptr<RenderPass> pass = |
796 CreateTestRenderPass(id, viewport, transform_to_root); | 796 CreateTestRenderPass(id, viewport, transform_to_root); |
797 | 797 |
(...skipping 15 matching lines...) Expand all Loading... |
813 green_pile->add_draw_rect_with_paint(green_rect2, green_paint); | 813 green_pile->add_draw_rect_with_paint(green_rect2, green_paint); |
814 green_pile->RerecordPile(); | 814 green_pile->RerecordPile(); |
815 | 815 |
816 scoped_ptr<SharedQuadState> top_right_green_shared_quad_state = | 816 scoped_ptr<SharedQuadState> top_right_green_shared_quad_state = |
817 CreateTestSharedQuadState(green_content_to_target_transform, viewport); | 817 CreateTestSharedQuadState(green_content_to_target_transform, viewport); |
818 | 818 |
819 scoped_ptr<PictureDrawQuad> green_quad1 = PictureDrawQuad::Create(); | 819 scoped_ptr<PictureDrawQuad> green_quad1 = PictureDrawQuad::Create(); |
820 green_quad1->SetNew(top_right_green_shared_quad_state.get(), | 820 green_quad1->SetNew(top_right_green_shared_quad_state.get(), |
821 green_rect1, | 821 green_rect1, |
822 gfx::Rect(), | 822 gfx::Rect(), |
823 green_rect1, | 823 gfx::RectF(green_rect1.size()), |
824 green_rect1.size(), | 824 green_rect1.size(), |
825 contents_swizzled, | 825 contents_swizzled, |
826 green_rect1, | 826 green_rect1, |
827 1.f, | 827 1.f, |
828 green_pile); | 828 green_pile); |
829 pass->quad_list.push_back(green_quad1.PassAs<DrawQuad>()); | 829 pass->quad_list.push_back(green_quad1.PassAs<DrawQuad>()); |
830 | 830 |
831 scoped_ptr<PictureDrawQuad> green_quad2 = PictureDrawQuad::Create(); | 831 scoped_ptr<PictureDrawQuad> green_quad2 = PictureDrawQuad::Create(); |
832 green_quad2->SetNew(top_right_green_shared_quad_state.get(), | 832 green_quad2->SetNew(top_right_green_shared_quad_state.get(), |
833 green_rect2, | 833 green_rect2, |
834 gfx::Rect(), | 834 gfx::Rect(), |
835 green_rect2, | 835 gfx::RectF(green_rect2.size()), |
836 green_rect2.size(), | 836 green_rect2.size(), |
837 contents_swizzled, | 837 contents_swizzled, |
838 green_rect2, | 838 green_rect2, |
839 1.f, | 839 1.f, |
840 green_pile); | 840 green_pile); |
841 pass->quad_list.push_back(green_quad2.PassAs<DrawQuad>()); | 841 pass->quad_list.push_back(green_quad2.PassAs<DrawQuad>()); |
842 | 842 |
843 // Add a green clipped checkerboard in the bottom right to help test | 843 // Add a green clipped checkerboard in the bottom right to help test |
844 // interleaving picture quad content and solid color content. | 844 // interleaving picture quad content and solid color content. |
845 gfx::Rect bottom_right_rect( | 845 gfx::Rect bottom_right_rect( |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 EXPECT_TRUE(this->RunPixelTest( | 925 EXPECT_TRUE(this->RunPixelTest( |
926 &pass_list, | 926 &pass_list, |
927 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), | 927 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), |
928 ExactPixelComparator(true))); | 928 ExactPixelComparator(true))); |
929 } | 929 } |
930 | 930 |
931 #endif // !defined(OS_ANDROID) | 931 #endif // !defined(OS_ANDROID) |
932 | 932 |
933 } // namespace | 933 } // namespace |
934 } // namespace cc | 934 } // namespace cc |
OLD | NEW |