aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.cpp
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2015-06-30 09:40:38 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-30 09:40:38 -0700
commit439f23e563e2ef6a497f1894c8447921f1e1f7e2 (patch)
tree82135191daab043ea3b780af7e023e451b2940fc /src/gpu/gl/GrGLCaps.cpp
parent73bb435a5896d47f633f5e58e299b88d086c71c0 (diff)
Revert of Cleanup legacy NVPR-related definitions (patchset #4 id:60001 of https://codereview.chromium.org/1177243004/)
Reason for revert: Breaks the Ubuntu *SAN bots. Original issue's description: > 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. > > Committed: https://skia.googlesource.com/skia/+/fb8d6884e0e01d0c2f8596adf5af1efb0d08de7e > > Committed: https://skia.googlesource.com/skia/+/e35b5d99d8dfcc6b2be844df28cba47436380809 TBR=joshualitt@google.com,cdalton@nvidia.com,bsalomon@google.com,kkinnunen@nvidia.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1219663005
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp45
1 files changed, 15 insertions, 30 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 539212c3a5..feb45eab88 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -279,7 +279,21 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
* GrShaderCaps fields
**************************************************************************/
- glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli);
+ 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);
+ }
+ }
// For now these two are equivalent but we could have dst read in shader via some other method
glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport;
@@ -463,35 +477,6 @@ 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