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" |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 bool /* valid */) { | 511 bool /* valid */) { |
512 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 512 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
513 }; | 513 }; |
514 | 514 |
515 template <> | 515 template <> |
516 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameterivImmediate, 0>( | 516 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameterivImmediate, 0>( |
517 bool /* valid */) { | 517 bool /* valid */) { |
518 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 518 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
519 }; | 519 }; |
520 | 520 |
| 521 template <> |
| 522 void GLES2DecoderTestBase::SpecializedSetup<cmds::GetVertexAttribiv, 0>( |
| 523 bool valid) { |
| 524 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); |
| 525 DoVertexAttribPointer(1, 1, GL_FLOAT, 0, 0); |
| 526 if (valid) { |
| 527 EXPECT_CALL(*gl_, GetError()) |
| 528 .WillOnce(Return(GL_NO_ERROR)) |
| 529 .WillOnce(Return(GL_NO_ERROR)) |
| 530 .RetiresOnSaturation(); |
| 531 } |
| 532 }; |
| 533 |
| 534 template <> |
| 535 void GLES2DecoderTestBase::SpecializedSetup<cmds::GetVertexAttribfv, 0>( |
| 536 bool valid) { |
| 537 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); |
| 538 DoVertexAttribPointer(1, 1, GL_FLOAT, 0, 0); |
| 539 if (valid) { |
| 540 EXPECT_CALL(*gl_, GetError()) |
| 541 .WillOnce(Return(GL_NO_ERROR)) |
| 542 .WillOnce(Return(GL_NO_ERROR)) |
| 543 .RetiresOnSaturation(); |
| 544 } |
| 545 }; |
| 546 |
| 547 |
521 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h" | 548 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h" |
522 | 549 |
523 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT) { | 550 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT) { |
524 TestAcceptedUniform(GL_INT, Program::kUniform1i); | 551 TestAcceptedUniform(GL_INT, Program::kUniform1i); |
525 } | 552 } |
526 | 553 |
527 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC2) { | 554 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC2) { |
528 TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i); | 555 TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i); |
529 } | 556 } |
530 | 557 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f); | 603 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f); |
577 } | 604 } |
578 | 605 |
579 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) { | 606 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) { |
580 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f); | 607 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f); |
581 } | 608 } |
582 | 609 |
583 } // namespace gles2 | 610 } // namespace gles2 |
584 } // namespace gpu | 611 } // namespace gpu |
585 | 612 |
OLD | NEW |