aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.cpp
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2015-07-01 02:58:50 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-01 02:58:50 -0700
commitcfe62e30848eadead4358b0385e57723779b762b (patch)
tree7533c4b227742f1f568464be8c6b7549c7c2cac6 /src/gpu/gl/GrGLCaps.cpp
parent19fb80ed14efbe9762d417fe183def089fa7cb6c (diff)
Cleanup legacy NVPR-related definitions
Fixed-function NVPR codepaths were removed a while ago. Only NVPR API version 1.3 (PathFragmentInputGen) was left working. Remove backwards-compatibility code that was left behind. Remove some NVPR API function typedefs that were left from initial commits. Remove PathCoords function pointer from GrGLInterface, it has never been called and causes problems in the future, since it will not be implemented in the Chromium pseudo extension. Avoid failing interface creation even if nvprmsaaXX config is requested but the driver is not recent enough. The SAN bots have old driver, but try to run nvprmsaa16 configs. Instead, print out a warning. Committed: https://skia.googlesource.com/skia/+/fb8d6884e0e01d0c2f8596adf5af1efb0d08de7e Committed: https://skia.googlesource.com/skia/+/e35b5d99d8dfcc6b2be844df28cba47436380809 Review URL: https://codereview.chromium.org/1177243004
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp45
1 files changed, 30 insertions, 15 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index feb45eab88..539212c3a5 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -279,21 +279,7 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
* GrShaderCaps fields
**************************************************************************/
- glslCaps->fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering");
-
- if (glslCaps->fPathRenderingSupport) {
- if (kGL_GrGLStandard == standard) {
- // We only support v1.3+ of GL_NV_path_rendering which allows us to
- // set individual fragment inputs with ProgramPathFragmentInputGen. The API
- // additions are detected by checking the existence of the function.
- glslCaps->fPathRenderingSupport = ((ctxInfo.version() >= GR_GL_VER(4, 3) ||
- ctxInfo.hasExtension("GL_ARB_program_interface_query")) &&
- gli->fFunctions.fProgramPathFragmentInputGen);
- }
- else {
- glslCaps->fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3, 1);
- }
- }
+ glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli);
// For now these two are equivalent but we could have dst read in shader via some other method
glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport;
@@ -477,6 +463,35 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
glslCaps->applyOptionsOverrides(contextOptions);
}
+bool GrGLCaps::hasPathRenderingSupport(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
+ if (!ctxInfo.hasExtension("GL_NV_path_rendering")) {
+ return false;
+ }
+ if (kGL_GrGLStandard == ctxInfo.standard()) {
+ if (ctxInfo.version() < GR_GL_VER(4, 3) &&
+ !ctxInfo.hasExtension("GL_ARB_program_interface_query")) {
+ return false;
+ }
+ } else {
+ if (ctxInfo.version() < GR_GL_VER(3, 1)) {
+ return false;
+ }
+ }
+ // We only support v1.3+ of GL_NV_path_rendering which allows us to
+ // set individual fragment inputs with ProgramPathFragmentInputGen. The API
+ // additions are detected by checking the existence of the function.
+ // We also use *Then* functions that not all drivers might have. Check
+ // them for consistency.
+ if (NULL == gli->fFunctions.fStencilThenCoverFillPath ||
+ NULL == gli->fFunctions.fStencilThenCoverStrokePath ||
+ NULL == gli->fFunctions.fStencilThenCoverFillPathInstanced ||
+ NULL == gli->fFunctions.fStencilThenCoverStrokePathInstanced ||
+ NULL == gli->fFunctions.fProgramPathFragmentInputGen) {
+ return false;
+ }
+ return true;
+}
+
void GrGLCaps::initConfigRenderableTable(const GrGLContextInfo& ctxInfo) {
// OpenGL < 3.0
// no support for render targets unless the GL_ARB_framebuffer_object