| 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 30 matching lines...) Expand all Loading... |
| 41 fTextureRedSupport = false; | 41 fTextureRedSupport = false; |
| 42 fImagingSupport = false; | 42 fImagingSupport = false; |
| 43 fTwoFormatLimit = false; | 43 fTwoFormatLimit = false; |
| 44 fFragCoordsConventionSupport = false; | 44 fFragCoordsConventionSupport = false; |
| 45 fVertexArrayObjectSupport = false; | 45 fVertexArrayObjectSupport = false; |
| 46 fUseNonVBOVertexAndIndexDynamicData = false; | 46 fUseNonVBOVertexAndIndexDynamicData = false; |
| 47 fIsCoreProfile = false; | 47 fIsCoreProfile = false; |
| 48 fFixedFunctionSupport = false; | 48 fFixedFunctionSupport = false; |
| 49 fFullClearIsFree = false; | 49 fFullClearIsFree = false; |
| 50 fDropsTileOnZeroDivide = false; | 50 fDropsTileOnZeroDivide = false; |
| 51 fMapSubSupport = 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; |
| 60 fStencilFormats = caps.fStencilFormats; | 61 fStencilFormats = caps.fStencilFormats; |
| 61 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; | 62 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; |
| 62 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; | 63 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; |
| 63 fMaxVertexAttributes = caps.fMaxVertexAttributes; | 64 fMaxVertexAttributes = caps.fMaxVertexAttributes; |
| 64 fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits; | 65 fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits; |
| 65 fMaxFixedFunctionTextureCoords = caps.fMaxFixedFunctionTextureCoords; | 66 fMaxFixedFunctionTextureCoords = caps.fMaxFixedFunctionTextureCoords; |
| 66 fMSFBOType = caps.fMSFBOType; | 67 fMSFBOType = caps.fMSFBOType; |
| 67 fFBFetchType = caps.fFBFetchType; | 68 fFBFetchType = caps.fFBFetchType; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 79 fTextureRedSupport = caps.fTextureRedSupport; | 80 fTextureRedSupport = caps.fTextureRedSupport; |
| 80 fImagingSupport = caps.fImagingSupport; | 81 fImagingSupport = caps.fImagingSupport; |
| 81 fTwoFormatLimit = caps.fTwoFormatLimit; | 82 fTwoFormatLimit = caps.fTwoFormatLimit; |
| 82 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; | 83 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; |
| 83 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; | 84 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; |
| 84 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; | 85 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; |
| 85 fIsCoreProfile = caps.fIsCoreProfile; | 86 fIsCoreProfile = caps.fIsCoreProfile; |
| 86 fFixedFunctionSupport = caps.fFixedFunctionSupport; | 87 fFixedFunctionSupport = caps.fFixedFunctionSupport; |
| 87 fFullClearIsFree = caps.fFullClearIsFree; | 88 fFullClearIsFree = caps.fFullClearIsFree; |
| 88 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; | 89 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; |
| 90 fMapSubSupport = caps.fMapSubSupport; |
| 89 | 91 |
| 90 return *this; | 92 return *this; |
| 91 } | 93 } |
| 92 | 94 |
| 93 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { | 95 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { |
| 94 | 96 |
| 95 this->reset(); | 97 this->reset(); |
| 96 if (!ctxInfo.isInitialized()) { | 98 if (!ctxInfo.isInitialized()) { |
| 97 return; | 99 return; |
| 98 } | 100 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 ctxInfo.hasExtension("GL_EXT_stencil_wrap"); | 288 ctxInfo.hasExtension("GL_EXT_stencil_wrap"); |
| 287 } else { | 289 } else { |
| 288 // ES 2 has two sided stencil and stencil wrap | 290 // ES 2 has two sided stencil and stencil wrap |
| 289 fTwoSidedStencilSupport = true; | 291 fTwoSidedStencilSupport = true; |
| 290 fStencilWrapOpsSupport = true; | 292 fStencilWrapOpsSupport = true; |
| 291 } | 293 } |
| 292 | 294 |
| 293 if (kGL_GrGLStandard == standard) { | 295 if (kGL_GrGLStandard == standard) { |
| 294 fBufferLockSupport = true; // we require VBO support and the desktop VBO
extension includes | 296 fBufferLockSupport = true; // we require VBO support and the desktop VBO
extension includes |
| 295 // glMapBuffer. | 297 // glMapBuffer. |
| 298 fMapSubSupport = false; |
| 296 } else { | 299 } else { |
| 297 fBufferLockSupport = ctxInfo.hasExtension("GL_OES_mapbuffer"); | 300 fBufferLockSupport = ctxInfo.hasExtension("GL_OES_mapbuffer"); |
| 301 fMapSubSupport = ctxInfo.hasExtension("GL_CHROMIUM_map_sub"); |
| 298 } | 302 } |
| 299 | 303 |
| 300 if (kGL_GrGLStandard == standard) { | 304 if (kGL_GrGLStandard == standard) { |
| 301 SkASSERT(ctxInfo.version() >= GR_GL_VER(2,0) || | 305 SkASSERT(ctxInfo.version() >= GR_GL_VER(2,0) || |
| 302 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two")); | 306 ctxInfo.hasExtension("GL_ARB_texture_non_power_of_two")); |
| 303 fNPOTTextureTileSupport = true; | 307 fNPOTTextureTileSupport = true; |
| 304 fMipMapSupport = true; | 308 fMipMapSupport = true; |
| 305 } else { | 309 } else { |
| 306 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip
filters only | 310 // Unextended ES2 supports NPOT textures with clamp_to_edge and non-mip
filters only |
| 307 // ES3 has no limitations. | 311 // ES3 has no limitations. |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 683 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 680 r.appendf("Fragment coord conventions support: %s\n", | 684 r.appendf("Fragment coord conventions support: %s\n", |
| 681 (fFragCoordsConventionSupport ? "YES": "NO")); | 685 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 682 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 686 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
| 683 r.appendf("Use non-VBO for dynamic data: %s\n", | 687 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 684 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 688 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 685 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 689 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
| 686 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 690 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
| 687 return r; | 691 return r; |
| 688 } | 692 } |
| OLD | NEW |