| 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_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "gpu/command_buffer/service/test_helper.h" | 24 #include "gpu/command_buffer/service/test_helper.h" |
| 25 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 25 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 27 #include "ui/gl/gl_implementation.h" | 27 #include "ui/gl/gl_implementation.h" |
| 28 #include "ui/gl/gl_mock.h" | 28 #include "ui/gl/gl_mock.h" |
| 29 #include "ui/gl/test/gl_surface_test_support.h" | 29 #include "ui/gl/test/gl_surface_test_support.h" |
| 30 | 30 |
| 31 using ::gfx::MockGLInterface; | 31 using ::gfx::MockGLInterface; |
| 32 using ::testing::_; | 32 using ::testing::_; |
| 33 using ::testing::AnyNumber; | 33 using ::testing::AnyNumber; |
| 34 using ::testing::AtMost; |
| 34 using ::testing::DoAll; | 35 using ::testing::DoAll; |
| 35 using ::testing::InSequence; | 36 using ::testing::InSequence; |
| 36 using ::testing::Invoke; | 37 using ::testing::Invoke; |
| 37 using ::testing::InvokeWithoutArgs; | 38 using ::testing::InvokeWithoutArgs; |
| 38 using ::testing::MatcherCast; | 39 using ::testing::MatcherCast; |
| 39 using ::testing::Pointee; | 40 using ::testing::Pointee; |
| 40 using ::testing::Return; | 41 using ::testing::Return; |
| 41 using ::testing::SetArrayArgument; | 42 using ::testing::SetArrayArgument; |
| 42 using ::testing::SetArgPointee; | 43 using ::testing::SetArgPointee; |
| 43 using ::testing::SetArgumentPointee; | 44 using ::testing::SetArgumentPointee; |
| (...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 .Times(1) | 1150 .Times(1) |
| 1150 .RetiresOnSaturation(); | 1151 .RetiresOnSaturation(); |
| 1151 GenHelper<cmds::DeleteRenderbuffersImmediate>(client_id); | 1152 GenHelper<cmds::DeleteRenderbuffersImmediate>(client_id); |
| 1152 } | 1153 } |
| 1153 | 1154 |
| 1154 void GLES2DecoderTestBase::DoBindTexture( | 1155 void GLES2DecoderTestBase::DoBindTexture( |
| 1155 GLenum target, GLuint client_id, GLuint service_id) { | 1156 GLenum target, GLuint client_id, GLuint service_id) { |
| 1156 EXPECT_CALL(*gl_, BindTexture(target, service_id)) | 1157 EXPECT_CALL(*gl_, BindTexture(target, service_id)) |
| 1157 .Times(1) | 1158 .Times(1) |
| 1158 .RetiresOnSaturation(); | 1159 .RetiresOnSaturation(); |
| 1160 if (!group_->feature_info()->gl_version_info().BehavesLikeGLES() && |
| 1161 group_->feature_info()->gl_version_info().IsAtLeastGL(3, 2)) { |
| 1162 EXPECT_CALL(*gl_, TexParameteri(target, GL_DEPTH_TEXTURE_MODE, GL_RED)) |
| 1163 .Times(AtMost(1)); |
| 1164 } |
| 1159 cmds::BindTexture cmd; | 1165 cmds::BindTexture cmd; |
| 1160 cmd.Init(target, client_id); | 1166 cmd.Init(target, client_id); |
| 1161 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1167 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1162 } | 1168 } |
| 1163 | 1169 |
| 1164 bool GLES2DecoderTestBase::DoIsTexture(GLuint client_id) { | 1170 bool GLES2DecoderTestBase::DoIsTexture(GLuint client_id) { |
| 1165 return IsObjectHelper<cmds::IsTexture, cmds::IsTexture::Result>(client_id); | 1171 return IsObjectHelper<cmds::IsTexture, cmds::IsTexture::Result>(client_id); |
| 1166 } | 1172 } |
| 1167 | 1173 |
| 1168 void GLES2DecoderTestBase::DoDeleteTexture( | 1174 void GLES2DecoderTestBase::DoDeleteTexture( |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2057 SetupDefaultProgram(); | 2063 SetupDefaultProgram(); |
| 2058 } | 2064 } |
| 2059 | 2065 |
| 2060 // Include the auto-generated part of this file. We split this because it means | 2066 // Include the auto-generated part of this file. We split this because it means |
| 2061 // we can easily edit the non-auto generated parts right here in this file | 2067 // we can easily edit the non-auto generated parts right here in this file |
| 2062 // instead of having to edit some template or the code generator. | 2068 // instead of having to edit some template or the code generator. |
| 2063 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 2069 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
| 2064 | 2070 |
| 2065 } // namespace gles2 | 2071 } // namespace gles2 |
| 2066 } // namespace gpu | 2072 } // namespace gpu |
| OLD | NEW |