Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: gpu/command_buffer/service/test_helper.cc

Issue 2678483003: Fix EXT_draw_buffers detection on some GL ES 3 contexts (Closed)
Patch Set: update tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 gl_info.is_es3 || gl_info.is_desktop_core_profile) { 358 gl_info.is_es3 || gl_info.is_desktop_core_profile) {
359 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES, _)) 359 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES, _))
360 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) 360 .WillOnce(SetArgumentPointee<1>(kMaxSamples))
361 .RetiresOnSaturation(); 361 .RetiresOnSaturation();
362 } else if (strstr(extensions, "GL_IMG_multisampled_render_to_texture")) { 362 } else if (strstr(extensions, "GL_IMG_multisampled_render_to_texture")) {
363 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES_IMG, _)) 363 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES_IMG, _))
364 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) 364 .WillOnce(SetArgumentPointee<1>(kMaxSamples))
365 .RetiresOnSaturation(); 365 .RetiresOnSaturation();
366 } 366 }
367 367
368 if (strstr(extensions, "GL_EXT_draw_buffers") || 368 if (enable_es3 ||
369 strstr(extensions, "GL_ARB_draw_buffers") || 369 (!enable_es3 &&
370 (gl_info.is_es3 && strstr(extensions, "GL_NV_draw_buffers")) || 370 (gl_info.is_desktop_core_profile ||
371 gl_info.is_desktop_core_profile) { 371 strstr(extensions, "GL_EXT_draw_buffers") ||
372 strstr(extensions, "GL_ARB_draw_buffers") ||
373 (gl_info.is_es3 && strstr(extensions, "GL_NV_draw_buffers"))))) {
372 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _)) 374 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _))
373 .WillOnce(SetArgumentPointee<1>(8)) 375 .WillOnce(SetArgumentPointee<1>(8))
374 .RetiresOnSaturation(); 376 .RetiresOnSaturation();
375 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _)) 377 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _))
376 .WillOnce(SetArgumentPointee<1>(8)) 378 .WillOnce(SetArgumentPointee<1>(8))
377 .RetiresOnSaturation(); 379 .RetiresOnSaturation();
378 } 380 }
379 381
380 if (gl_info.IsAtLeastGL(3, 3) || 382 if (gl_info.IsAtLeastGL(3, 3) ||
381 (gl_info.IsAtLeastGL(3, 2) && 383 (gl_info.IsAtLeastGL(3, 2) &&
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, tx_ids[0])) 651 EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, tx_ids[0]))
650 .Times(1) 652 .Times(1)
651 .RetiresOnSaturation(); 653 .RetiresOnSaturation();
652 #if DCHECK_IS_ON() 654 #if DCHECK_IS_ON()
653 EXPECT_CALL(*gl, GetError()) 655 EXPECT_CALL(*gl, GetError())
654 .WillOnce(Return(GL_NO_ERROR)) 656 .WillOnce(Return(GL_NO_ERROR))
655 .RetiresOnSaturation(); 657 .RetiresOnSaturation();
656 #endif 658 #endif
657 } 659 }
658 660
659 if (strstr(extensions, "GL_EXT_draw_buffers") || 661 if (enable_es3 ||
660 strstr(extensions, "GL_ARB_draw_buffers") || 662 (!enable_es3 &&
661 (gl_info.is_es3 && strstr(extensions, "GL_NV_draw_buffers")) || 663 (gl_info.is_desktop_core_profile ||
662 gl_info.is_desktop_core_profile) { 664 strstr(extensions, "GL_EXT_draw_buffers") ||
665 strstr(extensions, "GL_ARB_draw_buffers") ||
666 (gl_info.is_es3 && strstr(extensions, "GL_NV_draw_buffers"))))) {
663 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _)) 667 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _))
664 .WillOnce(SetArgumentPointee<1>(8)) 668 .WillOnce(SetArgumentPointee<1>(8))
665 .RetiresOnSaturation(); 669 .RetiresOnSaturation();
666 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _)) 670 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _))
667 .WillOnce(SetArgumentPointee<1>(8)) 671 .WillOnce(SetArgumentPointee<1>(8))
668 .RetiresOnSaturation(); 672 .RetiresOnSaturation();
669 } 673 }
670 674
671 if (gl_info.is_es3 || gl_info.is_desktop_core_profile || 675 if (gl_info.is_es3 || gl_info.is_desktop_core_profile ||
672 strstr(extensions, "GL_EXT_texture_rg") || 676 strstr(extensions, "GL_EXT_texture_rg") ||
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 GLenum precision, 1208 GLenum precision,
1205 bool static_use, 1209 bool static_use,
1206 const std::string& name) { 1210 const std::string& name) {
1207 return ConstructShaderVariable<sh::OutputVariable>( 1211 return ConstructShaderVariable<sh::OutputVariable>(
1208 type, array_size, precision, static_use, name); 1212 type, array_size, precision, static_use, name);
1209 } 1213 }
1210 1214
1211 } // namespace gles2 1215 } // namespace gles2
1212 } // namespace gpu 1216 } // namespace gpu
1213 1217
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698