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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 if (!hasChromiumPathRendering && | 531 if (!hasChromiumPathRendering && |
532 ctxInfo.version() < GR_GL_VER(3, 1)) { | 532 ctxInfo.version() < GR_GL_VER(3, 1)) { |
533 return false; | 533 return false; |
534 } | 534 } |
535 } | 535 } |
536 // We only support v1.3+ of GL_NV_path_rendering which allows us to | 536 // We only support v1.3+ of GL_NV_path_rendering which allows us to |
537 // set individual fragment inputs with ProgramPathFragmentInputGen. The API | 537 // set individual fragment inputs with ProgramPathFragmentInputGen. The API |
538 // additions are detected by checking the existence of the function. | 538 // additions are detected by checking the existence of the function. |
539 // We also use *Then* functions that not all drivers might have. Check | 539 // We also use *Then* functions that not all drivers might have. Check |
540 // them for consistency. | 540 // them for consistency. |
541 if (NULL == gli->fFunctions.fStencilThenCoverFillPath || | 541 if (nullptr == gli->fFunctions.fStencilThenCoverFillPath || |
542 NULL == gli->fFunctions.fStencilThenCoverStrokePath || | 542 nullptr == gli->fFunctions.fStencilThenCoverStrokePath || |
543 NULL == gli->fFunctions.fStencilThenCoverFillPathInstanced || | 543 nullptr == gli->fFunctions.fStencilThenCoverFillPathInstanced || |
544 NULL == gli->fFunctions.fStencilThenCoverStrokePathInstanced || | 544 nullptr == gli->fFunctions.fStencilThenCoverStrokePathInstanced || |
545 NULL == gli->fFunctions.fProgramPathFragmentInputGen) { | 545 nullptr == gli->fFunctions.fProgramPathFragmentInputGen) { |
546 return false; | 546 return false; |
547 } | 547 } |
548 return true; | 548 return true; |
549 } | 549 } |
550 | 550 |
551 void GrGLCaps::initConfigRenderableTable(const GrGLContextInfo& ctxInfo, bool sr
gbSupport) { | 551 void GrGLCaps::initConfigRenderableTable(const GrGLContextInfo& ctxInfo, bool sr
gbSupport) { |
552 // OpenGL < 3.0 | 552 // OpenGL < 3.0 |
553 // no support for render targets unless the GL_ARB_framebuffer_object | 553 // no support for render targets unless the GL_ARB_framebuffer_object |
554 // extension is supported (in which case we get ALPHA, RED, RG, RGB, | 554 // extension is supported (in which case we get ALPHA, RED, RG, RGB, |
555 // RGBA (ALPHA8, RGBA4, RGBA8) for OpenGL > 1.1). Note that we | 555 // RGBA (ALPHA8, RGBA4, RGBA8) for OpenGL > 1.1). Note that we |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 | 1185 |
1186 void GrGLCaps::initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, | 1186 void GrGLCaps::initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, |
1187 const GrGLInterface* intf, | 1187 const GrGLInterface* intf, |
1188 GrGLSLCaps* glslCaps) { | 1188 GrGLSLCaps* glslCaps) { |
1189 if (kGLES_GrGLStandard == ctxInfo.standard() || ctxInfo.version() >= GR_GL_V
ER(4, 1) || | 1189 if (kGLES_GrGLStandard == ctxInfo.standard() || ctxInfo.version() >= GR_GL_V
ER(4, 1) || |
1190 ctxInfo.hasExtension("GL_ARB_ES2_compatibility")) { | 1190 ctxInfo.hasExtension("GL_ARB_ES2_compatibility")) { |
1191 for (int s = 0; s < kGrShaderTypeCount; ++s) { | 1191 for (int s = 0; s < kGrShaderTypeCount; ++s) { |
1192 if (kGeometry_GrShaderType != s) { | 1192 if (kGeometry_GrShaderType != s) { |
1193 GrShaderType shaderType = static_cast<GrShaderType>(s); | 1193 GrShaderType shaderType = static_cast<GrShaderType>(s); |
1194 GrGLenum glShader = shader_type_to_gl_shader(shaderType); | 1194 GrGLenum glShader = shader_type_to_gl_shader(shaderType); |
1195 GrShaderCaps::PrecisionInfo* first = NULL; | 1195 GrShaderCaps::PrecisionInfo* first = nullptr; |
1196 glslCaps->fShaderPrecisionVaries = false; | 1196 glslCaps->fShaderPrecisionVaries = false; |
1197 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | 1197 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
1198 GrSLPrecision precision = static_cast<GrSLPrecision>(p); | 1198 GrSLPrecision precision = static_cast<GrSLPrecision>(p); |
1199 GrGLenum glPrecision = precision_to_gl_float_type(precision)
; | 1199 GrGLenum glPrecision = precision_to_gl_float_type(precision)
; |
1200 GrGLint range[2]; | 1200 GrGLint range[2]; |
1201 GrGLint bits; | 1201 GrGLint bits; |
1202 GR_GL_GetShaderPrecisionFormat(intf, glShader, glPrecision,
range, &bits); | 1202 GR_GL_GetShaderPrecisionFormat(intf, glShader, glPrecision,
range, &bits); |
1203 if (bits) { | 1203 if (bits) { |
1204 glslCaps->fFloatPrecisions[s][p].fLogRangeLow = range[0]
; | 1204 glslCaps->fFloatPrecisions[s][p].fLogRangeLow = range[0]
; |
1205 glslCaps->fFloatPrecisions[s][p].fLogRangeHigh = range[1
]; | 1205 glslCaps->fFloatPrecisions[s][p].fLogRangeHigh = range[1
]; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 for (int p = 0; p < kGrSLPrecisionCount; ++p) { | 1237 for (int p = 0; p < kGrSLPrecisionCount; ++p) { |
1238 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = | 1238 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = |
1239 glslCaps->fFloatPrecisions[kVerte
x_GrShaderType][p]; | 1239 glslCaps->fFloatPrecisions[kVerte
x_GrShaderType][p]; |
1240 } | 1240 } |
1241 } | 1241 } |
1242 } | 1242 } |
1243 | 1243 |
1244 | 1244 |
1245 | 1245 |
1246 | 1246 |
OLD | NEW |