| 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 | 10 |
| 11 #include "GrGLContext.h" | 11 #include "GrGLContext.h" |
| 12 #include "SkTSearch.h" | 12 #include "SkTSearch.h" |
| 13 #include "SkTSort.h" | 13 #include "SkTSort.h" |
| 14 | 14 |
| 15 GrGLCaps::GrGLCaps() { | 15 GrGLCaps::GrGLCaps() { |
| 16 this->reset(); | 16 this->reset(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void GrGLCaps::reset() { | 19 void GrGLCaps::reset() { |
| 20 INHERITED::reset(); | 20 INHERITED::reset(); |
| 21 | 21 |
| 22 fVerifiedColorConfigs.reset(); | 22 fVerifiedColorConfigs.reset(); |
| 23 fStencilFormats.reset(); | 23 fStencilFormats.reset(); |
| 24 fStencilVerifiedColorConfigs.reset(); | 24 fStencilVerifiedColorConfigs.reset(); |
| 25 fMSFBOType = kNone_MSFBOType; | 25 fMSFBOType = kNone_MSFBOType; |
| 26 fInvalidateFBType = kNone_InvalidateFBType; | 26 fInvalidateFBType = kNone_InvalidateFBType; |
| 27 fLATCAlias = kLATC_LATCAlias; | 27 fLATCAlias = kLATC_LATCAlias; |
| 28 fNvprSupport = kNone_NvprSupport; |
| 28 fMapBufferType = kNone_MapBufferType; | 29 fMapBufferType = kNone_MapBufferType; |
| 29 fMaxFragmentUniformVectors = 0; | 30 fMaxFragmentUniformVectors = 0; |
| 30 fMaxVertexAttributes = 0; | 31 fMaxVertexAttributes = 0; |
| 31 fMaxFragmentTextureUnits = 0; | 32 fMaxFragmentTextureUnits = 0; |
| 32 fMaxFixedFunctionTextureCoords = 0; | 33 fMaxFixedFunctionTextureCoords = 0; |
| 33 fRGBA8RenderbufferSupport = false; | 34 fRGBA8RenderbufferSupport = false; |
| 34 fBGRAIsInternalFormat = false; | 35 fBGRAIsInternalFormat = false; |
| 35 fTextureSwizzleSupport = false; | 36 fTextureSwizzleSupport = false; |
| 36 fUnpackRowLengthSupport = false; | 37 fUnpackRowLengthSupport = false; |
| 37 fUnpackFlipYSupport = false; | 38 fUnpackFlipYSupport = false; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 60 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { | 61 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { |
| 61 *this = caps; | 62 *this = caps; |
| 62 } | 63 } |
| 63 | 64 |
| 64 GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) { | 65 GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) { |
| 65 INHERITED::operator=(caps); | 66 INHERITED::operator=(caps); |
| 66 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; | 67 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; |
| 67 fStencilFormats = caps.fStencilFormats; | 68 fStencilFormats = caps.fStencilFormats; |
| 68 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; | 69 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; |
| 69 fLATCAlias = caps.fLATCAlias; | 70 fLATCAlias = caps.fLATCAlias; |
| 71 fNvprSupport = caps.fNvprSupport; |
| 70 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; | 72 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; |
| 71 fMaxVertexAttributes = caps.fMaxVertexAttributes; | 73 fMaxVertexAttributes = caps.fMaxVertexAttributes; |
| 72 fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits; | 74 fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits; |
| 73 fMaxFixedFunctionTextureCoords = caps.fMaxFixedFunctionTextureCoords; | 75 fMaxFixedFunctionTextureCoords = caps.fMaxFixedFunctionTextureCoords; |
| 74 fMSFBOType = caps.fMSFBOType; | 76 fMSFBOType = caps.fMSFBOType; |
| 75 fInvalidateFBType = caps.fInvalidateFBType; | 77 fInvalidateFBType = caps.fInvalidateFBType; |
| 76 fMapBufferType = caps.fMapBufferType; | 78 fMapBufferType = caps.fMapBufferType; |
| 77 fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport; | 79 fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport; |
| 78 fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat; | 80 fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat; |
| 79 fTextureSwizzleSupport = caps.fTextureSwizzleSupport; | 81 fTextureSwizzleSupport = caps.fTextureSwizzleSupport; |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // setting individual fragment inputs with ProgramPathFragmentInputG
en. The API | 354 // setting individual fragment inputs with ProgramPathFragmentInputG
en. The API |
| 353 // additions are detected by checking the existence of the function.
Eventually we may | 355 // additions are detected by checking the existence of the function.
Eventually we may |
| 354 // choose to remove the fixed function codepath. | 356 // choose to remove the fixed function codepath. |
| 355 // Set fMaxFixedFunctionTextureCoords = 0 here if you want to force | 357 // Set fMaxFixedFunctionTextureCoords = 0 here if you want to force |
| 356 // ProgramPathFragmentInputGen usage on desktop. | 358 // ProgramPathFragmentInputGen usage on desktop. |
| 357 fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_ac
cess") && | 359 fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_ac
cess") && |
| 358 (fMaxFixedFunctionTextureCoords > 0 || | 360 (fMaxFixedFunctionTextureCoords > 0 || |
| 359 ((ctxInfo.version() >= GR_GL_VER(4,3) || | 361 ((ctxInfo.version() >= GR_GL_VER(4,3) || |
| 360 ctxInfo.hasExtension("GL_ARB_program_interface_query")) && | 362 ctxInfo.hasExtension("GL_ARB_program_interface_query")) && |
| 361 gli->fFunctions.fProgramPathFragmentInputGen)); | 363 gli->fFunctions.fProgramPathFragmentInputGen)); |
| 364 if (fPathRenderingSupport) { |
| 365 fNvprSupport = gli->fFunctions.fProgramPathFragmentInputGen ? kN
ormal_NvprSupport : |
| 366 kL
egacy_NvprSupport; |
| 367 } |
| 362 } else { | 368 } else { |
| 363 fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1); | 369 fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1); |
| 370 fNvprSupport = fPathRenderingSupport ? kNormal_NvprSupport : kNone_N
vprSupport; |
| 364 } | 371 } |
| 372 } else { |
| 373 fNvprSupport = kNone_NvprSupport; |
| 365 } | 374 } |
| 366 | 375 |
| 367 fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker"); | 376 fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker"); |
| 368 | 377 |
| 369 // For now these two are equivalent but we could have dst read in shader via
some other method | 378 // For now these two are equivalent but we could have dst read in shader via
some other method |
| 370 fDstReadInShaderSupport = fFBFetchSupport; | 379 fDstReadInShaderSupport = fFBFetchSupport; |
| 371 | 380 |
| 372 // Disable scratch texture reuse on Mali and Adreno devices | 381 // Disable scratch texture reuse on Mali and Adreno devices |
| 373 fReuseScratchTextures = kARM_GrGLVendor != ctxInfo.vendor() && | 382 fReuseScratchTextures = kARM_GrGLVendor != ctxInfo.vendor() && |
| 374 kQualcomm_GrGLVendor != ctxInfo.vendor(); | 383 kQualcomm_GrGLVendor != ctxInfo.vendor(); |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 1041 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 1033 r.appendf("Fragment coord conventions support: %s\n", | 1042 r.appendf("Fragment coord conventions support: %s\n", |
| 1034 (fFragCoordsConventionSupport ? "YES": "NO")); | 1043 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 1035 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 1044 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
| 1036 r.appendf("Use non-VBO for dynamic data: %s\n", | 1045 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 1037 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1046 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 1038 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 1047 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
| 1039 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 1048 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
| 1040 return r; | 1049 return r; |
| 1041 } | 1050 } |
| OLD | NEW |