| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 fInstancedDrawingSupport = false; | 43 fInstancedDrawingSupport = false; |
| 44 fDirectStateAccessSupport = false; | 44 fDirectStateAccessSupport = false; |
| 45 fDebugSupport = false; | 45 fDebugSupport = false; |
| 46 fES2CompatibilitySupport = false; | 46 fES2CompatibilitySupport = false; |
| 47 fMultisampleDisableSupport = false; | 47 fMultisampleDisableSupport = false; |
| 48 fUseNonVBOVertexAndIndexDynamicData = false; | 48 fUseNonVBOVertexAndIndexDynamicData = false; |
| 49 fIsCoreProfile = false; | 49 fIsCoreProfile = false; |
| 50 fFullClearIsFree = false; | 50 fFullClearIsFree = false; |
| 51 fBindFragDataLocationSupport = false; | 51 fBindFragDataLocationSupport = false; |
| 52 fSRGBWriteControl = false; | 52 fSRGBWriteControl = false; |
| 53 fRGBA8888PixelsOpsAreSlow = false; |
| 54 fPartialFBOReadIsSlow = false; |
| 53 | 55 |
| 54 fReadPixelsSupportedCache.reset(); | 56 fReadPixelsSupportedCache.reset(); |
| 55 | 57 |
| 56 fShaderCaps.reset(SkNEW_ARGS(GrGLSLCaps, (contextOptions))); | 58 fShaderCaps.reset(SkNEW_ARGS(GrGLSLCaps, (contextOptions))); |
| 57 | 59 |
| 58 this->init(contextOptions, ctxInfo, glInterface); | 60 this->init(contextOptions, ctxInfo, glInterface); |
| 59 } | 61 } |
| 60 | 62 |
| 61 void GrGLCaps::init(const GrContextOptions& contextOptions, | 63 void GrGLCaps::init(const GrContextOptions& contextOptions, |
| 62 const GrGLContextInfo& ctxInfo, | 64 const GrGLContextInfo& ctxInfo, |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 if (kGL_GrGLStandard == standard) { | 299 if (kGL_GrGLStandard == standard) { |
| 298 if (version >= GR_GL_VER(3, 0)) { | 300 if (version >= GR_GL_VER(3, 0)) { |
| 299 fBindFragDataLocationSupport = true; | 301 fBindFragDataLocationSupport = true; |
| 300 } | 302 } |
| 301 } else { | 303 } else { |
| 302 if (version >= GR_GL_VER(3, 0) && ctxInfo.hasExtension("GL_EXT_blend_fun
c_extended")) { | 304 if (version >= GR_GL_VER(3, 0) && ctxInfo.hasExtension("GL_EXT_blend_fun
c_extended")) { |
| 303 fBindFragDataLocationSupport = true; | 305 fBindFragDataLocationSupport = true; |
| 304 } | 306 } |
| 305 } | 307 } |
| 306 | 308 |
| 309 #ifdef SK_BUILD_FOR_WIN |
| 310 // We're assuming that on Windows Chromium we're using ANGLE. |
| 311 bool isANGLE = kANGLE_GrGLDriver == ctxInfo.driver() || |
| 312 kChromium_GrGLDriver == ctxInfo.driver(); |
| 313 // Angle has slow read/write pixel paths for 32bit RGBA (but fast for BGRA).
|
| 314 fRGBA8888PixelsOpsAreSlow = isANGLE; |
| 315 // On DX9 ANGLE reading a partial FBO is slow. TODO: Check whether this is s
till true and |
| 316 // check DX11 ANGLE. |
| 317 fPartialFBOReadIsSlow = isANGLE; |
| 318 #endif |
| 319 |
| 307 /************************************************************************** | 320 /************************************************************************** |
| 308 * GrShaderCaps fields | 321 * GrShaderCaps fields |
| 309 **************************************************************************/ | 322 **************************************************************************/ |
| 310 | 323 |
| 311 glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli
); | 324 glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli
); |
| 312 | 325 |
| 313 // For now these two are equivalent but we could have dst read in shader via
some other method | 326 // For now these two are equivalent but we could have dst read in shader via
some other method |
| 314 glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport; | 327 glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport; |
| 315 | 328 |
| 316 // Enable supported shader-related caps | 329 // Enable supported shader-related caps |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 (fFragCoordsConventionSupport ? "YES": "NO")); | 1138 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 1126 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); | 1139 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ?
"YES": "NO")); |
| 1127 r.appendf("Instanced drawing support: %s\n", (fInstancedDrawingSupport ? "YE
S": "NO")); | 1140 r.appendf("Instanced drawing support: %s\n", (fInstancedDrawingSupport ? "YE
S": "NO")); |
| 1128 r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ?
"YES": "NO")); | 1141 r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ?
"YES": "NO")); |
| 1129 r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO")); | 1142 r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO")); |
| 1130 r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ?
"YES" : "NO")); | 1143 r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ?
"YES" : "NO")); |
| 1131 r.appendf("Use non-VBO for dynamic data: %s\n", | 1144 r.appendf("Use non-VBO for dynamic data: %s\n", |
| 1132 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 1145 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 1133 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); | 1146 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO
")); |
| 1134 r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO")); | 1147 r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO")); |
| 1148 r.appendf("RGBA 8888 pixel ops are slow: %s\n", (fRGBA8888PixelsOpsAreSlow?
"YES" : "NO")); |
| 1149 r.appendf("Partial FBO read is slow: %s\n", (fPartialFBOReadIsSlow? "YES" :
"NO")); |
| 1135 return r; | 1150 return r; |
| 1136 } | 1151 } |
| 1137 | 1152 |
| 1138 static GrGLenum precision_to_gl_float_type(GrSLPrecision p) { | 1153 static GrGLenum precision_to_gl_float_type(GrSLPrecision p) { |
| 1139 switch (p) { | 1154 switch (p) { |
| 1140 case kLow_GrSLPrecision: | 1155 case kLow_GrSLPrecision: |
| 1141 return GR_GL_LOW_FLOAT; | 1156 return GR_GL_LOW_FLOAT; |
| 1142 case kMedium_GrSLPrecision: | 1157 case kMedium_GrSLPrecision: |
| 1143 return GR_GL_MEDIUM_FLOAT; | 1158 return GR_GL_MEDIUM_FLOAT; |
| 1144 case kHigh_GrSLPrecision: | 1159 case kHigh_GrSLPrecision: |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | 1230 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
| 1216 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = | 1231 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = |
| 1217 glslCaps->fFloatPrecisions[kVerte
x_GrShaderType][p]; | 1232 glslCaps->fFloatPrecisions[kVerte
x_GrShaderType][p]; |
| 1218 } | 1233 } |
| 1219 } | 1234 } |
| 1220 } | 1235 } |
| 1221 | 1236 |
| 1222 | 1237 |
| 1223 | 1238 |
| 1224 | 1239 |
| OLD | NEW |