aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLAssembleInterface.cpp
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2014-07-02 22:56:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-02 22:56:36 -0700
commit32b9a3b02ed6b8bab4a25b6cb8853f5bea4b87ba (patch)
treeceb36c4b13a11fd105be9f1174b4b1dc5b79c72e /src/gpu/gl/GrGLAssembleInterface.cpp
parentc6bbd822107f26fdc997998e3b87dcb90f0bf5ee (diff)
Add functions to support NV_path_rendering in OpenGL ES
Add OpenGL ES extension functions needed to support NV_path_rendering in OpenGL ES. The added glProgramPathFragmentInputGenNV call is defined in NV_path_rendering revision 30, similar to following: Append to the end of the "Shader Inputs" subsection of Section 3.12.2 "Shader Execution": The command void ProgramPathFragmentInputGenNV(uint program, int location, enum genMode, int components, const float *coeffs); controls how a user-defined (non-built-in) fragment input of a GLSL program object is computed for fragment shading operations that occur as a result of CoverFillPathNV or CoverStrokePathNV. /program/ names a GLSL program object. If /program/ has not been successfully linked, the error INVALID_OPERATION is generated. The given fragment input generation state is loaded into the fragment input variable location identified by /location/. This location is a value returned either by GetProgramResourceLocation with a /programInterface/ of FRAGMENT_INPUT_NV and a given fragment shader input variable name or by GetProgramResourceiv with FRAGMENT_INPUT_NV for the /programInterface/ and LOCATION for the property for a given fragment input resource index. .... glProgramPathFragmentInputGenNV will be used instead of glPathTexGen, because the latter depends on fixed function pipeline that is not exposed in ES. Also add glGetProgramResourceLocation from OpenGL 4.3 or ARB_program_interface_query. Also add FRAGMENT_INPUT define to be used with glGetProgramResourceLocation. The added functions are not used yet, but they're needed when implementing NV_path_rendering support for OpenGL ES. They can also be used on OpenGL. Remove uncalled NV_path_rendering functions, so they do not cause confusion or take space in the interface definition. The ones that are later used can be re-added when needed. Remove definitions NV_path_rendering that are for NV_path_rendering function parameters that are not used. The ones that are later used can be re-added when needed. Committed: https://skia.googlesource.com/skia/+/4a995dfff2ecf91e8bf999d77e3218cec596232c R=bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/345723002
Diffstat (limited to 'src/gpu/gl/GrGLAssembleInterface.cpp')
-rw-r--r--src/gpu/gl/GrGLAssembleInterface.cpp38
1 files changed, 5 insertions, 33 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp
index 98dabffe13..4c02a6eb58 100644
--- a/src/gpu/gl/GrGLAssembleInterface.cpp
+++ b/src/gpu/gl/GrGLAssembleInterface.cpp
@@ -224,53 +224,21 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
if (extensions.has("GL_NV_path_rendering")) {
GET_PROC_SUFFIX(PathCommands, NV);
GET_PROC_SUFFIX(PathCoords, NV);
- GET_PROC_SUFFIX(PathSubCommands, NV);
- GET_PROC_SUFFIX(PathSubCoords, NV);
- GET_PROC_SUFFIX(PathString, NV);
- GET_PROC_SUFFIX(PathGlyphs, NV);
- GET_PROC_SUFFIX(PathGlyphRange, NV);
- GET_PROC_SUFFIX(WeightPaths, NV);
- GET_PROC_SUFFIX(CopyPath, NV);
- GET_PROC_SUFFIX(InterpolatePaths, NV);
- GET_PROC_SUFFIX(TransformPath, NV);
- GET_PROC_SUFFIX(PathParameteriv, NV);
GET_PROC_SUFFIX(PathParameteri, NV);
- GET_PROC_SUFFIX(PathParameterfv, NV);
GET_PROC_SUFFIX(PathParameterf, NV);
- GET_PROC_SUFFIX(PathDashArray, NV);
GET_PROC_SUFFIX(GenPaths, NV);
GET_PROC_SUFFIX(DeletePaths, NV);
- GET_PROC_SUFFIX(IsPath, NV);
GET_PROC_SUFFIX(PathStencilFunc, NV);
- GET_PROC_SUFFIX(PathStencilDepthOffset, NV);
GET_PROC_SUFFIX(StencilFillPath, NV);
GET_PROC_SUFFIX(StencilStrokePath, NV);
GET_PROC_SUFFIX(StencilFillPathInstanced, NV);
GET_PROC_SUFFIX(StencilStrokePathInstanced, NV);
- GET_PROC_SUFFIX(PathCoverDepthFunc, NV);
- GET_PROC_SUFFIX(PathColorGen, NV);
GET_PROC_SUFFIX(PathTexGen, NV);
- GET_PROC_SUFFIX(PathFogGen, NV);
GET_PROC_SUFFIX(CoverFillPath, NV);
GET_PROC_SUFFIX(CoverStrokePath, NV);
GET_PROC_SUFFIX(CoverFillPathInstanced, NV);
GET_PROC_SUFFIX(CoverStrokePathInstanced, NV);
- GET_PROC_SUFFIX(GetPathParameteriv, NV);
- GET_PROC_SUFFIX(GetPathParameterfv, NV);
- GET_PROC_SUFFIX(GetPathCommands, NV);
- GET_PROC_SUFFIX(GetPathCoords, NV);
- GET_PROC_SUFFIX(GetPathDashArray, NV);
- GET_PROC_SUFFIX(GetPathMetrics, NV);
- GET_PROC_SUFFIX(GetPathMetricRange, NV);
- GET_PROC_SUFFIX(GetPathSpacing, NV);
- GET_PROC_SUFFIX(GetPathColorGeniv, NV);
- GET_PROC_SUFFIX(GetPathColorGenfv, NV);
- GET_PROC_SUFFIX(GetPathTexGeniv, NV);
- GET_PROC_SUFFIX(GetPathTexGenfv, NV);
- GET_PROC_SUFFIX(IsPointInFillPath, NV);
- GET_PROC_SUFFIX(IsPointInStrokePath, NV);
- GET_PROC_SUFFIX(GetPathLength, NV);
- GET_PROC_SUFFIX(PointAlongPath, NV);
+ GET_PROC_SUFFIX(ProgramPathFragmentInputGen, NV);
}
if (extensions.has("GL_EXT_debug_marker")) {
@@ -288,6 +256,10 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
GET_PROC(InvalidateTexSubImage);
}
+ if (glVer >= GR_GL_VER(4,3) || extensions.has("GL_ARB_program_interface_query")) {
+ GET_PROC(GetProgramResourceLocation);
+ }
+
interface->fStandard = kGL_GrGLStandard;
interface->fExtensions.swap(&extensions);