OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 6 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
8 #include "gpu/command_buffer/service/gl_mock.h" | 8 #include "gpu/command_buffer/service/gl_mock.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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // non-existant program | 436 // non-existant program |
437 cmd.Init(kInvalidClientId, kUniform2Location, | 437 cmd.Init(kInvalidClientId, kUniform2Location, |
438 kSharedMemoryId, kSharedMemoryOffset); | 438 kSharedMemoryId, kSharedMemoryOffset); |
439 EXPECT_CALL(*gl_, GetUniformiv(_, _, _)) | 439 EXPECT_CALL(*gl_, GetUniformiv(_, _, _)) |
440 .Times(0); | 440 .Times(0); |
441 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 441 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
442 EXPECT_EQ(0U, result->size); | 442 EXPECT_EQ(0U, result->size); |
443 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 443 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
444 // Valid id that is not a program. The GL spec requires a different error for | 444 // Valid id that is not a program. The GL spec requires a different error for |
445 // this case. | 445 // this case. |
| 446 #if GLES2_TEST_SHADER_VS_PROGRAM_IDS |
446 result->size = kInitialResult; | 447 result->size = kInitialResult; |
447 cmd.Init(client_texture_id_, kUniform2Location, | 448 cmd.Init(client_shader_id_, kUniform2Location, |
448 kSharedMemoryId, kSharedMemoryOffset); | 449 kSharedMemoryId, kSharedMemoryOffset); |
449 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 450 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
450 EXPECT_EQ(0U, result->size); | 451 EXPECT_EQ(0U, result->size); |
451 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 452 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 453 #endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS |
452 // Unlinked program | 454 // Unlinked program |
453 EXPECT_CALL(*gl_, CreateProgram()) | 455 EXPECT_CALL(*gl_, CreateProgram()) |
454 .Times(1) | 456 .Times(1) |
455 .WillOnce(Return(kNewServiceId)) | 457 .WillOnce(Return(kNewServiceId)) |
456 .RetiresOnSaturation(); | 458 .RetiresOnSaturation(); |
457 CreateProgram cmd2; | 459 CreateProgram cmd2; |
458 cmd2.Init(kNewClientId); | 460 cmd2.Init(kNewClientId); |
459 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); | 461 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); |
460 result->size = kInitialResult; | 462 result->size = kInitialResult; |
461 cmd.Init(kNewClientId, kUniform2Location, | 463 cmd.Init(kNewClientId, kUniform2Location, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 // non-existant program | 531 // non-existant program |
530 cmd.Init(kInvalidClientId, kUniform2Location, | 532 cmd.Init(kInvalidClientId, kUniform2Location, |
531 kSharedMemoryId, kSharedMemoryOffset); | 533 kSharedMemoryId, kSharedMemoryOffset); |
532 EXPECT_CALL(*gl_, GetUniformfv(_, _, _)) | 534 EXPECT_CALL(*gl_, GetUniformfv(_, _, _)) |
533 .Times(0); | 535 .Times(0); |
534 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 536 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
535 EXPECT_EQ(0U, result->size); | 537 EXPECT_EQ(0U, result->size); |
536 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 538 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
537 // Valid id that is not a program. The GL spec requires a different error for | 539 // Valid id that is not a program. The GL spec requires a different error for |
538 // this case. | 540 // this case. |
| 541 #if GLES2_TEST_SHADER_VS_PROGRAM_IDS |
539 result->size = kInitialResult; | 542 result->size = kInitialResult; |
540 cmd.Init(client_texture_id_, kUniform2Location, | 543 cmd.Init(client_shader_id_, kUniform2Location, |
541 kSharedMemoryId, kSharedMemoryOffset); | 544 kSharedMemoryId, kSharedMemoryOffset); |
542 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 545 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
543 EXPECT_EQ(0U, result->size); | 546 EXPECT_EQ(0U, result->size); |
544 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 547 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 548 #endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS |
545 // Unlinked program | 549 // Unlinked program |
546 EXPECT_CALL(*gl_, CreateProgram()) | 550 EXPECT_CALL(*gl_, CreateProgram()) |
547 .Times(1) | 551 .Times(1) |
548 .WillOnce(Return(kNewServiceId)) | 552 .WillOnce(Return(kNewServiceId)) |
549 .RetiresOnSaturation(); | 553 .RetiresOnSaturation(); |
550 CreateProgram cmd2; | 554 CreateProgram cmd2; |
551 cmd2.Init(kNewClientId); | 555 cmd2.Init(kNewClientId); |
552 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); | 556 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); |
553 result->size = kInitialResult; | 557 result->size = kInitialResult; |
554 cmd.Init(kNewClientId, kUniform2Location, | 558 cmd.Init(kNewClientId, kUniform2Location, |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 const uint32 kBucketId = 123; | 737 const uint32 kBucketId = 123; |
734 GetActiveUniform cmd; | 738 GetActiveUniform cmd; |
735 typedef GetActiveUniform::Result Result; | 739 typedef GetActiveUniform::Result Result; |
736 Result* result = static_cast<Result*>(shared_memory_address_); | 740 Result* result = static_cast<Result*>(shared_memory_address_); |
737 result->success = 0; | 741 result->success = 0; |
738 cmd.Init(kInvalidClientId, kUniformIndex, kBucketId, | 742 cmd.Init(kInvalidClientId, kUniformIndex, kBucketId, |
739 shared_memory_id_, shared_memory_offset_); | 743 shared_memory_id_, shared_memory_offset_); |
740 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 744 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
741 EXPECT_EQ(0, result->success); | 745 EXPECT_EQ(0, result->success); |
742 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 746 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 747 #if GLES2_TEST_SHADER_VS_PROGRAM_IDS |
743 result->success = 0; | 748 result->success = 0; |
744 cmd.Init(client_texture_id_, kUniformIndex, kBucketId, | 749 cmd.Init(client_shader_id_, kUniformIndex, kBucketId, |
745 shared_memory_id_, shared_memory_offset_); | 750 shared_memory_id_, shared_memory_offset_); |
746 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 751 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
747 EXPECT_EQ(0, result->success); | 752 EXPECT_EQ(0, result->success); |
748 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 753 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 754 #endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS |
749 } | 755 } |
750 | 756 |
751 TEST_F(GLES2DecoderWithShaderTest, GetActiveUniformBadIndexFails) { | 757 TEST_F(GLES2DecoderWithShaderTest, GetActiveUniformBadIndexFails) { |
752 const uint32 kBucketId = 123; | 758 const uint32 kBucketId = 123; |
753 GetActiveUniform cmd; | 759 GetActiveUniform cmd; |
754 typedef GetActiveUniform::Result Result; | 760 typedef GetActiveUniform::Result Result; |
755 Result* result = static_cast<Result*>(shared_memory_address_); | 761 Result* result = static_cast<Result*>(shared_memory_address_); |
756 result->success = 0; | 762 result->success = 0; |
757 cmd.Init(client_program_id_, kBadUniformIndex, kBucketId, | 763 cmd.Init(client_program_id_, kBadUniformIndex, kBucketId, |
758 shared_memory_id_, shared_memory_offset_); | 764 shared_memory_id_, shared_memory_offset_); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 const uint32 kBucketId = 123; | 817 const uint32 kBucketId = 123; |
812 GetActiveAttrib cmd; | 818 GetActiveAttrib cmd; |
813 typedef GetActiveAttrib::Result Result; | 819 typedef GetActiveAttrib::Result Result; |
814 Result* result = static_cast<Result*>(shared_memory_address_); | 820 Result* result = static_cast<Result*>(shared_memory_address_); |
815 result->success = 0; | 821 result->success = 0; |
816 cmd.Init(kInvalidClientId, kAttribIndex, kBucketId, | 822 cmd.Init(kInvalidClientId, kAttribIndex, kBucketId, |
817 shared_memory_id_, shared_memory_offset_); | 823 shared_memory_id_, shared_memory_offset_); |
818 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 824 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
819 EXPECT_EQ(0, result->success); | 825 EXPECT_EQ(0, result->success); |
820 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 826 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 827 #if GLES2_TEST_SHADER_VS_PROGRAM_IDS |
821 result->success = 0; | 828 result->success = 0; |
822 cmd.Init(client_texture_id_, kAttribIndex, kBucketId, | 829 cmd.Init(client_shader_id_, kAttribIndex, kBucketId, |
823 shared_memory_id_, shared_memory_offset_); | 830 shared_memory_id_, shared_memory_offset_); |
824 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 831 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
825 EXPECT_EQ(0, result->success); | 832 EXPECT_EQ(0, result->success); |
826 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 833 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 834 #endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS |
827 } | 835 } |
828 | 836 |
829 TEST_F(GLES2DecoderWithShaderTest, GetActiveAttribBadIndexFails) { | 837 TEST_F(GLES2DecoderWithShaderTest, GetActiveAttribBadIndexFails) { |
830 const uint32 kBucketId = 123; | 838 const uint32 kBucketId = 123; |
831 GetActiveAttrib cmd; | 839 GetActiveAttrib cmd; |
832 typedef GetActiveAttrib::Result Result; | 840 typedef GetActiveAttrib::Result Result; |
833 Result* result = static_cast<Result*>(shared_memory_address_); | 841 Result* result = static_cast<Result*>(shared_memory_address_); |
834 result->success = 0; | 842 result->success = 0; |
835 cmd.Init(client_program_id_, kBadAttribIndex, kBucketId, | 843 cmd.Init(client_program_id_, kBadAttribIndex, kBucketId, |
836 shared_memory_id_, shared_memory_offset_); | 844 shared_memory_id_, shared_memory_offset_); |
(...skipping 21 matching lines...) Expand all Loading... |
858 CompileShader cmd; | 866 CompileShader cmd; |
859 cmd.Init(client_shader_id_); | 867 cmd.Init(client_shader_id_); |
860 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 868 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
861 } | 869 } |
862 | 870 |
863 TEST_F(GLES2DecoderTest, CompileShaderInvalidArgs) { | 871 TEST_F(GLES2DecoderTest, CompileShaderInvalidArgs) { |
864 CompileShader cmd; | 872 CompileShader cmd; |
865 cmd.Init(kInvalidClientId); | 873 cmd.Init(kInvalidClientId); |
866 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 874 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
867 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 875 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
868 cmd.Init(client_texture_id_); | 876 #if GLES2_TEST_SHADER_VS_PROGRAM_IDS |
| 877 cmd.Init(client_program_id_); |
869 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 878 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
870 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 879 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 880 #endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS |
871 } | 881 } |
872 | 882 |
873 TEST_F(GLES2DecoderTest, ShaderSourceAndGetShaderSourceValidArgs) { | 883 TEST_F(GLES2DecoderTest, ShaderSourceAndGetShaderSourceValidArgs) { |
874 const uint32 kBucketId = 123; | 884 const uint32 kBucketId = 123; |
875 const char kSource[] = "hello"; | 885 const char kSource[] = "hello"; |
876 const uint32 kSourceSize = sizeof(kSource) - 1; | 886 const uint32 kSourceSize = sizeof(kSource) - 1; |
877 memcpy(shared_memory_address_, kSource, kSourceSize); | 887 memcpy(shared_memory_address_, kSource, kSourceSize); |
878 ShaderSource cmd; | 888 ShaderSource cmd; |
879 cmd.Init(client_shader_id_, | 889 cmd.Init(client_shader_id_, |
880 kSharedMemoryId, kSharedMemoryOffset, kSourceSize); | 890 kSharedMemoryId, kSharedMemoryOffset, kSourceSize); |
(...skipping 11 matching lines...) Expand all Loading... |
892 | 902 |
893 TEST_F(GLES2DecoderTest, ShaderSourceInvalidArgs) { | 903 TEST_F(GLES2DecoderTest, ShaderSourceInvalidArgs) { |
894 const char kSource[] = "hello"; | 904 const char kSource[] = "hello"; |
895 const uint32 kSourceSize = sizeof(kSource) - 1; | 905 const uint32 kSourceSize = sizeof(kSource) - 1; |
896 memcpy(shared_memory_address_, kSource, kSourceSize); | 906 memcpy(shared_memory_address_, kSource, kSourceSize); |
897 ShaderSource cmd; | 907 ShaderSource cmd; |
898 cmd.Init(kInvalidClientId, | 908 cmd.Init(kInvalidClientId, |
899 kSharedMemoryId, kSharedMemoryOffset, kSourceSize); | 909 kSharedMemoryId, kSharedMemoryOffset, kSourceSize); |
900 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 910 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
901 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 911 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
902 cmd.Init(client_texture_id_, | 912 #if GLES2_TEST_SHADER_VS_PROGRAM_IDS |
| 913 cmd.Init(client_program_id_, |
903 kSharedMemoryId, kSharedMemoryOffset, kSourceSize); | 914 kSharedMemoryId, kSharedMemoryOffset, kSourceSize); |
904 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 915 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
905 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 916 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 917 #endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS |
906 cmd.Init(client_shader_id_, | 918 cmd.Init(client_shader_id_, |
907 kInvalidSharedMemoryId, kSharedMemoryOffset, kSourceSize); | 919 kInvalidSharedMemoryId, kSharedMemoryOffset, kSourceSize); |
908 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 920 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
909 cmd.Init(client_shader_id_, | 921 cmd.Init(client_shader_id_, |
910 kSharedMemoryId, kInvalidSharedMemoryOffset, kSourceSize); | 922 kSharedMemoryId, kInvalidSharedMemoryOffset, kSourceSize); |
911 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 923 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
912 cmd.Init(client_shader_id_, | 924 cmd.Init(client_shader_id_, |
913 kSharedMemoryId, kSharedMemoryOffset, kSharedBufferSize); | 925 kSharedMemoryId, kSharedMemoryOffset, kSharedBufferSize); |
914 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 926 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
915 } | 927 } |
(...skipping 19 matching lines...) Expand all Loading... |
935 } | 947 } |
936 | 948 |
937 TEST_F(GLES2DecoderTest, ShaderSourceImmediateInvalidArgs) { | 949 TEST_F(GLES2DecoderTest, ShaderSourceImmediateInvalidArgs) { |
938 const char kSource[] = "hello"; | 950 const char kSource[] = "hello"; |
939 const uint32 kSourceSize = sizeof(kSource) - 1; | 951 const uint32 kSourceSize = sizeof(kSource) - 1; |
940 ShaderSourceImmediate& cmd = *GetImmediateAs<ShaderSourceImmediate>(); | 952 ShaderSourceImmediate& cmd = *GetImmediateAs<ShaderSourceImmediate>(); |
941 cmd.Init(kInvalidClientId, kSourceSize); | 953 cmd.Init(kInvalidClientId, kSourceSize); |
942 memcpy(GetImmediateDataAs<void*>(&cmd), kSource, kSourceSize); | 954 memcpy(GetImmediateDataAs<void*>(&cmd), kSource, kSourceSize); |
943 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, kSourceSize)); | 955 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, kSourceSize)); |
944 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 956 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
945 cmd.Init(client_texture_id_, kSourceSize); | 957 #if GLES2_TEST_SHADER_VS_PROGRAM_IDS |
| 958 cmd.Init(client_program_id_, kSourceSize); |
946 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, kSourceSize)); | 959 EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, kSourceSize)); |
947 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 960 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| 961 #endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS |
948 } | 962 } |
949 | 963 |
950 TEST_F(GLES2DecoderTest, ShaderSourceBucketAndGetShaderSourceValidArgs) { | 964 TEST_F(GLES2DecoderTest, ShaderSourceBucketAndGetShaderSourceValidArgs) { |
951 const uint32 kInBucketId = 123; | 965 const uint32 kInBucketId = 123; |
952 const uint32 kOutBucketId = 125; | 966 const uint32 kOutBucketId = 125; |
953 const char kSource[] = "hello"; | 967 const char kSource[] = "hello"; |
954 const uint32 kSourceSize = sizeof(kSource) - 1; | 968 const uint32 kSourceSize = sizeof(kSource) - 1; |
955 SetBucketAsCString(kInBucketId, kSource); | 969 SetBucketAsCString(kInBucketId, kSource); |
956 ShaderSourceBucket cmd; | 970 ShaderSourceBucket cmd; |
957 cmd.Init(client_shader_id_, kInBucketId); | 971 cmd.Init(client_shader_id_, kInBucketId); |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1901 GL_UNSIGNED_SHORT, | 1915 GL_UNSIGNED_SHORT, |
1902 kValidIndexRangeStart * 2, kSharedMemoryId, kSharedMemoryOffset); | 1916 kValidIndexRangeStart * 2, kSharedMemoryId, kSharedMemoryOffset); |
1903 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1917 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
1904 EXPECT_EQ(100u, *result); | 1918 EXPECT_EQ(100u, *result); |
1905 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1919 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
1906 | 1920 |
1907 cmd.Init(kInvalidClientId, kValidIndexRangeCount, | 1921 cmd.Init(kInvalidClientId, kValidIndexRangeCount, |
1908 GL_UNSIGNED_SHORT, | 1922 GL_UNSIGNED_SHORT, |
1909 kValidIndexRangeStart * 2, kSharedMemoryId, kSharedMemoryOffset); | 1923 kValidIndexRangeStart * 2, kSharedMemoryId, kSharedMemoryOffset); |
1910 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1924 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
1911 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 1925 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
1912 cmd.Init(client_element_buffer_id_, kOutOfRangeIndexRangeEnd, | 1926 cmd.Init(client_element_buffer_id_, kOutOfRangeIndexRangeEnd, |
1913 GL_UNSIGNED_SHORT, | 1927 GL_UNSIGNED_SHORT, |
1914 kValidIndexRangeStart * 2, kSharedMemoryId, kSharedMemoryOffset); | 1928 kValidIndexRangeStart * 2, kSharedMemoryId, kSharedMemoryOffset); |
1915 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1929 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
1916 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 1930 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
1917 cmd.Init(client_element_buffer_id_, kValidIndexRangeCount + 1, | 1931 cmd.Init(client_element_buffer_id_, kValidIndexRangeCount + 1, |
1918 GL_UNSIGNED_SHORT, | 1932 GL_UNSIGNED_SHORT, |
1919 kOutOfRangeIndexRangeEnd * 2, kSharedMemoryId, kSharedMemoryOffset); | 1933 kOutOfRangeIndexRangeEnd * 2, kSharedMemoryId, kSharedMemoryOffset); |
1920 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1934 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
1921 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 1935 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1973 // TODO(gman): UseProgram | 1987 // TODO(gman): UseProgram |
1974 | 1988 |
1975 // TODO(gman): SwapBuffers | 1989 // TODO(gman): SwapBuffers |
1976 | 1990 |
1977 // TODO(gman): VertexAttribPointer | 1991 // TODO(gman): VertexAttribPointer |
1978 | 1992 |
1979 } // namespace gles2 | 1993 } // namespace gles2 |
1980 } // namespace gpu | 1994 } // namespace gpu |
1981 | 1995 |
1982 | 1996 |
OLD | NEW |