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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc

Issue 1136713003: Add ES3 commands GetVertexAttribI{u}iv to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 #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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 SetupShaderForUniform(GL_INT_VEC4); 449 SetupShaderForUniform(GL_INT_VEC4);
450 }; 450 };
451 451
452 template <> 452 template <>
453 void GLES2DecoderTestBase::SpecializedSetup<cmds::UniformMatrix2fvImmediate, 0>( 453 void GLES2DecoderTestBase::SpecializedSetup<cmds::UniformMatrix2fvImmediate, 0>(
454 bool /* valid */) { 454 bool /* valid */) {
455 SetupShaderForUniform(GL_FLOAT_MAT2); 455 SetupShaderForUniform(GL_FLOAT_MAT2);
456 }; 456 };
457 457
458 template <> 458 template <>
459 void GLES2DecoderTestBase::SpecializedSetup<cmds::UniformMatrix3fvImmediate, 0>(
460 bool /* valid */) {
461 SetupShaderForUniform(GL_FLOAT_MAT3);
462 };
463
464 template <>
465 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameterf, 0>( 459 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameterf, 0>(
466 bool /* valid */) { 460 bool /* valid */) {
467 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 461 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
468 }; 462 };
469 463
470 template <> 464 template <>
471 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameteri, 0>( 465 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameteri, 0>(
472 bool /* valid */) { 466 bool /* valid */) {
473 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 467 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
474 }; 468 };
(...skipping 29 matching lines...) Expand all
504 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); 498 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId);
505 DoVertexAttribPointer(1, 1, GL_FLOAT, 0, 0); 499 DoVertexAttribPointer(1, 1, GL_FLOAT, 0, 0);
506 if (valid) { 500 if (valid) {
507 EXPECT_CALL(*gl_, GetError()) 501 EXPECT_CALL(*gl_, GetError())
508 .WillOnce(Return(GL_NO_ERROR)) 502 .WillOnce(Return(GL_NO_ERROR))
509 .WillOnce(Return(GL_NO_ERROR)) 503 .WillOnce(Return(GL_NO_ERROR))
510 .RetiresOnSaturation(); 504 .RetiresOnSaturation();
511 } 505 }
512 }; 506 };
513 507
508 template <>
509 void GLES2DecoderTestBase::SpecializedSetup<cmds::GetVertexAttribIiv, 0>(
510 bool valid) {
511 DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId);
512 DoVertexAttribPointer(1, 1, GL_FLOAT, 0, 0);
513 if (valid) {
514 EXPECT_CALL(*gl_, GetError())
515 .WillOnce(Return(GL_NO_ERROR))
516 .WillOnce(Return(GL_NO_ERROR))
517 .RetiresOnSaturation();
518 }
519 };
520
521 template <>
522 void GLES2DecoderTestBase::SpecializedSetup<cmds::GetVertexAttribIuiv, 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
514 534
515 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h" 535 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h"
516 536
517 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT) { 537 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT) {
518 TestAcceptedUniform(GL_INT, Program::kUniform1i); 538 TestAcceptedUniform(GL_INT, Program::kUniform1i);
519 } 539 }
520 540
521 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC2) { 541 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC2) {
522 TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i); 542 TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i);
523 } 543 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f); 590 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f);
571 } 591 }
572 592
573 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) { 593 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) {
574 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f); 594 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f);
575 } 595 }
576 596
577 } // namespace gles2 597 } // namespace gles2
578 } // namespace gpu 598 } // namespace gpu
579 599
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698