diff --git a/include/gpu/gl/GrGLFunctions.h b/include/gpu/gl/GrGLFunctions.h index 65c6330618..d8f2764258 100644 --- a/include/gpu/gl/GrGLFunctions.h +++ b/include/gpu/gl/GrGLFunctions.h @@ -160,6 +160,62 @@ extern "C" { typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLVertexAttrib4fvProc)(GrGLuint indx, const GrGLfloat* values); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLVertexAttribPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const GrGLvoid* ptr); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLViewportProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height); + + // Experimental: Functions for GL_NV_path_rendering. These will be + // alphabetized with the above functions once this is fully supported + // (and functions we are unlikely to use will possibly be omitted). + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLMatrixModeProc)(GrGLenum); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLLoadIdentityProc)(); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLLoadMatrixfProc)(const GrGLfloat* m); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathCommandsProc)(GrGLuint path, GrGLsizei numCommands, const GrGLubyte *commands, GrGLsizei numCoords, GrGLenum coordType, const void *coords); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathCoordsProc)(GrGLuint path, GrGLsizei numCoords, GrGLenum coordType, const void *coords); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathSubCommandsProc)(GrGLuint path, GrGLsizei commandStart, GrGLsizei commandsToDelete, GrGLsizei numCommands, const GrGLubyte *commands, GrGLsizei numCoords, GrGLenum coordType, const void *coords); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathSubCoordsProc)(GrGLuint path, GrGLsizei coordStart, GrGLsizei numCoords, GrGLenum coordType, const void *coords); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathStringProc)(GrGLuint path, GrGLenum format, GrGLsizei length, const void *pathString); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathGlyphsProc)(GrGLuint firstPathName, GrGLenum fontTarget, const void *fontName, GrGLbitfield fontStyle, GrGLsizei numGlyphs, GrGLenum type, const void *charcodes, GrGLenum handleMissingGlyphs, GrGLuint pathParameterTemplate, float emScale); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathGlyphRangeProc)(GrGLuint firstPathName, GrGLenum fontTarget, const void *fontName, GrGLbitfield fontStyle, GrGLuint firstGlyph, GrGLsizei numGlyphs, GrGLenum handleMissingGlyphs, GrGLuint pathParameterTemplate, float emScale); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLWeightPathsProc)(GrGLuint resultPath, GrGLsizei numPaths, const GrGLuint paths[], const float weights[]); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCopyPathProc)(GrGLuint resultPath, GrGLuint srcPath); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLInterpolatePathsProc)(GrGLuint resultPath, GrGLuint pathA, GrGLuint pathB, float weight); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLTransformPathProc)(GrGLuint resultPath, GrGLuint srcPath, GrGLenum transformType, const float *transformValues); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathParameterivProc)(GrGLuint path, GrGLenum pname, const int *value); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathParameteriProc)(GrGLuint path, GrGLenum pname, int value); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathParameterfvProc)(GrGLuint path, GrGLenum pname, const float *value); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathParameterfProc)(GrGLuint path, GrGLenum pname, float value); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathDashArrayProc)(GrGLuint path, GrGLsizei dashCount, const float *dashArray); + typedef GrGLuint (GR_GL_FUNCTION_TYPE* GrGLGenPathsProc)(GrGLsizei range); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLDeletePathsProc)(GrGLuint path, GrGLsizei range); + typedef GrGLboolean (GR_GL_FUNCTION_TYPE* GrGLIsPathProc)(GrGLuint path); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathStencilFuncProc)(GrGLenum func, int ref, GrGLuint mask); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathStencilDepthOffsetProc)(float factor, int units); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLStencilFillPathProc)(GrGLuint path, GrGLenum fillMode, GrGLuint mask); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLStencilStrokePathProc)(GrGLuint path, int reference, GrGLuint mask); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLStencilFillPathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const void *paths, GrGLuint pathBase, GrGLenum fillMode, GrGLuint mask, GrGLenum transformType, const float *transformValues); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLStencilStrokePathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const void *paths, GrGLuint pathBase, int reference, GrGLuint mask, GrGLenum transformType, const float *transformValues); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathCoverDepthFuncProc)(GrGLenum zfunc); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathColorGenProc)(GrGLenum color, GrGLenum genMode, GrGLenum colorFormat, const float *coeffs); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathTexGenProc)(GrGLenum texCoordSet, GrGLenum genMode, int components, const float *coeffs); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathFogGenProc)(GrGLenum genMode); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCoverFillPathProc)(GrGLuint path, GrGLenum coverMode); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCoverStrokePathProc)(GrGLuint name, GrGLenum coverMode); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCoverFillPathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const void *paths, GrGLuint pathBase, GrGLenum coverMode, GrGLenum transformType, const float *transformValues); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCoverStrokePathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const void *paths, GrGLuint pathBase, GrGLenum coverMode, GrGLenum transformType, const float* transformValues); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathParameterivProc)(GrGLuint name, GrGLenum param, int *value); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathParameterfvProc)(GrGLuint name, GrGLenum param, float *value); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathCommandsProc)(GrGLuint name, GrGLubyte *commands); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathCoordsProc)(GrGLuint name, float *coords); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathDashArrayProc)(GrGLuint name, float *dashArray); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathMetricsProc)(GrGLbitfield metricQueryMask, GrGLsizei numPaths, GrGLenum pathNameType, const void *paths, GrGLuint pathBase, GrGLsizei stride, float *metrics); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathMetricRangeProc)(GrGLbitfield metricQueryMask, GrGLuint fistPathName, GrGLsizei numPaths, GrGLsizei stride, float *metrics); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathSpacingProc)(GrGLenum pathListMode, GrGLsizei numPaths, GrGLenum pathNameType, const void *paths, GrGLuint pathBase, float advanceScale, float kerningScale, GrGLenum transformType, float *returnedSpacing); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathColorGenivProc)(GrGLenum color, GrGLenum pname, int *value); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathColorGenfvProc)(GrGLenum color, GrGLenum pname, float *value); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathTexGenivProc)(GrGLenum texCoordSet, GrGLenum pname, int *value); + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetPathTexGenfvProc)(GrGLenum texCoordSet, GrGLenum pname, float *value); + typedef GrGLboolean (GR_GL_FUNCTION_TYPE* GrGLIsPointInFillPathProc)(GrGLuint path, GrGLuint mask, float x, float y); + typedef GrGLboolean (GR_GL_FUNCTION_TYPE* GrGLIsPointInStrokePathProc)(GrGLuint path, float x, float y); + typedef GrGLfloat (GR_GL_FUNCTION_TYPE* GrGLGetPathLengthProc)(GrGLuint path, GrGLsizei startSegment, GrGLsizei numSegments); + typedef GrGLboolean (GR_GL_FUNCTION_TYPE* GrGLPointAlongPathProc)(GrGLuint path, GrGLsizei startSegment, GrGLsizei numSegments, float distance, float *x, float *y, float *tangentX, float *tangentY); } // extern "C" #endif diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h index d7cdfea476..4032a55d2d 100644 --- a/include/gpu/gl/GrGLInterface.h +++ b/include/gpu/gl/GrGLInterface.h @@ -252,6 +252,62 @@ public: GLPtr fVertexAttribPointer; GLPtr fViewport; + // Experimental: Functions for GL_NV_path_rendering. These will be + // alphabetized with the above functions once this is fully supported + // (and functions we are unlikely to use will possibly be omitted). + GLPtr fMatrixMode; + GLPtr fLoadIdentity; + GLPtr fLoadMatrixf; + GLPtr fPathCommands; + GLPtr fPathCoords; + GLPtr fPathSubCommands; + GLPtr fPathSubCoords; + GLPtr fPathString; + GLPtr fPathGlyphs; + GLPtr fPathGlyphRange; + GLPtr fWeightPaths; + GLPtr fCopyPath; + GLPtr fInterpolatePaths; + GLPtr fTransformPath; + GLPtr fPathParameteriv; + GLPtr fPathParameteri; + GLPtr fPathParameterfv; + GLPtr fPathParameterf; + GLPtr fPathDashArray; + GLPtr fGenPaths; + GLPtr fDeletePaths; + GLPtr fIsPath; + GLPtr fPathStencilFunc; + GLPtr fPathStencilDepthOffset; + GLPtr fStencilFillPath; + GLPtr fStencilStrokePath; + GLPtr fStencilFillPathInstanced; + GLPtr fStencilStrokePathInstanced; + GLPtr fPathCoverDepthFunc; + GLPtr fPathColorGen; + GLPtr fPathTexGen; + GLPtr fPathFogGen; + GLPtr fCoverFillPath; + GLPtr fCoverStrokePath; + GLPtr fCoverFillPathInstanced; + GLPtr fCoverStrokePathInstanced; + GLPtr fGetPathParameteriv; + GLPtr fGetPathParameterfv; + GLPtr fGetPathCommands; + GLPtr fGetPathCoords; + GLPtr fGetPathDashArray; + GLPtr fGetPathMetrics; + GLPtr fGetPathMetricRange; + GLPtr fGetPathSpacing; + GLPtr fGetPathColorGeniv; + GLPtr fGetPathColorGenfv; + GLPtr fGetPathTexGeniv; + GLPtr fGetPathTexGenfv; + GLPtr fIsPointInFillPath; + GLPtr fIsPointInStrokePath; + GLPtr fGetPathLength; + GLPtr fPointAlongPath; + // Per-GL func callback #if GR_GL_PER_GL_FUNC_CALLBACK GrGLInterfaceCallbackProc fCallback; diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h index 7bd1f02591..9af209ca66 100644 --- a/src/gpu/gl/GrGLDefines.h +++ b/src/gpu/gl/GrGLDefines.h @@ -490,8 +490,8 @@ #define GR_GL_SPHERE_MAP 0x2402 #define GR_GL_DECAL 0x2101 #define GR_GL_MODULATE 0x2100 -/* GL_NEAREST */ -/* GL_REPEAT */ +/* GL_NEAREST */ +/* GL_REPEAT */ #define GR_GL_CLAMP 0x2900 #define GR_GL_S 0x2000 #define GR_GL_T 0x2001 @@ -701,4 +701,182 @@ #define GR_GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +/* Path Rendering */ +// commands +#define GR_GL_CLOSE_PATH 0x00 +#define GR_GL_MOVE_TO 0x02 +#define GR_GL_RELATIVE_MOVE_TO 0x03 +#define GR_GL_LINE_TO 0x04 +#define GR_GL_RELATIVE_LINE_TO 0x05 +#define GR_GL_HORIZONTAL_LINE_TO 0x06 +#define GR_GL_RELATIVE_HORIZONTAL_LINE_TO 0x07 +#define GR_GL_VERTICAL_LINE_TO 0x08 +#define GR_GL_RELATIVE_VERTICAL_LINE_TO 0x09 +#define GR_GL_QUADRATIC_CURVE_TO 0x0A +#define GR_GL_RELATIVE_QUADRATIC_CURVE_TO 0x0B +#define GR_GL_CUBIC_CURVE_TO 0x0C +#define GR_GL_RELATIVE_CUBIC_CURVE_TO 0x0D +#define GR_GL_SMOOTH_QUADRATIC_CURVE_TO 0x0E +#define GR_GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO 0x0F +#define GR_GL_SMOOTH_CUBIC_CURVE_TO 0x10 +#define GR_GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO 0x11 +#define GR_GL_SMALL_CCW_ARC_TO 0x12 +#define GR_GL_RELATIVE_SMALL_CCW_ARC_TO 0x13 +#define GR_GL_SMALL_CW_ARC_TO 0x14 +#define GR_GL_RELATIVE_SMALL_CW_ARC_TO 0x15 +#define GR_GL_LARGE_CCW_ARC_TO 0x16 +#define GR_GL_RELATIVE_LARGE_CCW_ARC_TO 0x17 +#define GR_GL_LARGE_CW_ARC_TO 0x18 +#define GR_GL_RELATIVE_LARGE_CW_ARC_TO 0x19 +#define GR_GL_CIRCULAR_CCW_ARC_TO 0xF8 +#define GR_GL_CIRCULAR_CW_ARC_TO 0xFA +#define GR_GL_CIRCULAR_TANGENT_ARC_TO 0xFC +#define GR_GL_ARC_TO 0xFE +#define GR_GL_RELATIVE_ARC_TO 0xFF + +// path string formats +#define GR_GL_PATH_FORMAT_SVG 0x9070 +#define GR_GL_PATH_FORMAT_PS 0x9071 + +// font targets +#define GR_GL_STANDARD_FONT_NAME 0x9072 +#define GR_GL_SYSTEM_FONT_NAME 0x9073 +#define GR_GL_FILE_NAME 0x9074 + +// handle missing glyphs +#define GR_GL_SKIP_MISSING_GLYPH 0x90A9 +#define GR_GL_USE_MISSING_GLYPH 0x90AA + +// path parameters +#define GR_GL_PATH_STROKE_WIDTH 0x9075 +#define GR_GL_PATH_INITIAL_END_CAP 0x9077 +#define GR_GL_PATH_TERMINAL_END_CAP 0x9078 +#define GR_GL_PATH_JOIN_STYLE 0x9079 +#define GR_GL_PATH_MITER_LIMIT 0x907A +#define GR_GL_PATH_INITIAL_DASH_CAP 0x907C +#define GR_GL_PATH_TERMINAL_DASH_CAP 0x907D +#define GR_GL_PATH_DASH_OFFSET 0x907E +#define GR_GL_PATH_CLIENT_LENGTH 0x907F +#define GR_GL_PATH_DASH_OFFSET_RESET 0x90B4 +#define GR_GL_PATH_FILL_MODE 0x9080 +#define GR_GL_PATH_FILL_MASK 0x9081 +#define GR_GL_PATH_FILL_COVER_MODE 0x9082 +#define GR_GL_PATH_STROKE_COVER_MODE 0x9083 +#define GR_GL_PATH_STROKE_MASK 0x9084 +#define GR_GL_PATH_END_CAPS 0x9076 +#define GR_GL_PATH_DASH_CAPS 0x907B +#define GR_GL_PATH_COMMAND_COUNT 0x909D +#define GR_GL_PATH_COORD_COUNT 0x909E +#define GR_GL_PATH_DASH_ARRAY_COUNT 0x909F +#define GR_GL_PATH_FILL_BOUNDING_BOX 0x90A1 +#define GR_GL_PATH_STROKE_BOUNDING_BOX 0x90A2 + +// fill modes +/* GL_INVERT */ +#define GR_GL_COUNT_UP 0x9088 +#define GR_GL_COUNT_DOWN 0x9089 +/* GL_PATH_FILL_MODE_NV */ + +// path color gen +/* GL_PRIMARY_COLOR */ +#define GR_GL_SECONDARY_COLOR 0x852D + +// gen mode +/* GL_NONE */ +/* GL_EYE_LINEAR */ +/* GL_OBJECT_LINEAR */ +#define GR_GL_PATH_OBJECT_BOUNDING_BOX 0x908A + +// cover mode +#define GR_GL_CONVEX_HULL 0x908B +#define GR_GL_BOUNDING_BOX 0x908D +#define GR_GL_BOUNDING_BOX_OF_BOUNDING_BOXES 0x909C +/* GL_PATH_FILL_COVER_MODE_NV */ + +// transform type +/* GL_NONE */ +#define GR_GL_TRANSLATE_X 0x908E +#define GR_GL_TRANSLATE_Y 0x908F +#define GR_GL_TRANSLATE_2D 0x9090 +#define GR_GL_TRANSLATE_3D 0x9091 +#define GR_GL_AFFINE_2D 0x9092 +#define GR_GL_AFFINE_3D 0x9094 +#define GR_GL_TRANSPOSE_AFFINE_2D 0x9096 +#define GR_GL_TRANSPOSE_AFFINE_3D 0x9098 + +// path string types +#define GR_GL_UTF8 0x909A +#define GR_GL_UTF16 0x909B + +#define GR_GL_PATH_COMPUTED_LENGTH 0x90A0 + +// cap/dash values +/* GL_FLAT */ +#define GR_GL_SQUARE 0x90A3 +#define GR_GL_ROUND 0x90A4 +#define GR_GL_TRIANGULAR 0x90A5 + +// join values +/* GL_NONE */ +/* GL_ROUND_NV */ +#define GR_GL_BEVEL 0x90A6 +#define GR_GL_MITER_REVERT 0x90A7 +#define GR_GL_MITER_TRUNCATE 0x90A8 + +// path dash reset values +#define GR_GL_MOVE_TO_RESETS 0x90B5 +#define GR_GL_MOVE_TO_CONTINUES 0x90B6 + +// font styles +/* GL_NONE */ +#define GR_GL_BOLD_BIT 0x01 +#define GR_GL_ITALIC_BIT 0x02 + +// pnames for glGet +#define GR_GL_PATH_ERROR_POSITION 0x90AB +#define GR_GL_PATH_FOG_GEN_MODE 0x90AC +#define GR_GL_PATH_STENCIL_FUNC 0x90B7 +#define GR_GL_PATH_STENCIL_REF 0x90B8 +#define GR_GL_PATH_STENCIL_VALUE_MASK 0x90B9 +#define GR_GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR 0x90BD +#define GR_GL_PATH_STENCIL_DEPTH_OFFSET_UNITS 0x90BE +#define GR_GL_PATH_COVER_DEPTH_FUNC 0x90BF + +// per-glyph metrics bits in metric mask query +#define GR_GL_GLYPH_WIDTH_BIT 0x01 +#define GR_GL_GLYPH_HEIGHT_BIT 0x02 +#define GR_GL_GLYPH_HORIZONTAL_BEARING_X_BIT 0x04 +#define GR_GL_GLYPH_HORIZONTAL_BEARING_Y_BIT 0x08 +#define GR_GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT 0x10 +#define GR_GL_GLYPH_VERTICAL_BEARING_X_BIT 0x20 +#define GR_GL_GLYPH_VERTICAL_BEARING_Y_BIT 0x40 +#define GR_GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT 0x80 +#define GR_GL_GLYPH_HAS_KERNING 0x100 + +// per-font face metrics in metric mask query +#define GR_GL_FONT_X_MIN_BOUNDS 0x00010000 +#define GR_GL_FONT_Y_MIN_BOUNDS 0x00020000 +#define GR_GL_FONT_X_MAX_BOUNDS 0x00040000 +#define GR_GL_FONT_Y_MAX_BOUNDS 0x00080000 +#define GR_GL_FONT_UNITS_PER_EM 0x00100000 +#define GR_GL_FONT_ASCENDER 0x00200000 +#define GR_GL_FONT_DESCENDER 0x00400000 +#define GR_GL_FONT_HEIGHT 0x00800000 +#define GR_GL_FONT_MAX_ADVANCE_WIDTH 0x01000000 +#define GR_GL_FONT_MAX_ADVANCE_HEIGHT 0x02000000 +#define GR_GL_FONT_UNDERLINE_POSITION 0x04000000 +#define GR_GL_FONT_UNDERLINE_THICKNESS 0x08000000 +#define GR_GL_FONT_HAS_KERNING 0x10000000 + +// path list modes (glGetPathSpacing) +#define GR_GL_ACCUM_ADJACENT_PAIRS 0x90AD +#define GR_GL_ADJACENT_PAIRS 0x90AE +#define GR_GL_FIRST_TO_REST 0x90AF + +//path gen modes +#define GR_GL_PATH_GEN_MODE 0x90B0 +#define GR_GL_PATH_GEN_COEFF 0x90B1 +#define GR_GL_PATH_GEN_COLOR_FORMAT 0x90B2 +#define GR_GL_PATH_GEN_COMPONENTS 0x90B3 + #endif diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index a0078b0ba8..34d6a74b38 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -192,6 +192,68 @@ bool GrGLInterface::validate(GrGLBinding binding) const { return false; } } + // The below two blocks are checks for functions used with + // GL_NV_path_rendering. We're not enforcing that they be non-NULL + // because they aren't actually called at this time. + if (false && + NULL == fMatrixMode || + NULL == fLoadIdentity || + NULL == fLoadMatrixf) { + return false; + } + if (false && GrGLHasExtensionFromString("GL_NV_path_rendering", ext)) { + if (NULL == fPathCommands || + NULL == fPathCoords || + NULL == fPathSubCommands || + NULL == fPathSubCoords || + NULL == fPathString || + NULL == fPathGlyphs || + NULL == fPathGlyphRange || + NULL == fWeightPaths || + NULL == fCopyPath || + NULL == fInterpolatePaths || + NULL == fTransformPath || + NULL == fPathParameteriv || + NULL == fPathParameteri || + NULL == fPathParameterfv || + NULL == fPathParameterf || + NULL == fPathDashArray || + NULL == fGenPaths || + NULL == fDeletePaths || + NULL == fIsPath || + NULL == fPathStencilFunc || + NULL == fPathStencilDepthOffset || + NULL == fStencilFillPath || + NULL == fStencilStrokePath || + NULL == fStencilFillPathInstanced || + NULL == fStencilStrokePathInstanced || + NULL == fPathCoverDepthFunc || + NULL == fPathColorGen || + NULL == fPathTexGen || + NULL == fPathFogGen || + NULL == fCoverFillPath || + NULL == fCoverStrokePath || + NULL == fCoverFillPathInstanced || + NULL == fCoverStrokePathInstanced || + NULL == fGetPathParameteriv || + NULL == fGetPathParameterfv || + NULL == fGetPathCommands || + NULL == fGetPathCoords || + NULL == fGetPathDashArray || + NULL == fGetPathMetrics || + NULL == fGetPathMetricRange || + NULL == fGetPathSpacing || + NULL == fGetPathColorGeniv || + NULL == fGetPathColorGenfv || + NULL == fGetPathTexGeniv || + NULL == fGetPathTexGenfv || + NULL == fIsPointInFillPath || + NULL == fIsPointInStrokePath || + NULL == fGetPathLength || + NULL == fPointAlongPath) { + return false; + } + } } // optional function on desktop before 1.3 diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp index e41edc2653..554dd5c1bb 100644 --- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp +++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp @@ -79,6 +79,9 @@ const GrGLInterface* GrGLCreateNativeInterface() { interface->fGetString = glGetString; interface->fGetTexLevelParameteriv = glGetTexLevelParameteriv; interface->fLineWidth = glLineWidth; + interface->fLoadIdentity = glLoadIdentity; + interface->fLoadMatrixf = glLoadMatrixf; + interface->fMatrixMode = glMatrixMode; interface->fPixelStorei = glPixelStorei; interface->fReadBuffer = glReadBuffer; interface->fReadPixels = glReadPixels; @@ -216,6 +219,58 @@ const GrGLInterface* GrGLCreateNativeInterface() { GR_GL_GET_PROC(MapBuffer); GR_GL_GET_PROC(UnmapBuffer); + if (GrGLHasExtensionFromString("GL_NV_path_rendering", extString)) { + GR_GL_GET_PROC_SUFFIX(PathCommands, NV); + GR_GL_GET_PROC_SUFFIX(PathCoords, NV); + GR_GL_GET_PROC_SUFFIX(PathSubCommands, NV); + GR_GL_GET_PROC_SUFFIX(PathSubCoords, NV); + GR_GL_GET_PROC_SUFFIX(PathString, NV); + GR_GL_GET_PROC_SUFFIX(PathGlyphs, NV); + GR_GL_GET_PROC_SUFFIX(PathGlyphRange, NV); + GR_GL_GET_PROC_SUFFIX(WeightPaths, NV); + GR_GL_GET_PROC_SUFFIX(CopyPath, NV); + GR_GL_GET_PROC_SUFFIX(InterpolatePaths, NV); + GR_GL_GET_PROC_SUFFIX(TransformPath, NV); + GR_GL_GET_PROC_SUFFIX(PathParameteriv, NV); + GR_GL_GET_PROC_SUFFIX(PathParameteri, NV); + GR_GL_GET_PROC_SUFFIX(PathParameterfv, NV); + GR_GL_GET_PROC_SUFFIX(PathParameterf, NV); + GR_GL_GET_PROC_SUFFIX(PathDashArray, NV); + GR_GL_GET_PROC_SUFFIX(GenPaths, NV); + GR_GL_GET_PROC_SUFFIX(DeletePaths, NV); + GR_GL_GET_PROC_SUFFIX(IsPath, NV); + GR_GL_GET_PROC_SUFFIX(PathStencilFunc, NV); + GR_GL_GET_PROC_SUFFIX(PathStencilDepthOffset, NV); + GR_GL_GET_PROC_SUFFIX(StencilFillPath, NV); + GR_GL_GET_PROC_SUFFIX(StencilStrokePath, NV); + GR_GL_GET_PROC_SUFFIX(StencilFillPathInstanced, NV); + GR_GL_GET_PROC_SUFFIX(StencilStrokePathInstanced, NV); + GR_GL_GET_PROC_SUFFIX(PathCoverDepthFunc, NV); + GR_GL_GET_PROC_SUFFIX(PathColorGen, NV); + GR_GL_GET_PROC_SUFFIX(PathTexGen, NV); + GR_GL_GET_PROC_SUFFIX(PathFogGen, NV); + GR_GL_GET_PROC_SUFFIX(CoverFillPath, NV); + GR_GL_GET_PROC_SUFFIX(CoverStrokePath, NV); + GR_GL_GET_PROC_SUFFIX(CoverFillPathInstanced, NV); + GR_GL_GET_PROC_SUFFIX(CoverStrokePathInstanced, NV); + GR_GL_GET_PROC_SUFFIX(GetPathParameteriv, NV); + GR_GL_GET_PROC_SUFFIX(GetPathParameterfv, NV); + GR_GL_GET_PROC_SUFFIX(GetPathCommands, NV); + GR_GL_GET_PROC_SUFFIX(GetPathCoords, NV); + GR_GL_GET_PROC_SUFFIX(GetPathDashArray, NV); + GR_GL_GET_PROC_SUFFIX(GetPathMetrics, NV); + GR_GL_GET_PROC_SUFFIX(GetPathMetricRange, NV); + GR_GL_GET_PROC_SUFFIX(GetPathSpacing, NV); + GR_GL_GET_PROC_SUFFIX(GetPathColorGeniv, NV); + GR_GL_GET_PROC_SUFFIX(GetPathColorGenfv, NV); + GR_GL_GET_PROC_SUFFIX(GetPathTexGeniv, NV); + GR_GL_GET_PROC_SUFFIX(GetPathTexGenfv, NV); + GR_GL_GET_PROC_SUFFIX(IsPointInFillPath, NV); + GR_GL_GET_PROC_SUFFIX(IsPointInStrokePath, NV); + GR_GL_GET_PROC_SUFFIX(GetPathLength, NV); + GR_GL_GET_PROC_SUFFIX(PointAlongPath, NV); + } + interface->fBindingsExported = kDesktop_GrGLBinding; return interface;