diff options
author | cdalton <cdalton@nvidia.com> | 2014-08-11 14:05:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-11 14:05:05 -0700 |
commit | c7103a104fdc7150b4e3c0d3efc42735ad359616 (patch) | |
tree | 3e11441cfff0533cf05b542b9718036eb52ef757 /src/gpu/gl/GrGLInterface.cpp | |
parent | 5acfea789d39106dbc706c6ee85cd8f027fce3ed (diff) |
Wrap NV_path_rendering API with GrGLPathRendering
Adds a GrGLPathRendering class that wraps the NV_path_rendering
extension and manages its various API versions. It also provides
backup implementations when certain NVpr methods from later API
versions are not present on the current system.
BUG=skia:
R=bungeman@google.com, bsalomon@google.com, kkinnunen@nvidia.com
Author: cdalton@nvidia.com
Review URL: https://codereview.chromium.org/444223002
Diffstat (limited to 'src/gpu/gl/GrGLInterface.cpp')
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index e9ba32ed24..c192611f50 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -56,6 +56,10 @@ const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { newInterface->fFunctions.fCoverStrokePath = NULL; newInterface->fFunctions.fCoverFillPathInstanced = NULL; newInterface->fFunctions.fCoverStrokePathInstanced = NULL; + newInterface->fFunctions.fStencilThenCoverFillPath = NULL; + newInterface->fFunctions.fStencilThenCoverStrokePath = NULL; + newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL; + newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL; newInterface->fFunctions.fProgramPathFragmentInputGen = NULL; return newInterface; } @@ -467,18 +471,23 @@ bool GrGLInterface::validate() const { NULL == fFunctions.fCoverFillPath || NULL == fFunctions.fCoverStrokePath || NULL == fFunctions.fCoverFillPathInstanced || - NULL == fFunctions.fCoverStrokePathInstanced || - NULL == fFunctions.fStencilThenCoverFillPath || - NULL == fFunctions.fStencilThenCoverStrokePath || - NULL == fFunctions.fStencilThenCoverFillPathInstanced || - NULL == fFunctions.fStencilThenCoverStrokePathInstanced) { + NULL == fFunctions.fCoverStrokePathInstanced) { RETURN_FALSE_INTERFACE } - // Currently ProgramPathFragmentInputGen is not used on - // OpenGL, rather PathTexGen is. - if ((kGL_GrGLStandard == fStandard && NULL == fFunctions.fPathTexGen) || - (kGLES_GrGLStandard == fStandard && NULL == fFunctions.fProgramPathFragmentInputGen)) { - RETURN_FALSE_INTERFACE + if (kGL_GrGLStandard == fStandard) { + // Some methods only exist on desktop + if (NULL == fFunctions.fPathTexGen) { + RETURN_FALSE_INTERFACE + } + } else { + // All additions through v1.3 exist on GLES + if (NULL == fFunctions.fStencilThenCoverFillPath || + NULL == fFunctions.fStencilThenCoverStrokePath || + NULL == fFunctions.fStencilThenCoverFillPathInstanced || + NULL == fFunctions.fStencilThenCoverStrokePathInstanced || + NULL == fFunctions.fProgramPathFragmentInputGen) { + RETURN_FALSE_INTERFACE + } } } |