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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 RendererSettings settings; | 718 RendererSettings settings; |
719 FakeRendererClient renderer_client; | 719 FakeRendererClient renderer_client; |
720 FakeRendererGL renderer(&renderer_client, | 720 FakeRendererGL renderer(&renderer_client, |
721 &settings, | 721 &settings, |
722 output_surface.get(), | 722 output_surface.get(), |
723 resource_provider.get()); | 723 resource_provider.get()); |
724 } | 724 } |
725 | 725 |
726 class ClearCountingContext : public TestWebGraphicsContext3D { | 726 class ClearCountingContext : public TestWebGraphicsContext3D { |
727 public: | 727 public: |
728 ClearCountingContext() { test_capabilities_.gpu.discard_framebuffer = true; } | 728 ClearCountingContext() { test_capabilities_.discard_framebuffer = true; } |
729 | 729 |
730 MOCK_METHOD3(discardFramebufferEXT, | 730 MOCK_METHOD3(discardFramebufferEXT, |
731 void(GLenum target, | 731 void(GLenum target, |
732 GLsizei numAttachments, | 732 GLsizei numAttachments, |
733 const GLenum* attachments)); | 733 const GLenum* attachments)); |
734 MOCK_METHOD1(clear, void(GLbitfield mask)); | 734 MOCK_METHOD1(clear, void(GLbitfield mask)); |
735 }; | 735 }; |
736 | 736 |
737 TEST_F(GLRendererTest, OpaqueBackground) { | 737 TEST_F(GLRendererTest, OpaqueBackground) { |
738 std::unique_ptr<ClearCountingContext> context_owned(new ClearCountingContext); | 738 std::unique_ptr<ClearCountingContext> context_owned(new ClearCountingContext); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 1.f, | 855 1.f, |
856 viewport_rect, | 856 viewport_rect, |
857 viewport_rect, | 857 viewport_rect, |
858 false); | 858 false); |
859 Mock::VerifyAndClearExpectations(context); | 859 Mock::VerifyAndClearExpectations(context); |
860 } | 860 } |
861 | 861 |
862 class TextureStateTrackingContext : public TestWebGraphicsContext3D { | 862 class TextureStateTrackingContext : public TestWebGraphicsContext3D { |
863 public: | 863 public: |
864 TextureStateTrackingContext() : active_texture_(GL_INVALID_ENUM) { | 864 TextureStateTrackingContext() : active_texture_(GL_INVALID_ENUM) { |
865 test_capabilities_.gpu.egl_image_external = true; | 865 test_capabilities_.egl_image_external = true; |
866 } | 866 } |
867 | 867 |
868 MOCK_METHOD1(waitSyncToken, void(const GLbyte* sync_token)); | 868 MOCK_METHOD1(waitSyncToken, void(const GLbyte* sync_token)); |
869 MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param)); | 869 MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param)); |
870 MOCK_METHOD4(drawElements, | 870 MOCK_METHOD4(drawElements, |
871 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset)); | 871 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset)); |
872 | 872 |
873 virtual void activeTexture(GLenum texture) { | 873 virtual void activeTexture(GLenum texture) { |
874 EXPECT_NE(texture, active_texture_); | 874 EXPECT_NE(texture, active_texture_); |
875 active_texture_ = texture; | 875 active_texture_ = texture; |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 1.f, | 1742 1.f, |
1743 viewport_rect, | 1743 viewport_rect, |
1744 viewport_rect, | 1744 viewport_rect, |
1745 false); | 1745 false); |
1746 | 1746 |
1747 TestSolidColorProgramAA(); | 1747 TestSolidColorProgramAA(); |
1748 } | 1748 } |
1749 | 1749 |
1750 class OutputSurfaceMockContext : public TestWebGraphicsContext3D { | 1750 class OutputSurfaceMockContext : public TestWebGraphicsContext3D { |
1751 public: | 1751 public: |
1752 OutputSurfaceMockContext() { test_capabilities_.gpu.post_sub_buffer = true; } | 1752 OutputSurfaceMockContext() { test_capabilities_.post_sub_buffer = true; } |
1753 | 1753 |
1754 // Specifically override methods even if they are unused (used in conjunction | 1754 // Specifically override methods even if they are unused (used in conjunction |
1755 // with StrictMock). We need to make sure that GLRenderer does not issue | 1755 // with StrictMock). We need to make sure that GLRenderer does not issue |
1756 // framebuffer-related GLuint calls directly. Instead these are supposed to go | 1756 // framebuffer-related GLuint calls directly. Instead these are supposed to go |
1757 // through the OutputSurface abstraction. | 1757 // through the OutputSurface abstraction. |
1758 MOCK_METHOD2(bindFramebuffer, void(GLenum target, GLuint framebuffer)); | 1758 MOCK_METHOD2(bindFramebuffer, void(GLenum target, GLuint framebuffer)); |
1759 MOCK_METHOD3(reshapeWithScaleFactor, | 1759 MOCK_METHOD3(reshapeWithScaleFactor, |
1760 void(int width, int height, float scale_factor)); | 1760 void(int width, int height, float scale_factor)); |
1761 MOCK_METHOD4(drawElements, | 1761 MOCK_METHOD4(drawElements, |
1762 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset)); | 1762 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset)); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 EXPECT_CALL(overlay_scheduler, | 2235 EXPECT_CALL(overlay_scheduler, |
2236 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, | 2236 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, |
2237 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); | 2237 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); |
2238 | 2238 |
2239 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, | 2239 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, |
2240 viewport_rect, false); | 2240 viewport_rect, false); |
2241 } | 2241 } |
2242 | 2242 |
2243 } // namespace | 2243 } // namespace |
2244 } // namespace cc | 2244 } // namespace cc |
OLD | NEW |