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

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

Issue 345723002: Add functions to support NV_path_rendering in OpenGL ES (Closed) Base URL: https://skia.googlesource.com/skia.git@desktop-es
Patch Set: add the comment Created 6 years, 6 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
« no previous file with comments | « src/gpu/gl/GrGLAssembleInterface.cpp ('k') | src/gpu/gl/GrGLDefines.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 4a62c5acaab1ce370545f9b11d991153260d0e3f..8f2d4c129742fb9cbcb0be099b7538fbbec386d4 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -311,8 +311,27 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
// attachment, hence this min:
fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize);
- fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering") &&
- ctxInfo.hasExtension("GL_EXT_direct_state_access");
+ fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering");
+
+ if (fPathRenderingSupport) {
+ if (kGL_GrGLStandard == standard) {
+ // 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.
+ // 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));
+ } else {
+ // Note: path rendering is not yet implemented for GLES.
+ fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1) && false;
+ }
+ }
fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker");
« no previous file with comments | « src/gpu/gl/GrGLAssembleInterface.cpp ('k') | src/gpu/gl/GrGLDefines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698