| 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 fTextureRedSupport = false; | 40 fTextureRedSupport = false; |
| 41 fImagingSupport = false; | 41 fImagingSupport = false; |
| 42 fTwoFormatLimit = false; | 42 fTwoFormatLimit = false; |
| 43 fFragCoordsConventionSupport = false; | 43 fFragCoordsConventionSupport = false; |
| 44 fVertexArrayObjectSupport = false; | 44 fVertexArrayObjectSupport = false; |
| 45 fUseNonVBOVertexAndIndexDynamicData = false; | 45 fUseNonVBOVertexAndIndexDynamicData = false; |
| 46 fIsCoreProfile = false; | 46 fIsCoreProfile = false; |
| 47 fFixedFunctionSupport = false; | 47 fFixedFunctionSupport = false; |
| 48 fDiscardFBSupport = false; | 48 fDiscardFBSupport = false; |
| 49 fFullClearIsFree = false; | 49 fFullClearIsFree = false; |
| 50 fDropsTileOnZeroDivide = false; |
| 50 } | 51 } |
| 51 | 52 |
| 52 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { | 53 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { |
| 53 *this = caps; | 54 *this = caps; |
| 54 } | 55 } |
| 55 | 56 |
| 56 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { | 57 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { |
| 57 INHERITED::operator=(caps); | 58 INHERITED::operator=(caps); |
| 58 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; | 59 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; |
| 59 fStencilFormats = caps.fStencilFormats; | 60 fStencilFormats = caps.fStencilFormats; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 77 fTextureRedSupport = caps.fTextureRedSupport; | 78 fTextureRedSupport = caps.fTextureRedSupport; |
| 78 fImagingSupport = caps.fImagingSupport; | 79 fImagingSupport = caps.fImagingSupport; |
| 79 fTwoFormatLimit = caps.fTwoFormatLimit; | 80 fTwoFormatLimit = caps.fTwoFormatLimit; |
| 80 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; | 81 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; |
| 81 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; | 82 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; |
| 82 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; | 83 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; |
| 83 fIsCoreProfile = caps.fIsCoreProfile; | 84 fIsCoreProfile = caps.fIsCoreProfile; |
| 84 fFixedFunctionSupport = caps.fFixedFunctionSupport; | 85 fFixedFunctionSupport = caps.fFixedFunctionSupport; |
| 85 fDiscardFBSupport = caps.fDiscardFBSupport; | 86 fDiscardFBSupport = caps.fDiscardFBSupport; |
| 86 fFullClearIsFree = caps.fFullClearIsFree; | 87 fFullClearIsFree = caps.fFullClearIsFree; |
| 88 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; |
| 87 | 89 |
| 88 return *this; | 90 return *this; |
| 89 } | 91 } |
| 90 | 92 |
| 91 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { | 93 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { |
| 92 | 94 |
| 93 this->reset(); | 95 this->reset(); |
| 94 if (!ctxInfo.isInitialized()) { | 96 if (!ctxInfo.isInitialized()) { |
| 95 return; | 97 return; |
| 96 } | 98 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 239 } |
| 238 | 240 |
| 239 if (kGLES_GrGLStandard == standard) { | 241 if (kGLES_GrGLStandard == standard) { |
| 240 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { | 242 if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) { |
| 241 fFBFetchType = kEXT_FBFetchType; | 243 fFBFetchType = kEXT_FBFetchType; |
| 242 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { | 244 } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) { |
| 243 fFBFetchType = kNV_FBFetchType; | 245 fFBFetchType = kNV_FBFetchType; |
| 244 } | 246 } |
| 245 } | 247 } |
| 246 | 248 |
| 249 // Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero
in a shader |
| 250 fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor(); |
| 251 |
| 247 this->initFSAASupport(ctxInfo, gli); | 252 this->initFSAASupport(ctxInfo, gli); |
| 248 this->initStencilFormats(ctxInfo); | 253 this->initStencilFormats(ctxInfo); |
| 249 | 254 |
| 250 /************************************************************************** | 255 /************************************************************************** |
| 251 * GrDrawTargetCaps fields | 256 * GrDrawTargetCaps fields |
| 252 **************************************************************************/ | 257 **************************************************************************/ |
| 253 GrGLint numFormats; | 258 GrGLint numFormats; |
| 254 GR_GL_GetIntegerv(gli, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats); | 259 GR_GL_GetIntegerv(gli, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats); |
| 255 if (numFormats) { | 260 if (numFormats) { |
| 256 SkAutoSTMalloc<10, GrGLint> formats(numFormats); | 261 SkAutoSTMalloc<10, GrGLint> formats(numFormats); |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); | 659 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); |
| 655 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 660 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
| 656 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 661 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 657 r.appendf("Fragment coord conventions support: %s\n", | 662 r.appendf("Fragment coord conventions support: %s\n", |
| 658 (fFragCoordsConventionSupport ? "YES": "NO")); | 663 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 659 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 664 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
| 660 r.appendf("Use non-VBO for dynamic data: %s\n", | 665 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 661 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 666 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 662 r.appendf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" :
"NO")); | 667 r.appendf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" :
"NO")); |
| 663 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 668 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
| 669 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
| 664 return r; | 670 return r; |
| 665 } | 671 } |
| OLD | NEW |