| 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 // we expect a really small number of possible formats so linear search | 572 // we expect a really small number of possible formats so linear search |
| 573 // should be OK | 573 // should be OK |
| 574 SkASSERT(count < 16); | 574 SkASSERT(count < 16); |
| 575 for (int i = 0; i < count; ++i) { | 575 for (int i = 0; i < count; ++i) { |
| 576 if (format.fInternalFormat == | 576 if (format.fInternalFormat == |
| 577 fStencilFormats[i].fInternalFormat) { | 577 fStencilFormats[i].fInternalFormat) { |
| 578 fStencilVerifiedColorConfigs[i].markVerified(config); | 578 fStencilVerifiedColorConfigs[i].markVerified(config); |
| 579 return; | 579 return; |
| 580 } | 580 } |
| 581 } | 581 } |
| 582 GrCrash("Why are we seeing a stencil format that " | 582 SkFAIL("Why are we seeing a stencil format that " |
| 583 "GrGLCaps doesn't know about."); | 583 "GrGLCaps doesn't know about."); |
| 584 } | 584 } |
| 585 | 585 |
| 586 bool GrGLCaps::isColorConfigAndStencilFormatVerified( | 586 bool GrGLCaps::isColorConfigAndStencilFormatVerified( |
| 587 GrPixelConfig config, | 587 GrPixelConfig config, |
| 588 const GrGLStencilBuffer::Format& format) const { | 588 const GrGLStencilBuffer::Format& format) const { |
| 589 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT | 589 #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT |
| 590 return false; | 590 return false; |
| 591 #endif | 591 #endif |
| 592 SkASSERT((unsigned)config < (unsigned)kGrPixelConfigCnt); | 592 SkASSERT((unsigned)config < (unsigned)kGrPixelConfigCnt); |
| 593 int count = fStencilFormats.count(); | 593 int count = fStencilFormats.count(); |
| 594 // we expect a really small number of possible formats so linear search | 594 // we expect a really small number of possible formats so linear search |
| 595 // should be OK | 595 // should be OK |
| 596 SkASSERT(count < 16); | 596 SkASSERT(count < 16); |
| 597 for (int i = 0; i < count; ++i) { | 597 for (int i = 0; i < count; ++i) { |
| 598 if (format.fInternalFormat == | 598 if (format.fInternalFormat == |
| 599 fStencilFormats[i].fInternalFormat) { | 599 fStencilFormats[i].fInternalFormat) { |
| 600 return fStencilVerifiedColorConfigs[i].isVerified(config); | 600 return fStencilVerifiedColorConfigs[i].isVerified(config); |
| 601 } | 601 } |
| 602 } | 602 } |
| 603 GrCrash("Why are we seeing a stencil format that " | 603 SkFAIL("Why are we seeing a stencil format that " |
| 604 "GLCaps doesn't know about."); | 604 "GLCaps doesn't know about."); |
| 605 return false; | 605 return false; |
| 606 } | 606 } |
| 607 | 607 |
| 608 SkString GrGLCaps::dump() const { | 608 SkString GrGLCaps::dump() const { |
| 609 | 609 |
| 610 SkString r = INHERITED::dump(); | 610 SkString r = INHERITED::dump(); |
| 611 | 611 |
| 612 r.appendf("--- GL-Specific ---\n"); | 612 r.appendf("--- GL-Specific ---\n"); |
| 613 for (int i = 0; i < fStencilFormats.count(); ++i) { | 613 for (int i = 0; i < fStencilFormats.count(); ++i) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 681 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 682 r.appendf("Fragment coord conventions support: %s\n", | 682 r.appendf("Fragment coord conventions support: %s\n", |
| 683 (fFragCoordsConventionSupport ? "YES": "NO")); | 683 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 684 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 684 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
| 685 r.appendf("Use non-VBO for dynamic data: %s\n", | 685 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 686 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 686 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 687 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 687 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
| 688 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 688 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
| 689 return r; | 689 return r; |
| 690 } | 690 } |
| OLD | NEW |