OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrGLCaps.h" | 9 #include "GrGLCaps.h" |
10 #include "GrGLContext.h" | 10 #include "GrGLContext.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 GrAssert(0 == fStencilVerifiedColorConfigs.count()); | 455 GrAssert(0 == fStencilVerifiedColorConfigs.count()); |
456 fStencilVerifiedColorConfigs.push_back_n(fStencilFormats.count()); | 456 fStencilVerifiedColorConfigs.push_back_n(fStencilFormats.count()); |
457 } | 457 } |
458 | 458 |
459 void GrGLCaps::markColorConfigAndStencilFormatAsVerified( | 459 void GrGLCaps::markColorConfigAndStencilFormatAsVerified( |
460 GrPixelConfig config, | 460 GrPixelConfig config, |
461 const GrGLStencilBuffer::Format& format) { | 461 const GrGLStencilBuffer::Format& format) { |
462 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT | 462 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT |
463 return; | 463 return; |
464 #endif | 464 #endif |
465 GrAssert((unsigned)config < kGrPixelConfigCnt); | 465 GrAssert((unsigned)config < (unsigned)kGrPixelConfigCnt); |
466 GrAssert(fStencilFormats.count() == fStencilVerifiedColorConfigs.count()); | 466 GrAssert(fStencilFormats.count() == fStencilVerifiedColorConfigs.count()); |
467 int count = fStencilFormats.count(); | 467 int count = fStencilFormats.count(); |
468 // we expect a really small number of possible formats so linear search | 468 // we expect a really small number of possible formats so linear search |
469 // should be OK | 469 // should be OK |
470 GrAssert(count < 16); | 470 GrAssert(count < 16); |
471 for (int i = 0; i < count; ++i) { | 471 for (int i = 0; i < count; ++i) { |
472 if (format.fInternalFormat == | 472 if (format.fInternalFormat == |
473 fStencilFormats[i].fInternalFormat) { | 473 fStencilFormats[i].fInternalFormat) { |
474 fStencilVerifiedColorConfigs[i].markVerified(config); | 474 fStencilVerifiedColorConfigs[i].markVerified(config); |
475 return; | 475 return; |
476 } | 476 } |
477 } | 477 } |
478 GrCrash("Why are we seeing a stencil format that " | 478 GrCrash("Why are we seeing a stencil format that " |
479 "GrGLCaps doesn't know about."); | 479 "GrGLCaps doesn't know about."); |
480 } | 480 } |
481 | 481 |
482 bool GrGLCaps::isColorConfigAndStencilFormatVerified( | 482 bool GrGLCaps::isColorConfigAndStencilFormatVerified( |
483 GrPixelConfig config, | 483 GrPixelConfig config, |
484 const GrGLStencilBuffer::Format& format) const { | 484 const GrGLStencilBuffer::Format& format) const { |
485 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT | 485 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT |
486 return false; | 486 return false; |
487 #endif | 487 #endif |
488 GrAssert((unsigned)config < kGrPixelConfigCnt); | 488 GrAssert((unsigned)config < (unsigned)kGrPixelConfigCnt); |
489 int count = fStencilFormats.count(); | 489 int count = fStencilFormats.count(); |
490 // we expect a really small number of possible formats so linear search | 490 // we expect a really small number of possible formats so linear search |
491 // should be OK | 491 // should be OK |
492 GrAssert(count < 16); | 492 GrAssert(count < 16); |
493 for (int i = 0; i < count; ++i) { | 493 for (int i = 0; i < count; ++i) { |
494 if (format.fInternalFormat == | 494 if (format.fInternalFormat == |
495 fStencilFormats[i].fInternalFormat) { | 495 fStencilFormats[i].fInternalFormat) { |
496 return fStencilVerifiedColorConfigs[i].isVerified(config); | 496 return fStencilVerifiedColorConfigs[i].isVerified(config); |
497 } | 497 } |
498 } | 498 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); | 542 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); |
543 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 543 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
544 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 544 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
545 GrPrintf("Fragment coord conventions support: %s\n", | 545 GrPrintf("Fragment coord conventions support: %s\n", |
546 (fFragCoordsConventionSupport ? "YES": "NO")); | 546 (fFragCoordsConventionSupport ? "YES": "NO")); |
547 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); | 547 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); |
548 GrPrintf("Use non-VBO for dynamic data: %s\n", | 548 GrPrintf("Use non-VBO for dynamic data: %s\n", |
549 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 549 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
550 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); | 550 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); |
551 } | 551 } |
OLD | NEW |