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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 336 |
337 SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", gl_version); | 337 SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", gl_version); |
338 | 338 |
339 gfx::GLVersionInfo gl_info(gl_version, "", extensions); | 339 gfx::GLVersionInfo gl_info(gl_version, "", extensions); |
340 | 340 |
341 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RENDERBUFFER_SIZE, _)) | 341 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RENDERBUFFER_SIZE, _)) |
342 .WillOnce(SetArgumentPointee<1>(kMaxRenderbufferSize)) | 342 .WillOnce(SetArgumentPointee<1>(kMaxRenderbufferSize)) |
343 .RetiresOnSaturation(); | 343 .RetiresOnSaturation(); |
344 if (strstr(extensions, "GL_EXT_framebuffer_multisample") || | 344 if (strstr(extensions, "GL_EXT_framebuffer_multisample") || |
345 strstr(extensions, "GL_EXT_multisampled_render_to_texture") || | 345 strstr(extensions, "GL_EXT_multisampled_render_to_texture") || |
346 gl_info.is_es3) { | 346 gl_info.is_es3 || gl_info.is_desktop_core_profile) { |
347 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES, _)) | 347 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES, _)) |
348 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) | 348 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) |
349 .RetiresOnSaturation(); | 349 .RetiresOnSaturation(); |
350 } else if (strstr(extensions, "GL_IMG_multisampled_render_to_texture")) { | 350 } else if (strstr(extensions, "GL_IMG_multisampled_render_to_texture")) { |
351 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES_IMG, _)) | 351 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES_IMG, _)) |
352 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) | 352 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) |
353 .RetiresOnSaturation(); | 353 .RetiresOnSaturation(); |
354 } | 354 } |
355 | 355 |
| 356 if (strstr(extensions, "GL_EXT_draw_buffers") || |
| 357 strstr(extensions, "GL_ARB_draw_buffers") || |
| 358 (gl_info.is_es3 && strstr(extensions, "GL_NV_draw_buffers")) || |
| 359 gl_info.is_desktop_core_profile) { |
| 360 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _)) |
| 361 .WillOnce(SetArgumentPointee<1>(8)) |
| 362 .RetiresOnSaturation(); |
| 363 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _)) |
| 364 .WillOnce(SetArgumentPointee<1>(8)) |
| 365 .RetiresOnSaturation(); |
| 366 } |
| 367 |
356 if (gl_info.IsAtLeastGL(3, 3) || | 368 if (gl_info.IsAtLeastGL(3, 3) || |
357 (gl_info.IsAtLeastGL(3, 2) && | 369 (gl_info.IsAtLeastGL(3, 2) && |
358 strstr(extensions, "GL_ARB_blend_func_extended")) || | 370 strstr(extensions, "GL_ARB_blend_func_extended")) || |
359 (gl_info.is_es && strstr(extensions, "GL_EXT_blend_func_extended"))) { | 371 (gl_info.is_es && strstr(extensions, "GL_EXT_blend_func_extended"))) { |
360 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT, _)) | 372 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT, _)) |
361 .WillOnce(SetArgumentPointee<1>(8)) | 373 .WillOnce(SetArgumentPointee<1>(8)) |
362 .RetiresOnSaturation(); | 374 .RetiresOnSaturation(); |
363 } | 375 } |
364 | 376 |
365 if (gl_info.IsES3Capable()) { | 377 if (gl_info.IsES3Capable()) { |
(...skipping 23 matching lines...) Expand all Loading... |
389 if (gl_info.IsES3Capable()) { | 401 if (gl_info.IsES3Capable()) { |
390 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_3D_TEXTURE_SIZE, _)) | 402 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_3D_TEXTURE_SIZE, _)) |
391 .WillOnce(SetArgumentPointee<1>(kMax3DTextureSize)) | 403 .WillOnce(SetArgumentPointee<1>(kMax3DTextureSize)) |
392 .RetiresOnSaturation(); | 404 .RetiresOnSaturation(); |
393 } | 405 } |
394 if (gl_info.IsES3Capable()) { | 406 if (gl_info.IsES3Capable()) { |
395 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, _)) | 407 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, _)) |
396 .WillOnce(SetArgumentPointee<1>(kMaxArrayTextureLayers)) | 408 .WillOnce(SetArgumentPointee<1>(kMaxArrayTextureLayers)) |
397 .RetiresOnSaturation(); | 409 .RetiresOnSaturation(); |
398 } | 410 } |
399 if (strstr(extensions, "GL_ARB_texture_rectangle")) { | 411 if (strstr(extensions, "GL_ARB_texture_rectangle") || |
| 412 gl_info.is_desktop_core_profile) { |
400 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, _)) | 413 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, _)) |
401 .WillOnce(SetArgumentPointee<1>(kMaxRectangleTextureSize)) | 414 .WillOnce(SetArgumentPointee<1>(kMaxRectangleTextureSize)) |
402 .RetiresOnSaturation(); | 415 .RetiresOnSaturation(); |
403 } | 416 } |
404 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, _)) | 417 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, _)) |
405 .WillOnce(SetArgumentPointee<1>(kMaxTextureImageUnits)) | 418 .WillOnce(SetArgumentPointee<1>(kMaxTextureImageUnits)) |
406 .RetiresOnSaturation(); | 419 .RetiresOnSaturation(); |
407 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, _)) | 420 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, _)) |
408 .WillOnce(SetArgumentPointee<1>(kMaxVertexTextureImageUnits)) | 421 .WillOnce(SetArgumentPointee<1>(kMaxVertexTextureImageUnits)) |
409 .RetiresOnSaturation(); | 422 .RetiresOnSaturation(); |
410 | 423 |
411 if (gl_info.is_es) { | 424 if (gl_info.is_es || gl_info.is_desktop_core_profile) { |
412 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, _)) | 425 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, _)) |
413 .WillOnce(SetArgumentPointee<1>(kMaxFragmentUniformVectors)) | 426 .WillOnce(SetArgumentPointee<1>(kMaxFragmentUniformVectors)) |
414 .RetiresOnSaturation(); | 427 .RetiresOnSaturation(); |
415 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VARYING_VECTORS, _)) | 428 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VARYING_VECTORS, _)) |
416 .WillOnce(SetArgumentPointee<1>(kMaxVaryingVectors)) | 429 .WillOnce(SetArgumentPointee<1>(kMaxVaryingVectors)) |
417 .RetiresOnSaturation(); | 430 .RetiresOnSaturation(); |
418 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, _)) | 431 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, _)) |
419 .WillOnce(SetArgumentPointee<1>(kMaxVertexUniformVectors)) | 432 .WillOnce(SetArgumentPointee<1>(kMaxVertexUniformVectors)) |
420 .RetiresOnSaturation(); | 433 .RetiresOnSaturation(); |
421 } else { | 434 } else { |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 gfx::SetGLImplementation(implementation); | 1180 gfx::SetGLImplementation(implementation); |
1168 } | 1181 } |
1169 | 1182 |
1170 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { | 1183 ScopedGLImplementationSetter::~ScopedGLImplementationSetter() { |
1171 gfx::SetGLImplementation(old_implementation_); | 1184 gfx::SetGLImplementation(old_implementation_); |
1172 } | 1185 } |
1173 | 1186 |
1174 } // namespace gles2 | 1187 } // namespace gles2 |
1175 } // namespace gpu | 1188 } // namespace gpu |
1176 | 1189 |
OLD | NEW |