| 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 27 matching lines...) Expand all Loading... |
| 38 fTexStorageSupport = false; | 38 fTexStorageSupport = false; |
| 39 fTextureRedSupport = false; | 39 fTextureRedSupport = false; |
| 40 fImagingSupport = false; | 40 fImagingSupport = false; |
| 41 fTwoFormatLimit = false; | 41 fTwoFormatLimit = false; |
| 42 fFragCoordsConventionSupport = false; | 42 fFragCoordsConventionSupport = false; |
| 43 fVertexArrayObjectSupport = false; | 43 fVertexArrayObjectSupport = false; |
| 44 fUseNonVBOVertexAndIndexDynamicData = false; | 44 fUseNonVBOVertexAndIndexDynamicData = false; |
| 45 fIsCoreProfile = false; | 45 fIsCoreProfile = false; |
| 46 } | 46 } |
| 47 | 47 |
| 48 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTarget::Caps() { | 48 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { |
| 49 *this = caps; | 49 *this = caps; |
| 50 } | 50 } |
| 51 | 51 |
| 52 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { | 52 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { |
| 53 INHERITED::operator=(caps); | 53 INHERITED::operator=(caps); |
| 54 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; | 54 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; |
| 55 fStencilFormats = caps.fStencilFormats; | 55 fStencilFormats = caps.fStencilFormats; |
| 56 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; | 56 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; |
| 57 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; | 57 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; |
| 58 fMaxVertexAttributes = caps.fMaxVertexAttributes; | 58 fMaxVertexAttributes = caps.fMaxVertexAttributes; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || | 198 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || |
| 199 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject"); | 199 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject"); |
| 200 } else { | 200 } else { |
| 201 fVertexArrayObjectSupport = ctxInfo.hasExtension("GL_OES_vertex_array_ob
ject"); | 201 fVertexArrayObjectSupport = ctxInfo.hasExtension("GL_OES_vertex_array_ob
ject"); |
| 202 } | 202 } |
| 203 | 203 |
| 204 this->initFSAASupport(ctxInfo, gli); | 204 this->initFSAASupport(ctxInfo, gli); |
| 205 this->initStencilFormats(ctxInfo); | 205 this->initStencilFormats(ctxInfo); |
| 206 | 206 |
| 207 /************************************************************************** | 207 /************************************************************************** |
| 208 * GrDrawTarget::Caps fields | 208 * GrDrawTargetCaps fields |
| 209 **************************************************************************/ | 209 **************************************************************************/ |
| 210 GrGLint maxTextureUnits; | 210 GrGLint maxTextureUnits; |
| 211 // check FS and fixed-function texture unit limits | 211 // check FS and fixed-function texture unit limits |
| 212 // we only use textures in the fragment stage currently. | 212 // we only use textures in the fragment stage currently. |
| 213 // checks are > to make sure we have a spare unit. | 213 // checks are > to make sure we have a spare unit. |
| 214 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits); | 214 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits); |
| 215 GrAssert(maxTextureUnits > GrDrawState::kNumStages); | |
| 216 | 215 |
| 217 GrGLint numFormats; | 216 GrGLint numFormats; |
| 218 GR_GL_GetIntegerv(gli, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats); | 217 GR_GL_GetIntegerv(gli, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats); |
| 219 SkAutoSTMalloc<10, GrGLint> formats(numFormats); | 218 SkAutoSTMalloc<10, GrGLint> formats(numFormats); |
| 220 GR_GL_GetIntegerv(gli, GR_GL_COMPRESSED_TEXTURE_FORMATS, formats); | 219 GR_GL_GetIntegerv(gli, GR_GL_COMPRESSED_TEXTURE_FORMATS, formats); |
| 221 for (int i = 0; i < numFormats; ++i) { | 220 for (int i = 0; i < numFormats; ++i) { |
| 222 if (formats[i] == GR_GL_PALETTE8_RGBA8) { | 221 if (formats[i] == GR_GL_PALETTE8_RGBA8) { |
| 223 f8BitPaletteSupport = true; | 222 f8BitPaletteSupport = true; |
| 224 break; | 223 break; |
| 225 } | 224 } |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); | 542 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); |
| 544 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 543 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
| 545 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 544 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 546 GrPrintf("Fragment coord conventions support: %s\n", | 545 GrPrintf("Fragment coord conventions support: %s\n", |
| 547 (fFragCoordsConventionSupport ? "YES": "NO")); | 546 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 548 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); | 547 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); |
| 549 GrPrintf("Use non-VBO for dynamic data: %s\n", | 548 GrPrintf("Use non-VBO for dynamic data: %s\n", |
| 550 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 549 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 551 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); | 550 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); |
| 552 } | 551 } |
| OLD | NEW |