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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 valid_uniform = accepts_apis & Program::kUniformMatrix4f; | 218 valid_uniform = accepts_apis & Program::kUniformMatrix4f; |
219 cmds::UniformMatrix4fv cmd; | 219 cmds::UniformMatrix4fv cmd; |
220 cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); | 220 cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); |
221 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 221 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
222 EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION, | 222 EXPECT_EQ(valid_uniform ? GL_NO_ERROR : GL_INVALID_OPERATION, |
223 GetGLError()); | 223 GetGLError()); |
224 } | 224 } |
225 } | 225 } |
226 }; | 226 }; |
227 | 227 |
228 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest2, ::testing::Bool()); | |
229 | |
230 template <> | 228 template <> |
231 void GLES2DecoderTestBase::SpecializedSetup<cmds::GenQueriesEXT, 0>( | 229 void GLES2DecoderTestBase::SpecializedSetup<cmds::GenQueriesEXT, 0>( |
232 bool valid) { | 230 bool valid) { |
233 if (!valid) { | 231 if (!valid) { |
234 // Make the client_query_id_ so that trying to make it again | 232 // Make the client_query_id_ so that trying to make it again |
235 // will fail. | 233 // will fail. |
236 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; | 234 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; |
237 cmds::GenQueriesEXT cmd; | 235 cmds::GenQueriesEXT cmd; |
238 cmd.Init(1, shared_memory_id_, shared_memory_offset_); | 236 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
239 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 237 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 }; | 585 }; |
588 | 586 |
589 template <> | 587 template <> |
590 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameterivImmediate, 0>( | 588 void GLES2DecoderTestBase::SpecializedSetup<cmds::TexParameterivImmediate, 0>( |
591 bool /* valid */) { | 589 bool /* valid */) { |
592 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 590 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
593 }; | 591 }; |
594 | 592 |
595 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h" | 593 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h" |
596 | 594 |
597 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT) { | 595 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_INT) { |
598 TestAcceptedUniform(GL_INT, Program::kUniform1i); | 596 TestAcceptedUniform(GL_INT, Program::kUniform1i); |
599 } | 597 } |
600 | 598 |
601 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC2) { | 599 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC2) { |
602 TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i); | 600 TestAcceptedUniform(GL_INT_VEC2, Program::kUniform2i); |
603 } | 601 } |
604 | 602 |
605 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC3) { | 603 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC3) { |
606 TestAcceptedUniform(GL_INT_VEC3, Program::kUniform3i); | 604 TestAcceptedUniform(GL_INT_VEC3, Program::kUniform3i); |
607 } | 605 } |
608 | 606 |
609 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC4) { | 607 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_INT_VEC4) { |
610 TestAcceptedUniform(GL_INT_VEC4, Program::kUniform4i); | 608 TestAcceptedUniform(GL_INT_VEC4, Program::kUniform4i); |
611 } | 609 } |
612 | 610 |
613 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL) { | 611 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_BOOL) { |
614 TestAcceptedUniform(GL_BOOL, Program::kUniform1i | Program::kUniform1f); | 612 TestAcceptedUniform(GL_BOOL, Program::kUniform1i | Program::kUniform1f); |
615 } | 613 } |
616 | 614 |
617 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC2) { | 615 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC2) { |
618 TestAcceptedUniform(GL_BOOL_VEC2, Program::kUniform2i | Program::kUniform2f); | 616 TestAcceptedUniform(GL_BOOL_VEC2, Program::kUniform2i | Program::kUniform2f); |
619 } | 617 } |
620 | 618 |
621 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC3) { | 619 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC3) { |
622 TestAcceptedUniform(GL_BOOL_VEC3, Program::kUniform3i | Program::kUniform3f); | 620 TestAcceptedUniform(GL_BOOL_VEC3, Program::kUniform3i | Program::kUniform3f); |
623 } | 621 } |
624 | 622 |
625 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC4) { | 623 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_BOOL_VEC4) { |
626 TestAcceptedUniform(GL_BOOL_VEC4, Program::kUniform4i | Program::kUniform4f); | 624 TestAcceptedUniform(GL_BOOL_VEC4, Program::kUniform4i | Program::kUniform4f); |
627 } | 625 } |
628 | 626 |
629 TEST_P(GLES2DecoderTest2, AcceptsUniformTypeFLOAT) { | 627 TEST_F(GLES2DecoderTest2, AcceptsUniformTypeFLOAT) { |
630 TestAcceptedUniform(GL_FLOAT, Program::kUniform1f); | 628 TestAcceptedUniform(GL_FLOAT, Program::kUniform1f); |
631 } | 629 } |
632 | 630 |
633 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC2) { | 631 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC2) { |
634 TestAcceptedUniform(GL_FLOAT_VEC2, Program::kUniform2f); | 632 TestAcceptedUniform(GL_FLOAT_VEC2, Program::kUniform2f); |
635 } | 633 } |
636 | 634 |
637 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC3) { | 635 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC3) { |
638 TestAcceptedUniform(GL_FLOAT_VEC3, Program::kUniform3f); | 636 TestAcceptedUniform(GL_FLOAT_VEC3, Program::kUniform3f); |
639 } | 637 } |
640 | 638 |
641 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC4) { | 639 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_VEC4) { |
642 TestAcceptedUniform(GL_FLOAT_VEC4, Program::kUniform4f); | 640 TestAcceptedUniform(GL_FLOAT_VEC4, Program::kUniform4f); |
643 } | 641 } |
644 | 642 |
645 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2) { | 643 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT2) { |
646 TestAcceptedUniform(GL_FLOAT_MAT2, Program::kUniformMatrix2f); | 644 TestAcceptedUniform(GL_FLOAT_MAT2, Program::kUniformMatrix2f); |
647 } | 645 } |
648 | 646 |
649 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3) { | 647 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT3) { |
650 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f); | 648 TestAcceptedUniform(GL_FLOAT_MAT3, Program::kUniformMatrix3f); |
651 } | 649 } |
652 | 650 |
653 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) { | 651 TEST_F(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4) { |
654 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f); | 652 TestAcceptedUniform(GL_FLOAT_MAT4, Program::kUniformMatrix4f); |
655 } | 653 } |
656 | 654 |
657 } // namespace gles2 | 655 } // namespace gles2 |
658 } // namespace gpu | 656 } // namespace gpu |
659 | 657 |
OLD | NEW |