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 <stdint.h> |
| 8 |
7 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
9 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | |
10 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 11 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
11 #include "gpu/command_buffer/service/context_group.h" | 12 #include "gpu/command_buffer/service/context_group.h" |
| 13 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
12 #include "gpu/command_buffer/service/program_manager.h" | 14 #include "gpu/command_buffer/service/program_manager.h" |
13 #include "gpu/command_buffer/service/test_helper.h" | 15 #include "gpu/command_buffer/service/test_helper.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "ui/gl/gl_mock.h" | 17 #include "ui/gl/gl_mock.h" |
16 | 18 |
17 using ::gfx::MockGLInterface; | 19 using ::gfx::MockGLInterface; |
18 using ::testing::_; | 20 using ::testing::_; |
19 using ::testing::AnyNumber; | 21 using ::testing::AnyNumber; |
20 using ::testing::DoAll; | 22 using ::testing::DoAll; |
21 using ::testing::InSequence; | 23 using ::testing::InSequence; |
22 using ::testing::MatcherCast; | 24 using ::testing::MatcherCast; |
23 using ::testing::Pointee; | 25 using ::testing::Pointee; |
24 using ::testing::Return; | 26 using ::testing::Return; |
25 using ::testing::SetArrayArgument; | 27 using ::testing::SetArrayArgument; |
26 using ::testing::SetArgumentPointee; | 28 using ::testing::SetArgumentPointee; |
27 using ::testing::StrEq; | 29 using ::testing::StrEq; |
28 | 30 |
29 namespace gpu { | 31 namespace gpu { |
30 namespace gles2 { | 32 namespace gles2 { |
31 | 33 |
32 namespace { | 34 namespace { |
33 void ShaderCacheCb(const std::string& key, const std::string& shader) { | 35 void ShaderCacheCb(const std::string& key, const std::string& shader) { |
34 } | 36 } |
35 } // namespace | 37 } // namespace |
36 | 38 |
37 class GLES2DecoderTest2 : public GLES2DecoderTestBase { | 39 class GLES2DecoderTest2 : public GLES2DecoderTestBase { |
38 public: | 40 public: |
39 GLES2DecoderTest2() { } | 41 GLES2DecoderTest2() { } |
40 | 42 |
41 void TestAcceptedUniform( | 43 void TestAcceptedUniform(GLenum uniform_type, |
42 GLenum uniform_type, uint32 accepts_apis, bool es3_enabled) { | 44 uint32_t accepts_apis, |
| 45 bool es3_enabled) { |
43 decoder_->set_unsafe_es3_apis_enabled(es3_enabled); | 46 decoder_->set_unsafe_es3_apis_enabled(es3_enabled); |
44 | 47 |
45 SetupShaderForUniform(uniform_type); | 48 SetupShaderForUniform(uniform_type); |
46 bool valid_uniform = false; | 49 bool valid_uniform = false; |
47 | 50 |
48 EXPECT_CALL(*gl_, Uniform1i(1, _)).Times(AnyNumber()); | 51 EXPECT_CALL(*gl_, Uniform1i(1, _)).Times(AnyNumber()); |
49 EXPECT_CALL(*gl_, Uniform1iv(1, _, _)).Times(AnyNumber()); | 52 EXPECT_CALL(*gl_, Uniform1iv(1, _, _)).Times(AnyNumber()); |
50 EXPECT_CALL(*gl_, Uniform2iv(1, _, _)).Times(AnyNumber()); | 53 EXPECT_CALL(*gl_, Uniform2iv(1, _, _)).Times(AnyNumber()); |
51 EXPECT_CALL(*gl_, Uniform3iv(1, _, _)).Times(AnyNumber()); | 54 EXPECT_CALL(*gl_, Uniform3iv(1, _, _)).Times(AnyNumber()); |
52 EXPECT_CALL(*gl_, Uniform4iv(1, _, _)).Times(AnyNumber()); | 55 EXPECT_CALL(*gl_, Uniform4iv(1, _, _)).Times(AnyNumber()); |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 TestAcceptedUniform(GL_FLOAT_MAT4x2, Program::kUniformMatrix4x2f, true); | 906 TestAcceptedUniform(GL_FLOAT_MAT4x2, Program::kUniformMatrix4x2f, true); |
904 } | 907 } |
905 | 908 |
906 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4x3) { | 909 TEST_P(GLES2DecoderTest2, AcceptsUniform_GL_FLOAT_MAT4x3) { |
907 TestAcceptedUniform(GL_FLOAT_MAT4x3, Program::kUniformMatrix4x3f, true); | 910 TestAcceptedUniform(GL_FLOAT_MAT4x3, Program::kUniformMatrix4x3f, true); |
908 } | 911 } |
909 | 912 |
910 } // namespace gles2 | 913 } // namespace gles2 |
911 } // namespace gpu | 914 } // namespace gpu |
912 | 915 |
OLD | NEW |