Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: convert newly added scoped_ptr's Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 static const GLint kBadUniformIndex = 1000; 622 static const GLint kBadUniformIndex = 1000;
621 623
622 static const GLint kOutputVariable1Size = 0; 624 static const GLint kOutputVariable1Size = 0;
623 static const GLenum kOutputVariable1Type = GL_FLOAT_VEC4; 625 static const GLenum kOutputVariable1Type = GL_FLOAT_VEC4;
624 static const GLuint kOutputVariable1ColorName = 7; 626 static const GLuint kOutputVariable1ColorName = 7;
625 static const GLuint kOutputVariable1Index = 0; 627 static const GLuint kOutputVariable1Index = 0;
626 static const char* kOutputVariable1Name; 628 static const char* kOutputVariable1Name;
627 static const char* kOutputVariable1NameESSL3; 629 static const char* kOutputVariable1NameESSL3;
628 630
629 // Use StrictMock to make 100% sure we know how GL will be called. 631 // Use StrictMock to make 100% sure we know how GL will be called.
630 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; 632 std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_;
631 scoped_refptr<gfx::GLSurfaceStub> surface_; 633 scoped_refptr<gfx::GLSurfaceStub> surface_;
632 scoped_refptr<GLContextMock> context_; 634 scoped_refptr<GLContextMock> context_;
633 scoped_ptr<MockGLES2Decoder> mock_decoder_; 635 std::unique_ptr<MockGLES2Decoder> mock_decoder_;
634 scoped_ptr<GLES2Decoder> decoder_; 636 std::unique_ptr<GLES2Decoder> decoder_;
635 MemoryTracker* memory_tracker_; 637 MemoryTracker* memory_tracker_;
636 638
637 GLuint client_buffer_id_; 639 GLuint client_buffer_id_;
638 GLuint client_framebuffer_id_; 640 GLuint client_framebuffer_id_;
639 GLuint client_program_id_; 641 GLuint client_program_id_;
640 GLuint client_renderbuffer_id_; 642 GLuint client_renderbuffer_id_;
641 GLuint client_sampler_id_; 643 GLuint client_sampler_id_;
642 GLuint client_shader_id_; 644 GLuint client_shader_id_;
643 GLuint client_texture_id_; 645 GLuint client_texture_id_;
644 GLuint client_element_buffer_id_; 646 GLuint client_element_buffer_id_;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 private: 749 private:
748 GLuint bound_array_buffer_object_; 750 GLuint bound_array_buffer_object_;
749 GLuint bound_vertex_array_object_; 751 GLuint bound_vertex_array_object_;
750 }; // class MockGLStates 752 }; // class MockGLStates
751 753
752 void AddExpectationsForVertexAttribManager(); 754 void AddExpectationsForVertexAttribManager();
753 void SetupMockGLBehaviors(); 755 void SetupMockGLBehaviors();
754 756
755 void SetupInitStateManualExpectations(bool es3_capable); 757 void SetupInitStateManualExpectations(bool es3_capable);
756 758
757 scoped_ptr< ::testing::StrictMock<MockCommandBufferEngine> > engine_; 759 std::unique_ptr<::testing::StrictMock<MockCommandBufferEngine>> engine_;
758 GpuPreferences gpu_preferences_; 760 GpuPreferences gpu_preferences_;
759 scoped_refptr<ContextGroup> group_; 761 scoped_refptr<ContextGroup> group_;
760 MockGLStates gl_states_; 762 MockGLStates gl_states_;
761 base::MessageLoop message_loop_; 763 base::MessageLoop message_loop_;
762 }; 764 };
763 765
764 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { 766 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase {
765 public: 767 public:
766 GLES2DecoderWithShaderTestBase() 768 GLES2DecoderWithShaderTestBase()
767 : GLES2DecoderTestBase() { 769 : GLES2DecoderTestBase() {
768 } 770 }
769 771
770 protected: 772 protected:
771 void SetUp() override; 773 void SetUp() override;
772 void TearDown() override; 774 void TearDown() override;
773 }; 775 };
774 776
775 // SpecializedSetup specializations that are needed in multiple unittest files. 777 // SpecializedSetup specializations that are needed in multiple unittest files.
776 template <> 778 template <>
777 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); 779 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid);
778 780
779 } // namespace gles2 781 } // namespace gles2
780 } // namespace gpu 782 } // namespace gpu
781 783
782 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ 784 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698