| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 367 |
| 368 if (gl_info.IsAtLeastGL(3, 3) || | 368 if (gl_info.IsAtLeastGL(3, 3) || |
| 369 (gl_info.IsAtLeastGL(3, 2) && | 369 (gl_info.IsAtLeastGL(3, 2) && |
| 370 strstr(extensions, "GL_ARB_blend_func_extended")) || | 370 strstr(extensions, "GL_ARB_blend_func_extended")) || |
| 371 (gl_info.is_es && strstr(extensions, "GL_EXT_blend_func_extended"))) { | 371 (gl_info.is_es && strstr(extensions, "GL_EXT_blend_func_extended"))) { |
| 372 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT, _)) | 372 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT, _)) |
| 373 .WillOnce(SetArgumentPointee<1>(8)) | 373 .WillOnce(SetArgumentPointee<1>(8)) |
| 374 .RetiresOnSaturation(); | 374 .RetiresOnSaturation(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 if (gl_info.IsES3Capable()) { | 377 if (gl_info.is_es3_capable) { |
| 378 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, _)) | 378 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, _)) |
| 379 .WillOnce(SetArgumentPointee<1>(kMaxTransformFeedbackSeparateAttribs)) | 379 .WillOnce(SetArgumentPointee<1>(kMaxTransformFeedbackSeparateAttribs)) |
| 380 .RetiresOnSaturation(); | 380 .RetiresOnSaturation(); |
| 381 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, _)) | 381 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, _)) |
| 382 .WillOnce(SetArgumentPointee<1>(kMaxUniformBufferBindings)) | 382 .WillOnce(SetArgumentPointee<1>(kMaxUniformBufferBindings)) |
| 383 .RetiresOnSaturation(); | 383 .RetiresOnSaturation(); |
| 384 EXPECT_CALL(*gl, GetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, _)) | 384 EXPECT_CALL(*gl, GetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, _)) |
| 385 .WillOnce(SetArgumentPointee<1>(kUniformBufferOffsetAlignment)) | 385 .WillOnce(SetArgumentPointee<1>(kUniformBufferOffsetAlignment)) |
| 386 .RetiresOnSaturation(); | 386 .RetiresOnSaturation(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_ATTRIBS, _)) | 389 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_ATTRIBS, _)) |
| 390 .WillOnce(SetArgumentPointee<1>(kNumVertexAttribs)) | 390 .WillOnce(SetArgumentPointee<1>(kNumVertexAttribs)) |
| 391 .RetiresOnSaturation(); | 391 .RetiresOnSaturation(); |
| 392 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, _)) | 392 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, _)) |
| 393 .WillOnce(SetArgumentPointee<1>(kNumTextureUnits)) | 393 .WillOnce(SetArgumentPointee<1>(kNumTextureUnits)) |
| 394 .RetiresOnSaturation(); | 394 .RetiresOnSaturation(); |
| 395 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TEXTURE_SIZE, _)) | 395 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TEXTURE_SIZE, _)) |
| 396 .WillOnce(SetArgumentPointee<1>(kMaxTextureSize)) | 396 .WillOnce(SetArgumentPointee<1>(kMaxTextureSize)) |
| 397 .RetiresOnSaturation(); | 397 .RetiresOnSaturation(); |
| 398 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, _)) | 398 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, _)) |
| 399 .WillOnce(SetArgumentPointee<1>(kMaxCubeMapTextureSize)) | 399 .WillOnce(SetArgumentPointee<1>(kMaxCubeMapTextureSize)) |
| 400 .RetiresOnSaturation(); | 400 .RetiresOnSaturation(); |
| 401 if (gl_info.IsES3Capable()) { | 401 if (gl_info.is_es3_capable) { |
| 402 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_3D_TEXTURE_SIZE, _)) | 402 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_3D_TEXTURE_SIZE, _)) |
| 403 .WillOnce(SetArgumentPointee<1>(kMax3DTextureSize)) | 403 .WillOnce(SetArgumentPointee<1>(kMax3DTextureSize)) |
| 404 .RetiresOnSaturation(); | 404 .RetiresOnSaturation(); |
| 405 } | 405 } |
| 406 if (gl_info.IsES3Capable()) { | 406 if (gl_info.is_es3_capable) { |
| 407 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, _)) | 407 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, _)) |
| 408 .WillOnce(SetArgumentPointee<1>(kMaxArrayTextureLayers)) | 408 .WillOnce(SetArgumentPointee<1>(kMaxArrayTextureLayers)) |
| 409 .RetiresOnSaturation(); | 409 .RetiresOnSaturation(); |
| 410 } | 410 } |
| 411 if (strstr(extensions, "GL_ARB_texture_rectangle") || | 411 if (strstr(extensions, "GL_ARB_texture_rectangle") || |
| 412 gl_info.is_desktop_core_profile) { | 412 gl_info.is_desktop_core_profile) { |
| 413 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, _)) | 413 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, _)) |
| 414 .WillOnce(SetArgumentPointee<1>(kMaxRectangleTextureSize)) | 414 .WillOnce(SetArgumentPointee<1>(kMaxRectangleTextureSize)) |
| 415 .RetiresOnSaturation(); | 415 .RetiresOnSaturation(); |
| 416 } | 416 } |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 .RetiresOnSaturation(); | 559 .RetiresOnSaturation(); |
| 560 if (gl_info.is_es3) { | 560 if (gl_info.is_es3) { |
| 561 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 561 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 562 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) | 562 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) |
| 563 .RetiresOnSaturation(); | 563 .RetiresOnSaturation(); |
| 564 } else { | 564 } else { |
| 565 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 565 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 566 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 566 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 567 .RetiresOnSaturation(); | 567 .RetiresOnSaturation(); |
| 568 | 568 |
| 569 if (enable_es3 && gl_info.IsES3Capable()) { | 569 if (enable_es3 && gl_info.is_es3_capable) { |
| 570 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width, | 570 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width, |
| 571 0, GL_RED, GL_FLOAT, _)) | 571 0, GL_RED, GL_FLOAT, _)) |
| 572 .Times(1) | 572 .Times(1) |
| 573 .RetiresOnSaturation(); | 573 .RetiresOnSaturation(); |
| 574 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 574 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 575 .Times(1) | 575 .Times(1) |
| 576 .RetiresOnSaturation(); | 576 .RetiresOnSaturation(); |
| 577 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, width, | 577 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, width, |
| 578 0, GL_RG, GL_FLOAT, _)) | 578 0, GL_RG, GL_FLOAT, _)) |
| 579 .Times(1) | 579 .Times(1) |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 const GLenum*, GLsizei, | 936 const GLenum*, GLsizei, |
| 937 GLsizei* length, GLint* params) { | 937 GLsizei* length, GLint* params) { |
| 938 *length = kPropsSize; | 938 *length = kPropsSize; |
| 939 params[0] = info.real_location; | 939 params[0] = info.real_location; |
| 940 params[1] = info.type; | 940 params[1] = info.type; |
| 941 params[2] = info.size; | 941 params[2] = info.size; |
| 942 })) | 942 })) |
| 943 .RetiresOnSaturation(); | 943 .RetiresOnSaturation(); |
| 944 } | 944 } |
| 945 } | 945 } |
| 946 if (feature_info->gl_version_info().IsES3Capable() && | 946 if (feature_info->gl_version_info().is_es3_capable && |
| 947 !feature_info->disable_shader_translator()) { | 947 !feature_info->disable_shader_translator()) { |
| 948 for (size_t ii = 0; ii < num_program_outputs; ++ii) { | 948 for (size_t ii = 0; ii < num_program_outputs; ++ii) { |
| 949 ProgramOutputInfo& info = program_outputs[ii]; | 949 ProgramOutputInfo& info = program_outputs[ii]; |
| 950 if (ProgramManager::HasBuiltInPrefix(info.name)) | 950 if (ProgramManager::HasBuiltInPrefix(info.name)) |
| 951 continue; | 951 continue; |
| 952 | 952 |
| 953 EXPECT_CALL(*gl, GetFragDataLocation(service_id, StrEq(info.name))) | 953 EXPECT_CALL(*gl, GetFragDataLocation(service_id, StrEq(info.name))) |
| 954 .WillOnce(Return(info.color_name)) | 954 .WillOnce(Return(info.color_name)) |
| 955 .RetiresOnSaturation(); | 955 .RetiresOnSaturation(); |
| 956 if (feature_info->feature_flags().ext_blend_func_extended) { | 956 if (feature_info->feature_flags().ext_blend_func_extended) { |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 gl::SetGLImplementation(implementation); | 1190 gl::SetGLImplementation(implementation); |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { | 1193 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { |
| 1194 gl::SetGLImplementation(old_implementation_); | 1194 gl::SetGLImplementation(old_implementation_); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 } // namespace gles2 | 1197 } // namespace gles2 |
| 1198 } // namespace gpu | 1198 } // namespace gpu |
| 1199 | 1199 |
| OLD | NEW |