Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 40 fPackFlipYSupport = false; | 40 fPackFlipYSupport = false; |
| 41 fTextureUsageSupport = false; | 41 fTextureUsageSupport = false; |
| 42 fTexStorageSupport = false; | 42 fTexStorageSupport = false; |
| 43 fTextureRedSupport = false; | 43 fTextureRedSupport = false; |
| 44 fImagingSupport = false; | 44 fImagingSupport = false; |
| 45 fTwoFormatLimit = false; | 45 fTwoFormatLimit = false; |
| 46 fFragCoordsConventionSupport = false; | 46 fFragCoordsConventionSupport = false; |
| 47 fVertexArrayObjectSupport = false; | 47 fVertexArrayObjectSupport = false; |
| 48 fUseNonVBOVertexAndIndexDynamicData = false; | 48 fUseNonVBOVertexAndIndexDynamicData = false; |
| 49 fIsCoreProfile = false; | 49 fIsCoreProfile = false; |
| 50 fFixedFunctionSupport = false; | |
| 50 fDiscardFBSupport = false; | 51 fDiscardFBSupport = false; |
| 51 } | 52 } |
| 52 | 53 |
| 53 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { | 54 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { |
| 54 *this = caps; | 55 *this = caps; |
| 55 } | 56 } |
| 56 | 57 |
| 57 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { | 58 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { |
| 58 INHERITED::operator=(caps); | 59 INHERITED::operator=(caps); |
| 59 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; | 60 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 77 fPackFlipYSupport = caps.fPackFlipYSupport; | 78 fPackFlipYSupport = caps.fPackFlipYSupport; |
| 78 fTextureUsageSupport = caps.fTextureUsageSupport; | 79 fTextureUsageSupport = caps.fTextureUsageSupport; |
| 79 fTexStorageSupport = caps.fTexStorageSupport; | 80 fTexStorageSupport = caps.fTexStorageSupport; |
| 80 fTextureRedSupport = caps.fTextureRedSupport; | 81 fTextureRedSupport = caps.fTextureRedSupport; |
| 81 fImagingSupport = caps.fImagingSupport; | 82 fImagingSupport = caps.fImagingSupport; |
| 82 fTwoFormatLimit = caps.fTwoFormatLimit; | 83 fTwoFormatLimit = caps.fTwoFormatLimit; |
| 83 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; | 84 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; |
| 84 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; | 85 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; |
| 85 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa ta; | 86 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa ta; |
| 86 fIsCoreProfile = caps.fIsCoreProfile; | 87 fIsCoreProfile = caps.fIsCoreProfile; |
| 88 fFixedFunctionSupport = caps.fFixedFunctionSupport; | |
| 87 fDiscardFBSupport = caps.fDiscardFBSupport; | 89 fDiscardFBSupport = caps.fDiscardFBSupport; |
| 88 | 90 |
| 89 return *this; | 91 return *this; |
| 90 } | 92 } |
| 91 | 93 |
| 92 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { | 94 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { |
| 93 | 95 |
| 94 this->reset(); | 96 this->reset(); |
| 95 if (!ctxInfo.isInitialized()) { | 97 if (!ctxInfo.isInitialized()) { |
| 96 return; | 98 return; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 110 SkASSERT(kDesktop_GrGLBinding == binding); | 112 SkASSERT(kDesktop_GrGLBinding == binding); |
| 111 GrGLint max; | 113 GrGLint max; |
| 112 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max); | 114 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max); |
| 113 fMaxFragmentUniformVectors = max / 4; | 115 fMaxFragmentUniformVectors = max / 4; |
| 114 if (version >= GR_GL_VER(3, 2)) { | 116 if (version >= GR_GL_VER(3, 2)) { |
| 115 GrGLint profileMask; | 117 GrGLint profileMask; |
| 116 GR_GL_GetIntegerv(gli, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); | 118 GR_GL_GetIntegerv(gli, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); |
| 117 fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_B IT); | 119 fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_B IT); |
| 118 } | 120 } |
| 119 if (!fIsCoreProfile) { | 121 if (!fIsCoreProfile) { |
| 122 fFixedFunctionSupport = true; | |
| 120 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_COORDS, &fMaxFixedFunctionT extureCoords); | 123 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_COORDS, &fMaxFixedFunctionT extureCoords); |
| 121 // Sanity check | 124 // Sanity check |
| 122 SkASSERT(fMaxFixedFunctionTextureCoords > 0 && fMaxFixedFunctionText ureCoords < 128); | 125 SkASSERT(fMaxFixedFunctionTextureCoords > 0 && fMaxFixedFunctionText ureCoords < 128); |
| 123 } | 126 } |
| 124 } | 127 } |
| 125 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); | 128 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); |
| 126 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUn its); | 129 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUn its); |
| 127 | 130 |
| 128 if (kDesktop_GrGLBinding == binding) { | 131 if (kDesktop_GrGLBinding == binding) { |
| 129 fRGBA8RenderbufferSupport = true; | 132 fRGBA8RenderbufferSupport = true; |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 597 GrPrintf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO") ); | 600 GrPrintf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO") ); |
| 598 GrPrintf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO") ); | 601 GrPrintf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO") ); |
| 599 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); | 602 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); |
| 600 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 603 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
| 601 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 604 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 602 GrPrintf("Fragment coord conventions support: %s\n", | 605 GrPrintf("Fragment coord conventions support: %s\n", |
| 603 (fFragCoordsConventionSupport ? "YES": "NO")); | 606 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 604 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? " YES": "NO")); | 607 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? " YES": "NO")); |
| 605 GrPrintf("Use non-VBO for dynamic data: %s\n", | 608 GrPrintf("Use non-VBO for dynamic data: %s\n", |
| 606 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 609 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 607 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); | 610 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); |
|
robertphillips
2013/08/30 15:22:18
Shouldn't it also print out its value here?
bsalomon
2013/08/30 17:41:44
Good point. I added that and other missing ones.
| |
| 608 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : " NO")); | 611 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : " NO")); |
| 609 } | 612 } |
| OLD | NEW |