Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Unified Diff: src/gpu/gl/GrGLCaps.cpp

Issue 437473002: Wrap NV_path_rendering API with GrGLPathRendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index f3329578ce76af14cce0be0afca5f93346799c2f..ce2583f5ac5f1f114e7eccb21454278f05469434 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -312,24 +312,39 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize);
fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering");
+ fPathRenderingV13Support = false;
if (fPathRenderingSupport) {
if (kGL_GrGLStandard == standard) {
+ fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_access");
+
+ // NVPR v1.3 introduces additional methods to the desktop API. We know the particular
+ // context we are on has v1.3 support as long as all the new methods are non-null
+ // their supporting GL functionality is present.
+ fPathRenderingV13Support = fPathRenderingSupport &&
+ NULL != gli->fFunctions.fStencilThenCoverFillPath &&
+ NULL != gli->fFunctions.fStencilThenCoverStrokePath &&
+ NULL != gli->fFunctions.fStencilThenCoverFillPathInstanced &&
+ NULL != gli->fFunctions.fStencilThenCoverStrokePathInstanced &&
+ (NULL != gli->fFunctions.fProgramPathFragmentInputGen &&
+ (ctxInfo.version() >= GR_GL_VER(4,3) ||
+ ctxInfo.hasExtension("GL_ARB_program_interface_query")));
+
// We need one of the two possible texturing methods: using fixed function pipeline
- // (PathTexGen, texcoords, ...) or using the newer NVPR API additions that support
- // setting individual fragment inputs with ProgramPathFragmentInputGen. The API
- // additions are detected by checking the existence of the function. Eventually we may
- // choose to remove the fixed function codepath.
+ // (PathTexGen, texcoords, ...) or using the newer NVPR v1.3 API additions that support
+ // setting individual fragment inputs with ProgramPathFragmentInputGen. Eventually we
+ // may choose to remove the fixed function codepath.
// Set fMaxFixedFunctionTextureCoords = 0 here if you want to force
// ProgramPathFragmentInputGen usage on desktop.
- fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_access") &&
- (fMaxFixedFunctionTextureCoords > 0 ||
- ((ctxInfo.version() >= GR_GL_VER(4,3) ||
- ctxInfo.hasExtension("GL_ARB_program_interface_query")) &&
- NULL != gli->fFunctions.fProgramPathFragmentInputGen));
+ if (0 == fMaxFixedFunctionTextureCoords && !fPathRenderingV13Support) {
+ fPathRenderingSupport = false;
+ }
} else {
// Note: path rendering is not yet implemented for GLES.
fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1) && false;
+
+ // NVpr v1.3 support is always present on GLES.
+ fPathRenderingV13Support = fPathRenderingSupport;
}
}

Powered by Google App Engine
This is Rietveld 408576698