| 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 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 fTwoFormatLimit = false; | 45 fTwoFormatLimit = false; |
| 46 fFragCoordsConventionSupport = false; | 46 fFragCoordsConventionSupport = false; |
| 47 fVertexArrayObjectSupport = false; | 47 fVertexArrayObjectSupport = false; |
| 48 fES2CompatibilitySupport = false; | 48 fES2CompatibilitySupport = false; |
| 49 fUseNonVBOVertexAndIndexDynamicData = false; | 49 fUseNonVBOVertexAndIndexDynamicData = false; |
| 50 fIsCoreProfile = false; | 50 fIsCoreProfile = false; |
| 51 fFullClearIsFree = false; | 51 fFullClearIsFree = false; |
| 52 fDropsTileOnZeroDivide = false; | 52 fDropsTileOnZeroDivide = false; |
| 53 fFBFetchSupport = false; | 53 fFBFetchSupport = false; |
| 54 fFBFetchNeedsCustomOutput = false; | 54 fFBFetchNeedsCustomOutput = false; |
| 55 fPreferBindingToReadAndDrawFramebuffer = false; |
| 56 |
| 55 fFBFetchColorName = NULL; | 57 fFBFetchColorName = NULL; |
| 56 fFBFetchExtensionString = NULL; | 58 fFBFetchExtensionString = NULL; |
| 57 | 59 |
| 58 fReadPixelsSupportedCache.reset(); | 60 fReadPixelsSupportedCache.reset(); |
| 59 } | 61 } |
| 60 | 62 |
| 61 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { | 63 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { |
| 62 *this = caps; | 64 *this = caps; |
| 63 } | 65 } |
| 64 | 66 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 92 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; | 94 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; |
| 93 fES2CompatibilitySupport = caps.fES2CompatibilitySupport; | 95 fES2CompatibilitySupport = caps.fES2CompatibilitySupport; |
| 94 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; | 96 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; |
| 95 fIsCoreProfile = caps.fIsCoreProfile; | 97 fIsCoreProfile = caps.fIsCoreProfile; |
| 96 fFullClearIsFree = caps.fFullClearIsFree; | 98 fFullClearIsFree = caps.fFullClearIsFree; |
| 97 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; | 99 fDropsTileOnZeroDivide = caps.fDropsTileOnZeroDivide; |
| 98 fFBFetchSupport = caps.fFBFetchSupport; | 100 fFBFetchSupport = caps.fFBFetchSupport; |
| 99 fFBFetchNeedsCustomOutput = caps.fFBFetchNeedsCustomOutput; | 101 fFBFetchNeedsCustomOutput = caps.fFBFetchNeedsCustomOutput; |
| 100 fFBFetchColorName = caps.fFBFetchColorName; | 102 fFBFetchColorName = caps.fFBFetchColorName; |
| 101 fFBFetchExtensionString = caps.fFBFetchExtensionString; | 103 fFBFetchExtensionString = caps.fFBFetchExtensionString; |
| 104 fPreferBindingToReadAndDrawFramebuffer = caps.fPreferBindingToReadAndDrawFra
mebuffer; |
| 102 | 105 |
| 103 return *this; | 106 return *this; |
| 104 } | 107 } |
| 105 | 108 |
| 106 bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { | 109 bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { |
| 107 | 110 |
| 108 this->reset(); | 111 this->reset(); |
| 109 if (!ctxInfo.isInitialized()) { | 112 if (!ctxInfo.isInitialized()) { |
| 110 return false; | 113 return false; |
| 111 } | 114 } |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch"; | 275 fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch"; |
| 273 } | 276 } |
| 274 } | 277 } |
| 275 | 278 |
| 276 // Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero
in a shader | 279 // Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero
in a shader |
| 277 fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor(); | 280 fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor(); |
| 278 | 281 |
| 279 this->initFSAASupport(ctxInfo, gli); | 282 this->initFSAASupport(ctxInfo, gli); |
| 280 this->initStencilFormats(ctxInfo); | 283 this->initStencilFormats(ctxInfo); |
| 281 | 284 |
| 285 // Workaround for Mac/Chromium issue. |
| 286 #ifdef SK_BUILD_FOR_MAC |
| 287 // This relies on the fact that initFSAASupport() was already called. |
| 288 fPreferBindingToReadAndDrawFramebuffer = ctxInfo.isChromium() && this->usesM
SAARenderBuffers(); |
| 289 #endif |
| 290 |
| 282 /************************************************************************** | 291 /************************************************************************** |
| 283 * GrDrawTargetCaps fields | 292 * GrDrawTargetCaps fields |
| 284 **************************************************************************/ | 293 **************************************************************************/ |
| 285 if (kGL_GrGLStandard == standard) { | 294 if (kGL_GrGLStandard == standard) { |
| 286 // we could also look for GL_ATI_separate_stencil extension or | 295 // we could also look for GL_ATI_separate_stencil extension or |
| 287 // GL_EXT_stencil_two_side but they use different function signatures | 296 // GL_EXT_stencil_two_side but they use different function signatures |
| 288 // than GL2.0+ (and than each other). | 297 // than GL2.0+ (and than each other). |
| 289 fTwoSidedStencilSupport = (ctxInfo.version() >= GR_GL_VER(2,0)); | 298 fTwoSidedStencilSupport = (ctxInfo.version() >= GR_GL_VER(2,0)); |
| 290 // supported on GL 1.4 and higher or by extension | 299 // supported on GL 1.4 and higher or by extension |
| 291 fStencilWrapOpsSupport = (ctxInfo.version() >= GR_GL_VER(1,4)) || | 300 fStencilWrapOpsSupport = (ctxInfo.version() >= GR_GL_VER(1,4)) || |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 1057 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 1049 r.appendf("Fragment coord conventions support: %s\n", | 1058 r.appendf("Fragment coord conventions support: %s\n", |
| 1050 (fFragCoordsConventionSupport ? "YES": "NO")); | 1059 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 1051 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 1060 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
| 1052 r.appendf("Use non-VBO for dynamic data: %s\n", | 1061 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 1053 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1062 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 1054 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 1063 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
| 1055 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); | 1064 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES"
: "NO")); |
| 1056 return r; | 1065 return r; |
| 1057 } | 1066 } |
| OLD | NEW |