| 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 10 matching lines...) Expand all Loading... |
| 21 INHERITED::reset(); | 21 INHERITED::reset(); |
| 22 | 22 |
| 23 fVerifiedColorConfigs.reset(); | 23 fVerifiedColorConfigs.reset(); |
| 24 fStencilFormats.reset(); | 24 fStencilFormats.reset(); |
| 25 fStencilVerifiedColorConfigs.reset(); | 25 fStencilVerifiedColorConfigs.reset(); |
| 26 fMSFBOType = kNone_MSFBOType; | 26 fMSFBOType = kNone_MSFBOType; |
| 27 fCoverageAAType = kNone_CoverageAAType; | 27 fCoverageAAType = kNone_CoverageAAType; |
| 28 fFBFetchType = kNone_FBFetchType; | 28 fFBFetchType = kNone_FBFetchType; |
| 29 fMaxFragmentUniformVectors = 0; | 29 fMaxFragmentUniformVectors = 0; |
| 30 fMaxVertexAttributes = 0; | 30 fMaxVertexAttributes = 0; |
| 31 fMaxFragmentTextureUnits = 0; |
| 31 fRGBA8RenderbufferSupport = false; | 32 fRGBA8RenderbufferSupport = false; |
| 32 fBGRAFormatSupport = false; | 33 fBGRAFormatSupport = false; |
| 33 fBGRAIsInternalFormat = false; | 34 fBGRAIsInternalFormat = false; |
| 34 fTextureSwizzleSupport = false; | 35 fTextureSwizzleSupport = false; |
| 35 fUnpackRowLengthSupport = false; | 36 fUnpackRowLengthSupport = false; |
| 36 fUnpackFlipYSupport = false; | 37 fUnpackFlipYSupport = false; |
| 37 fPackRowLengthSupport = false; | 38 fPackRowLengthSupport = false; |
| 38 fPackFlipYSupport = false; | 39 fPackFlipYSupport = false; |
| 39 fTextureUsageSupport = false; | 40 fTextureUsageSupport = false; |
| 40 fTexStorageSupport = false; | 41 fTexStorageSupport = false; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 52 *this = caps; | 53 *this = caps; |
| 53 } | 54 } |
| 54 | 55 |
| 55 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { | 56 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { |
| 56 INHERITED::operator=(caps); | 57 INHERITED::operator=(caps); |
| 57 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; | 58 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; |
| 58 fStencilFormats = caps.fStencilFormats; | 59 fStencilFormats = caps.fStencilFormats; |
| 59 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; | 60 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; |
| 60 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; | 61 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; |
| 61 fMaxVertexAttributes = caps.fMaxVertexAttributes; | 62 fMaxVertexAttributes = caps.fMaxVertexAttributes; |
| 63 fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits; |
| 62 fMSFBOType = caps.fMSFBOType; | 64 fMSFBOType = caps.fMSFBOType; |
| 63 fCoverageAAType = caps.fCoverageAAType; | 65 fCoverageAAType = caps.fCoverageAAType; |
| 64 fMSAACoverageModes = caps.fMSAACoverageModes; | 66 fMSAACoverageModes = caps.fMSAACoverageModes; |
| 65 fFBFetchType = caps.fFBFetchType; | 67 fFBFetchType = caps.fFBFetchType; |
| 66 fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport; | 68 fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport; |
| 67 fBGRAFormatSupport = caps.fBGRAFormatSupport; | 69 fBGRAFormatSupport = caps.fBGRAFormatSupport; |
| 68 fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat; | 70 fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat; |
| 69 fTextureSwizzleSupport = caps.fTextureSwizzleSupport; | 71 fTextureSwizzleSupport = caps.fTextureSwizzleSupport; |
| 70 fUnpackRowLengthSupport = caps.fUnpackRowLengthSupport; | 72 fUnpackRowLengthSupport = caps.fUnpackRowLengthSupport; |
| 71 fUnpackFlipYSupport = caps.fUnpackFlipYSupport; | 73 fUnpackFlipYSupport = caps.fUnpackFlipYSupport; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 102 if (kES2_GrGLBinding == binding) { | 104 if (kES2_GrGLBinding == binding) { |
| 103 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS, | 105 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS, |
| 104 &fMaxFragmentUniformVectors); | 106 &fMaxFragmentUniformVectors); |
| 105 } else { | 107 } else { |
| 106 GrAssert(kDesktop_GrGLBinding == binding); | 108 GrAssert(kDesktop_GrGLBinding == binding); |
| 107 GrGLint max; | 109 GrGLint max; |
| 108 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max); | 110 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max); |
| 109 fMaxFragmentUniformVectors = max / 4; | 111 fMaxFragmentUniformVectors = max / 4; |
| 110 } | 112 } |
| 111 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); | 113 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); |
| 114 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUn
its); |
| 112 | 115 |
| 113 if (kDesktop_GrGLBinding == binding) { | 116 if (kDesktop_GrGLBinding == binding) { |
| 114 fRGBA8RenderbufferSupport = true; | 117 fRGBA8RenderbufferSupport = true; |
| 115 } else { | 118 } else { |
| 116 fRGBA8RenderbufferSupport = ctxInfo.hasExtension("GL_OES_rgb8_rgba8") || | 119 fRGBA8RenderbufferSupport = ctxInfo.hasExtension("GL_OES_rgb8_rgba8") || |
| 117 ctxInfo.hasExtension("GL_ARM_rgba8"); | 120 ctxInfo.hasExtension("GL_ARM_rgba8"); |
| 118 } | 121 } |
| 119 | 122 |
| 120 if (kDesktop_GrGLBinding == binding) { | 123 if (kDesktop_GrGLBinding == binding) { |
| 121 fBGRAFormatSupport = version >= GR_GL_VER(1,2) || | 124 fBGRAFormatSupport = version >= GR_GL_VER(1,2) || |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 fFBFetchType = kNV_FBFetchType; | 218 fFBFetchType = kNV_FBFetchType; |
| 216 } | 219 } |
| 217 } | 220 } |
| 218 | 221 |
| 219 this->initFSAASupport(ctxInfo, gli); | 222 this->initFSAASupport(ctxInfo, gli); |
| 220 this->initStencilFormats(ctxInfo); | 223 this->initStencilFormats(ctxInfo); |
| 221 | 224 |
| 222 /************************************************************************** | 225 /************************************************************************** |
| 223 * GrDrawTargetCaps fields | 226 * GrDrawTargetCaps fields |
| 224 **************************************************************************/ | 227 **************************************************************************/ |
| 225 GrGLint maxTextureUnits; | |
| 226 // check FS and fixed-function texture unit limits | |
| 227 // we only use textures in the fragment stage currently. | |
| 228 // checks are > to make sure we have a spare unit. | |
| 229 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits); | |
| 230 | |
| 231 GrGLint numFormats; | 228 GrGLint numFormats; |
| 232 GR_GL_GetIntegerv(gli, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats); | 229 GR_GL_GetIntegerv(gli, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats); |
| 233 if (numFormats) { | 230 if (numFormats) { |
| 234 SkAutoSTMalloc<10, GrGLint> formats(numFormats); | 231 SkAutoSTMalloc<10, GrGLint> formats(numFormats); |
| 235 GR_GL_GetIntegerv(gli, GR_GL_COMPRESSED_TEXTURE_FORMATS, formats); | 232 GR_GL_GetIntegerv(gli, GR_GL_COMPRESSED_TEXTURE_FORMATS, formats); |
| 236 for (int i = 0; i < numFormats; ++i) { | 233 for (int i = 0; i < numFormats; ++i) { |
| 237 if (formats[i] == GR_GL_PALETTE8_RGBA8) { | 234 if (formats[i] == GR_GL_PALETTE8_RGBA8) { |
| 238 f8BitPaletteSupport = true; | 235 f8BitPaletteSupport = true; |
| 239 break; | 236 break; |
| 240 } | 237 } |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 575 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
| 579 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 576 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 580 GrPrintf("Fragment coord conventions support: %s\n", | 577 GrPrintf("Fragment coord conventions support: %s\n", |
| 581 (fFragCoordsConventionSupport ? "YES": "NO")); | 578 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 582 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); | 579 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); |
| 583 GrPrintf("Use non-VBO for dynamic data: %s\n", | 580 GrPrintf("Use non-VBO for dynamic data: %s\n", |
| 584 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 581 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 585 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); | 582 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); |
| 586 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); | 583 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); |
| 587 } | 584 } |
| OLD | NEW |