| 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/test_helper.h" | 5 #include "gpu/command_buffer/service/test_helper.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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 EXPECT_CALL(*gl, BindTexture(target, 0)) | 200 EXPECT_CALL(*gl, BindTexture(target, 0)) |
| 201 .Times(1) | 201 .Times(1) |
| 202 .RetiresOnSaturation(); | 202 .RetiresOnSaturation(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void TestHelper::SetupTextureManagerInitExpectations( | 205 void TestHelper::SetupTextureManagerInitExpectations( |
| 206 ::gl::MockGLInterface* gl, | 206 ::gl::MockGLInterface* gl, |
| 207 bool is_es3_enabled, | 207 bool is_es3_enabled, |
| 208 bool is_es3_capable, |
| 208 bool is_desktop_core_profile, | 209 bool is_desktop_core_profile, |
| 209 const char* extensions, | 210 const char* extensions, |
| 210 bool use_default_textures) { | 211 bool use_default_textures) { |
| 211 InSequence sequence; | 212 InSequence sequence; |
| 212 | 213 |
| 214 if (is_es3_capable) { |
| 215 EXPECT_CALL(*gl, BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)) |
| 216 .Times(1) |
| 217 .RetiresOnSaturation(); |
| 218 } |
| 219 |
| 213 SetupTextureInitializationExpectations( | 220 SetupTextureInitializationExpectations( |
| 214 gl, GL_TEXTURE_2D, use_default_textures); | 221 gl, GL_TEXTURE_2D, use_default_textures); |
| 215 SetupTextureInitializationExpectations( | 222 SetupTextureInitializationExpectations( |
| 216 gl, GL_TEXTURE_CUBE_MAP, use_default_textures); | 223 gl, GL_TEXTURE_CUBE_MAP, use_default_textures); |
| 217 | 224 |
| 218 if (is_es3_enabled) { | 225 if (is_es3_enabled) { |
| 219 SetupTextureInitializationExpectations( | 226 SetupTextureInitializationExpectations( |
| 220 gl, GL_TEXTURE_3D, use_default_textures); | 227 gl, GL_TEXTURE_3D, use_default_textures); |
| 221 SetupTextureInitializationExpectations( | 228 SetupTextureInitializationExpectations( |
| 222 gl, GL_TEXTURE_2D_ARRAY, use_default_textures); | 229 gl, GL_TEXTURE_2D_ARRAY, use_default_textures); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 .Times(testing::Between(0, 1)) | 467 .Times(testing::Between(0, 1)) |
| 461 .WillRepeatedly(SetArgumentPointee<1>(kMaxProgramTexelOffset)) | 468 .WillRepeatedly(SetArgumentPointee<1>(kMaxProgramTexelOffset)) |
| 462 .RetiresOnSaturation(); | 469 .RetiresOnSaturation(); |
| 463 EXPECT_CALL(*gl, GetIntegerv(GL_MIN_PROGRAM_TEXEL_OFFSET, _)) | 470 EXPECT_CALL(*gl, GetIntegerv(GL_MIN_PROGRAM_TEXEL_OFFSET, _)) |
| 464 .Times(testing::Between(0, 1)) | 471 .Times(testing::Between(0, 1)) |
| 465 .WillRepeatedly(SetArgumentPointee<1>(kMinProgramTexelOffset)) | 472 .WillRepeatedly(SetArgumentPointee<1>(kMinProgramTexelOffset)) |
| 466 .RetiresOnSaturation(); | 473 .RetiresOnSaturation(); |
| 467 | 474 |
| 468 bool use_default_textures = bind_generates_resource; | 475 bool use_default_textures = bind_generates_resource; |
| 469 SetupTextureManagerInitExpectations( | 476 SetupTextureManagerInitExpectations( |
| 470 gl, false, gl_info.is_desktop_core_profile, extensions, | 477 gl, false, gl_info.is_es3_capable, gl_info.is_desktop_core_profile, |
| 471 use_default_textures); | 478 extensions, use_default_textures); |
| 472 } | 479 } |
| 473 | 480 |
| 474 void TestHelper::SetupFeatureInfoInitExpectations(::gl::MockGLInterface* gl, | 481 void TestHelper::SetupFeatureInfoInitExpectations(::gl::MockGLInterface* gl, |
| 475 const char* extensions) { | 482 const char* extensions) { |
| 476 SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", "", | 483 SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", "", |
| 477 CONTEXT_TYPE_OPENGLES2); | 484 CONTEXT_TYPE_OPENGLES2); |
| 478 } | 485 } |
| 479 | 486 |
| 480 void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( | 487 void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( |
| 481 ::gl::MockGLInterface* gl, | 488 ::gl::MockGLInterface* gl, |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 GLenum precision, | 1202 GLenum precision, |
| 1196 bool static_use, | 1203 bool static_use, |
| 1197 const std::string& name) { | 1204 const std::string& name) { |
| 1198 return ConstructShaderVariable<sh::OutputVariable>( | 1205 return ConstructShaderVariable<sh::OutputVariable>( |
| 1199 type, array_size, precision, static_use, name); | 1206 type, array_size, precision, static_use, name); |
| 1200 } | 1207 } |
| 1201 | 1208 |
| 1202 } // namespace gles2 | 1209 } // namespace gles2 |
| 1203 } // namespace gpu | 1210 } // namespace gpu |
| 1204 | 1211 |
| OLD | NEW |