| 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 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 11 #include "gpu/command_buffer/common/gl_mock.h" | 12 #include "gpu/command_buffer/common/gl_mock.h" |
| 12 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 13 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 13 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 14 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 14 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 15 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
| 15 #include "gpu/command_buffer/service/context_group.h" | 16 #include "gpu/command_buffer/service/context_group.h" |
| 16 #include "gpu/command_buffer/service/program_manager.h" | 17 #include "gpu/command_buffer/service/program_manager.h" |
| 17 #include "gpu/command_buffer/service/test_helper.h" | 18 #include "gpu/command_buffer/service/test_helper.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 const char* extensions, | 77 const char* extensions, |
| 77 bool has_alpha, | 78 bool has_alpha, |
| 78 bool has_depth, | 79 bool has_depth, |
| 79 bool has_stencil, | 80 bool has_stencil, |
| 80 bool request_alpha, | 81 bool request_alpha, |
| 81 bool request_depth, | 82 bool request_depth, |
| 82 bool request_stencil, | 83 bool request_stencil, |
| 83 bool bind_generates_resource) { | 84 bool bind_generates_resource) { |
| 84 gl_.reset(new StrictMock<MockGLInterface>()); | 85 gl_.reset(new StrictMock<MockGLInterface>()); |
| 85 ::gfx::GLInterface::SetGLInterface(gl_.get()); | 86 ::gfx::GLInterface::SetGLInterface(gl_.get()); |
| 86 group_ = ContextGroup::Ref(new ContextGroup(NULL, bind_generates_resource)); | 87 group_ = ContextGroup::Ref(new ContextGroup(NULL, |
| 88 bind_generates_resource, |
| 89 NULL)); |
| 87 | 90 |
| 88 InSequence sequence; | 91 InSequence sequence; |
| 89 | 92 |
| 90 TestHelper::SetupContextGroupInitExpectations(gl_.get(), | 93 TestHelper::SetupContextGroupInitExpectations(gl_.get(), |
| 91 DisallowedFeatures(), extensions); | 94 DisallowedFeatures(), extensions); |
| 92 | 95 |
| 93 EXPECT_TRUE(group_->Initialize(DisallowedFeatures(), NULL)); | 96 EXPECT_TRUE(group_->Initialize(DisallowedFeatures(), NULL)); |
| 94 | 97 |
| 95 AddExpectationsForVertexAttribManager(); | 98 AddExpectationsForVertexAttribManager(); |
| 96 | 99 |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 target, level, format, width, height, border, | 870 target, level, format, width, height, border, |
| 868 bucket_id); | 871 bucket_id); |
| 869 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 872 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 870 } | 873 } |
| 871 | 874 |
| 872 void GLES2DecoderTestBase::DoTexImage2DSameSize( | 875 void GLES2DecoderTestBase::DoTexImage2DSameSize( |
| 873 GLenum target, GLint level, GLenum internal_format, | 876 GLenum target, GLint level, GLenum internal_format, |
| 874 GLsizei width, GLsizei height, GLint border, | 877 GLsizei width, GLsizei height, GLint border, |
| 875 GLenum format, GLenum type, | 878 GLenum format, GLenum type, |
| 876 uint32 shared_memory_id, uint32 shared_memory_offset) { | 879 uint32 shared_memory_id, uint32 shared_memory_offset) { |
| 877 if (GLES2Decoder::IsAngle()) | 880 if (GLES2Decoder::IsAngle()) { |
| 878 { | |
| 879 EXPECT_CALL(*gl_, TexSubImage2D( | 881 EXPECT_CALL(*gl_, TexSubImage2D( |
| 880 target, level, 0, 0, width, height, format, type, _)) | 882 target, level, 0, 0, width, height, format, type, _)) |
| 881 .Times(1) | 883 .Times(1) |
| 882 .RetiresOnSaturation(); | 884 .RetiresOnSaturation(); |
| 883 } else { | 885 } else { |
| 884 EXPECT_CALL(*gl_, GetError()) | 886 EXPECT_CALL(*gl_, GetError()) |
| 885 .WillOnce(Return(GL_NO_ERROR)) | 887 .WillOnce(Return(GL_NO_ERROR)) |
| 886 .RetiresOnSaturation(); | 888 .RetiresOnSaturation(); |
| 887 EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format, | 889 EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format, |
| 888 width, height, border, format, type, _)) | 890 width, height, border, format, type, _)) |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 num_vertices, buffer_id, GL_NO_ERROR); | 1340 num_vertices, buffer_id, GL_NO_ERROR); |
| 1339 } | 1341 } |
| 1340 | 1342 |
| 1341 void GLES2DecoderWithShaderTestBase::SetUp() { | 1343 void GLES2DecoderWithShaderTestBase::SetUp() { |
| 1342 GLES2DecoderTestBase::SetUp(); | 1344 GLES2DecoderTestBase::SetUp(); |
| 1343 SetupDefaultProgram(); | 1345 SetupDefaultProgram(); |
| 1344 } | 1346 } |
| 1345 | 1347 |
| 1346 } // namespace gles2 | 1348 } // namespace gles2 |
| 1347 } // namespace gpu | 1349 } // namespace gpu |
| OLD | NEW |