From eeef46d181f9f8db388ecea81df699fc1b3c9280 Mon Sep 17 00:00:00 2001 From: kkinnunen Date: Thu, 2 Jul 2015 03:01:43 -0700 Subject: Implement support for CHROMIUM_path_rendering pseudo extension Implement support for path rendering in Chromium through CHROMIUM_path_rendering pseudo extension. The extension defines a new pseudo-gl function, BindFragmentInputLocation. This behaves similarly to the BindUniformLocation pseudo-gl function. The idea is to assign fragment input location to a fragment input before linking the program. BUG=chromium:344330 Review URL: https://codereview.chromium.org/1192663002 --- src/gpu/gl/GrGLInterface.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/gpu/gl/GrGLInterface.cpp') diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index 56f1e59275..9f58c73221 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -59,6 +59,7 @@ const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL; newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL; newInterface->fFunctions.fProgramPathFragmentInputGen = NULL; + newInterface->fFunctions.fBindFragmentInputLocation = NULL; return newInterface; } @@ -483,7 +484,7 @@ bool GrGLInterface::validate() const { #endif } - if (fExtensions.has("GL_NV_path_rendering")) { + if (fExtensions.has("GL_NV_path_rendering") || fExtensions.has("GL_CHROMIUM_path_rendering")) { if (NULL == fFunctions.fMatrixLoadf || NULL == fFunctions.fMatrixLoadIdentity || NULL == fFunctions.fPathCommands || @@ -515,6 +516,11 @@ bool GrGLInterface::validate() const { ) { RETURN_FALSE_INTERFACE } + if (fExtensions.has("GL_CHROMIUM_path_rendering")) { + if (NULL == fFunctions.fBindFragmentInputLocation) { + RETURN_FALSE_INTERFACE + } + } } if (fExtensions.has("GL_EXT_raster_multisample")) { -- cgit v1.2.3