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

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

Issue 10389107: Implement GL_EXT_occlusion_query_boolean on OSX (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
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/feature_info.h" 5 #include "gpu/command_buffer/service/feature_info.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "gpu/command_buffer/service/gl_utils.h" 10 #include "gpu/command_buffer/service/gl_utils.h"
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 validators_.texture_internal_format_storage.AddValue( 438 validators_.texture_internal_format_storage.AddValue(
439 GL_LUMINANCE16F_EXT); 439 GL_LUMINANCE16F_EXT);
440 validators_.texture_internal_format_storage.AddValue( 440 validators_.texture_internal_format_storage.AddValue(
441 GL_LUMINANCE_ALPHA16F_EXT); 441 GL_LUMINANCE_ALPHA16F_EXT);
442 } 442 }
443 } 443 }
444 444
445 bool have_ext_occlusion_query_boolean = 445 bool have_ext_occlusion_query_boolean =
446 ext.Have("GL_EXT_occlusion_query_boolean"); 446 ext.Have("GL_EXT_occlusion_query_boolean");
447 bool have_arb_occlusion_query2 = ext.Have("GL_ARB_occlusion_query2"); 447 bool have_arb_occlusion_query2 = ext.Have("GL_ARB_occlusion_query2");
448 bool have_arb_occlusion_query = ext.Have("GL_ARB_occlusion_query");
448 if (ext.Desire("GL_EXT_occlusion_query_boolean") && 449 if (ext.Desire("GL_EXT_occlusion_query_boolean") &&
449 (have_ext_occlusion_query_boolean || have_arb_occlusion_query2)) { 450 (have_ext_occlusion_query_boolean ||
451 have_arb_occlusion_query2 ||
452 have_arb_occlusion_query)) {
450 AddExtensionString("GL_EXT_occlusion_query_boolean"); 453 AddExtensionString("GL_EXT_occlusion_query_boolean");
451 feature_flags_.occlusion_query_boolean = true; 454 feature_flags_.occlusion_query_boolean = true;
452 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean = 455 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean =
453 !have_ext_occlusion_query_boolean; 456 !have_ext_occlusion_query_boolean && have_arb_occlusion_query2;
457 feature_flags_.use_arb_occlusion_query_for_occlusion_query_boolean =
458 !have_ext_occlusion_query_boolean && have_arb_occlusion_query &&
459 !have_arb_occlusion_query2;
454 } 460 }
455 461
456 if (ext.Desire("GL_ANGLE_instanced_arrays") && 462 if (ext.Desire("GL_ANGLE_instanced_arrays") &&
457 (ext.Have("GL_ANGLE_instanced_arrays") || 463 (ext.Have("GL_ANGLE_instanced_arrays") ||
458 (ext.Have("GL_ARB_instanced_arrays") && 464 (ext.Have("GL_ARB_instanced_arrays") &&
459 ext.Have("GL_ARB_draw_instanced")))) { 465 ext.Have("GL_ARB_draw_instanced")))) {
460 AddExtensionString("GL_ANGLE_instanced_arrays"); 466 AddExtensionString("GL_ANGLE_instanced_arrays");
461 feature_flags_.angle_instanced_arrays = true; 467 feature_flags_.angle_instanced_arrays = true;
462 validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE); 468 validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
463 } 469 }
464 470
465 if (!disallowed_features_.swap_buffer_complete_callback) 471 if (!disallowed_features_.swap_buffer_complete_callback)
466 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback"); 472 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback");
467 } 473 }
468 474
469 void FeatureInfo::AddExtensionString(const std::string& str) { 475 void FeatureInfo::AddExtensionString(const std::string& str) {
470 if (extensions_.find(str) == std::string::npos) { 476 if (extensions_.find(str) == std::string::npos) {
471 extensions_ += (extensions_.empty() ? "" : " ") + str; 477 extensions_ += (extensions_.empty() ? "" : " ") + str;
472 } 478 }
473 } 479 }
474 480
475 } // namespace gles2 481 } // namespace gles2
476 } // namespace gpu 482 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698