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