| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 12 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 14 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 13 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 15 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 14 #include "gpu/command_buffer/service/buffer_manager.h" | 16 #include "gpu/command_buffer/service/buffer_manager.h" |
| 15 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 17 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
| 16 #include "gpu/command_buffer/service/context_group.h" | 18 #include "gpu/command_buffer/service/context_group.h" |
| 17 #include "gpu/command_buffer/service/framebuffer_manager.h" | 19 #include "gpu/command_buffer/service/framebuffer_manager.h" |
| 18 #include "gpu/command_buffer/service/gl_context_mock.h" | 20 #include "gpu/command_buffer/service/gl_context_mock.h" |
| 19 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 21 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 20 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" | 22 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 static const GLint kBadUniformIndex = 1000; | 626 static const GLint kBadUniformIndex = 1000; |
| 625 | 627 |
| 626 static const GLint kOutputVariable1Size = 0; | 628 static const GLint kOutputVariable1Size = 0; |
| 627 static const GLenum kOutputVariable1Type = GL_FLOAT_VEC4; | 629 static const GLenum kOutputVariable1Type = GL_FLOAT_VEC4; |
| 628 static const GLuint kOutputVariable1ColorName = 7; | 630 static const GLuint kOutputVariable1ColorName = 7; |
| 629 static const GLuint kOutputVariable1Index = 0; | 631 static const GLuint kOutputVariable1Index = 0; |
| 630 static const char* kOutputVariable1Name; | 632 static const char* kOutputVariable1Name; |
| 631 static const char* kOutputVariable1NameESSL3; | 633 static const char* kOutputVariable1NameESSL3; |
| 632 | 634 |
| 633 // Use StrictMock to make 100% sure we know how GL will be called. | 635 // Use StrictMock to make 100% sure we know how GL will be called. |
| 634 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; | 636 std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_; |
| 635 scoped_refptr<gfx::GLSurfaceStub> surface_; | 637 scoped_refptr<gfx::GLSurfaceStub> surface_; |
| 636 scoped_refptr<GLContextMock> context_; | 638 scoped_refptr<GLContextMock> context_; |
| 637 scoped_ptr<MockGLES2Decoder> mock_decoder_; | 639 std::unique_ptr<MockGLES2Decoder> mock_decoder_; |
| 638 scoped_ptr<GLES2Decoder> decoder_; | 640 std::unique_ptr<GLES2Decoder> decoder_; |
| 639 MemoryTracker* memory_tracker_; | 641 MemoryTracker* memory_tracker_; |
| 640 | 642 |
| 641 GLuint client_buffer_id_; | 643 GLuint client_buffer_id_; |
| 642 GLuint client_framebuffer_id_; | 644 GLuint client_framebuffer_id_; |
| 643 GLuint client_program_id_; | 645 GLuint client_program_id_; |
| 644 GLuint client_renderbuffer_id_; | 646 GLuint client_renderbuffer_id_; |
| 645 GLuint client_sampler_id_; | 647 GLuint client_sampler_id_; |
| 646 GLuint client_shader_id_; | 648 GLuint client_shader_id_; |
| 647 GLuint client_texture_id_; | 649 GLuint client_texture_id_; |
| 648 GLuint client_element_buffer_id_; | 650 GLuint client_element_buffer_id_; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 private: | 753 private: |
| 752 GLuint bound_array_buffer_object_; | 754 GLuint bound_array_buffer_object_; |
| 753 GLuint bound_vertex_array_object_; | 755 GLuint bound_vertex_array_object_; |
| 754 }; // class MockGLStates | 756 }; // class MockGLStates |
| 755 | 757 |
| 756 void AddExpectationsForVertexAttribManager(); | 758 void AddExpectationsForVertexAttribManager(); |
| 757 void SetupMockGLBehaviors(); | 759 void SetupMockGLBehaviors(); |
| 758 | 760 |
| 759 void SetupInitStateManualExpectations(bool es3_capable); | 761 void SetupInitStateManualExpectations(bool es3_capable); |
| 760 | 762 |
| 761 scoped_ptr< ::testing::StrictMock<MockCommandBufferEngine> > engine_; | 763 std::unique_ptr<::testing::StrictMock<MockCommandBufferEngine>> engine_; |
| 762 GpuPreferences gpu_preferences_; | 764 GpuPreferences gpu_preferences_; |
| 763 scoped_refptr<ContextGroup> group_; | 765 scoped_refptr<ContextGroup> group_; |
| 764 MockGLStates gl_states_; | 766 MockGLStates gl_states_; |
| 765 base::MessageLoop message_loop_; | 767 base::MessageLoop message_loop_; |
| 766 }; | 768 }; |
| 767 | 769 |
| 768 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { | 770 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { |
| 769 public: | 771 public: |
| 770 GLES2DecoderWithShaderTestBase() | 772 GLES2DecoderWithShaderTestBase() |
| 771 : GLES2DecoderTestBase() { | 773 : GLES2DecoderTestBase() { |
| 772 } | 774 } |
| 773 | 775 |
| 774 protected: | 776 protected: |
| 775 void SetUp() override; | 777 void SetUp() override; |
| 776 void TearDown() override; | 778 void TearDown() override; |
| 777 }; | 779 }; |
| 778 | 780 |
| 779 // SpecializedSetup specializations that are needed in multiple unittest files. | 781 // SpecializedSetup specializations that are needed in multiple unittest files. |
| 780 template <> | 782 template <> |
| 781 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); | 783 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); |
| 782 | 784 |
| 783 } // namespace gles2 | 785 } // namespace gles2 |
| 784 } // namespace gpu | 786 } // namespace gpu |
| 785 | 787 |
| 786 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 788 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
| OLD | NEW |