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.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 7 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
9 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 9 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
10 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 10 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
11 #include "gpu/command_buffer/service/context_group.h" | 11 #include "gpu/command_buffer/service/context_group.h" |
12 #include "gpu/command_buffer/service/program_manager.h" | 12 #include "gpu/command_buffer/service/program_manager.h" |
| 13 #include "gpu/command_buffer/service/test_helper.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "ui/gl/gl_mock.h" | 15 #include "ui/gl/gl_mock.h" |
15 | 16 |
16 using ::gfx::MockGLInterface; | 17 using ::gfx::MockGLInterface; |
17 using ::testing::_; | 18 using ::testing::_; |
18 using ::testing::AnyNumber; | 19 using ::testing::AnyNumber; |
19 using ::testing::DoAll; | 20 using ::testing::DoAll; |
20 using ::testing::InSequence; | 21 using ::testing::InSequence; |
21 using ::testing::MatcherCast; | 22 using ::testing::MatcherCast; |
22 using ::testing::Pointee; | 23 using ::testing::Pointee; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 bool /* valid */) { | 283 bool /* valid */) { |
283 const GLuint kClientVertexShaderId = 5001; | 284 const GLuint kClientVertexShaderId = 5001; |
284 const GLuint kServiceVertexShaderId = 6001; | 285 const GLuint kServiceVertexShaderId = 6001; |
285 const GLuint kClientFragmentShaderId = 5002; | 286 const GLuint kClientFragmentShaderId = 5002; |
286 const GLuint kServiceFragmentShaderId = 6002; | 287 const GLuint kServiceFragmentShaderId = 6002; |
287 DoCreateShader( | 288 DoCreateShader( |
288 GL_VERTEX_SHADER, kClientVertexShaderId, kServiceVertexShaderId); | 289 GL_VERTEX_SHADER, kClientVertexShaderId, kServiceVertexShaderId); |
289 DoCreateShader( | 290 DoCreateShader( |
290 GL_FRAGMENT_SHADER, kClientFragmentShaderId, kServiceFragmentShaderId); | 291 GL_FRAGMENT_SHADER, kClientFragmentShaderId, kServiceFragmentShaderId); |
291 | 292 |
292 GetShader(kClientVertexShaderId)->SetStatus(true, "", NULL); | 293 TestHelper::SetShaderStates( |
293 GetShader(kClientFragmentShaderId)->SetStatus(true, "", NULL); | 294 gl_.get(), GetShader(kClientVertexShaderId), true); |
| 295 TestHelper::SetShaderStates( |
| 296 gl_.get(), GetShader(kClientFragmentShaderId), true); |
294 | 297 |
295 InSequence dummy; | 298 InSequence dummy; |
296 EXPECT_CALL(*gl_, | 299 EXPECT_CALL(*gl_, |
297 AttachShader(kServiceProgramId, kServiceVertexShaderId)) | 300 AttachShader(kServiceProgramId, kServiceVertexShaderId)) |
298 .Times(1) | 301 .Times(1) |
299 .RetiresOnSaturation(); | 302 .RetiresOnSaturation(); |
300 EXPECT_CALL(*gl_, | 303 EXPECT_CALL(*gl_, |
301 AttachShader(kServiceProgramId, kServiceFragmentShaderId)) | 304 AttachShader(kServiceProgramId, kServiceFragmentShaderId)) |
302 .Times(1) | 305 .Times(1) |
303 .RetiresOnSaturation(); | 306 .RetiresOnSaturation(); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f); | 556 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f); |
554 } | 557 } |
555 | 558 |
556 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) { | 559 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) { |
557 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f); | 560 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f); |
558 } | 561 } |
559 | 562 |
560 } // namespace gles2 | 563 } // namespace gles2 |
561 } // namespace gpu | 564 } // namespace gpu |
562 | 565 |
OLD | NEW |