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/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
10 #include "cc/output/compositor_frame_metadata.h" | 10 #include "cc/output/compositor_frame_metadata.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
740 renderer.SetVisible(false); | 740 renderer.SetVisible(false); |
741 EXPECT_TRUE(context->last_call_was_set_visibility()); | 741 EXPECT_TRUE(context->last_call_was_set_visibility()); |
742 } | 742 } |
743 | 743 |
744 class TextureStateTrackingContext : public TestWebGraphicsContext3D { | 744 class TextureStateTrackingContext : public TestWebGraphicsContext3D { |
745 public: | 745 public: |
746 TextureStateTrackingContext() : active_texture_(GL_INVALID_ENUM) { | 746 TextureStateTrackingContext() : active_texture_(GL_INVALID_ENUM) { |
747 test_capabilities_.gpu.egl_image_external = true; | 747 test_capabilities_.gpu.egl_image_external = true; |
748 } | 748 } |
749 | 749 |
750 MOCK_METHOD1(waitSyncPoint, void(unsigned sync_point)); | |
750 MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param)); | 751 MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param)); |
751 MOCK_METHOD4(drawElements, | 752 MOCK_METHOD4(drawElements, |
752 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset)); | 753 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset)); |
753 | 754 |
754 virtual void activeTexture(GLenum texture) { | 755 virtual void activeTexture(GLenum texture) { |
755 EXPECT_NE(texture, active_texture_); | 756 EXPECT_NE(texture, active_texture_); |
756 active_texture_ = texture; | 757 active_texture_ = texture; |
757 } | 758 } |
758 | 759 |
759 GLenum active_texture() const { return active_texture_; } | 760 GLenum active_texture() const { return active_texture_; } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
794 RenderPass::Id(2, 1)); | 795 RenderPass::Id(2, 1)); |
795 | 796 |
796 renderer.DecideRenderPassAllocationsForFrame(render_passes_in_draw_order_); | 797 renderer.DecideRenderPassAllocationsForFrame(render_passes_in_draw_order_); |
797 | 798 |
798 // Set up expected texture filter state transitions that match the quads | 799 // Set up expected texture filter state transitions that match the quads |
799 // created in AppendOneOfEveryQuadType(). | 800 // created in AppendOneOfEveryQuadType(). |
800 Mock::VerifyAndClearExpectations(context); | 801 Mock::VerifyAndClearExpectations(context); |
801 { | 802 { |
802 InSequence sequence; | 803 InSequence sequence; |
803 | 804 |
805 EXPECT_CALL(*context, waitSyncPoint(TestRenderPass::kTestSyncPoint)) | |
danakj
2014/08/15 21:32:34
Can you add a comment here like
// The sync points
vmiura
2014/08/15 21:54:59
Done.
| |
806 .Times(1); | |
807 | |
804 // yuv_quad is drawn with the default linear filter. | 808 // yuv_quad is drawn with the default linear filter. |
805 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 809 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
806 | 810 |
807 // tile_quad is drawn with GL_NEAREST because it is not transformed or | 811 // tile_quad is drawn with GL_NEAREST because it is not transformed or |
808 // scaled. | 812 // scaled. |
809 EXPECT_CALL( | 813 EXPECT_CALL( |
810 *context, | 814 *context, |
811 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); | 815 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); |
812 EXPECT_CALL( | 816 EXPECT_CALL( |
813 *context, | 817 *context, |
814 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)); | 818 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)); |
815 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 819 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
816 | 820 |
817 // transformed_tile_quad uses GL_LINEAR. | 821 // transformed_tile_quad uses GL_LINEAR. |
818 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 822 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
819 | 823 |
820 // scaled_tile_quad also uses GL_LINEAR. | 824 // scaled_tile_quad also uses GL_LINEAR. |
821 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 825 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
822 | 826 |
823 // The remaining quads also use GL_LINEAR because nearest neighbor | 827 // The remaining quads also use GL_LINEAR because nearest neighbor |
824 // filtering is currently only used with tile quads. | 828 // filtering is currently only used with tile quads. |
825 EXPECT_CALL(*context, drawElements(_, _, _, _)).Times(6); | 829 EXPECT_CALL(*context, drawElements(_, _, _, _)).Times(7); |
826 } | 830 } |
827 | 831 |
828 gfx::Rect viewport_rect(100, 100); | 832 gfx::Rect viewport_rect(100, 100); |
829 renderer.DrawFrame(&render_passes_in_draw_order_, | 833 renderer.DrawFrame(&render_passes_in_draw_order_, |
830 1.f, | 834 1.f, |
831 viewport_rect, | 835 viewport_rect, |
832 viewport_rect, | 836 viewport_rect, |
833 false); | 837 false); |
834 Mock::VerifyAndClearExpectations(context); | 838 Mock::VerifyAndClearExpectations(context); |
835 } | 839 } |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1755 base::MessageLoop::current()->Run(); | 1759 base::MessageLoop::current()->Run(); |
1756 | 1760 |
1757 // The sync point should have happened. | 1761 // The sync point should have happened. |
1758 EXPECT_EQ(1, sync_point_callback_count); | 1762 EXPECT_EQ(1, sync_point_callback_count); |
1759 EXPECT_EQ(1, other_callback_count); | 1763 EXPECT_EQ(1, other_callback_count); |
1760 } | 1764 } |
1761 #endif // OS_ANDROID | 1765 #endif // OS_ANDROID |
1762 | 1766 |
1763 } // namespace | 1767 } // namespace |
1764 } // namespace cc | 1768 } // namespace cc |
OLD | NEW |