Make GrGLInterface great for Win32 x86 again

Bug: skia:8262
Change-Id: I607644198d5dc7992e2b89eb34651eb1dc88c6ba
Reviewed-on: https://skia-review.googlesource.com/149225
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2018-08-24 10:26:42 -04:00 committed by Skia Commit-Bot
parent b23c3172ee
commit 2424ec46e9
7 changed files with 498 additions and 468 deletions

View File

@ -43,10 +43,10 @@ public:
* NULL if on desktop GL with version 3.0 or higher. Otherwise it will fail.
*/
bool init(GrGLStandard standard,
GrGLFunction<GrGLGetStringProc> getString,
GrGLFunction<GrGLGetStringiProc> getStringi,
GrGLFunction<GrGLGetIntegervProc> getIntegerv,
GrGLFunction<GrEGLQueryStringProc> queryString = nullptr,
GrGLFunction<GrGLGetStringFn> getString,
GrGLFunction<GrGLGetStringiFn> getStringi,
GrGLFunction<GrGLGetIntegervFn> getIntegerv,
GrGLFunction<GrEGLQueryStringFn> queryString = nullptr,
GrEGLDisplay eglDisplay = nullptr);
bool isInitialized() const { return fInitialized; }

View File

@ -9,276 +9,280 @@
#ifndef GrGLFunctions_DEFINED
#define GrGLFunctions_DEFINED
#include "GrGLTypes.h"
#include "../private/SkTLogic.h"
#include <cstring>
#include "../private/SkTLogic.h"
#include "GrGLTypes.h"
extern "C" {
///////////////////////////////////////////////////////////////////////////////
typedef GrGLvoid (* GrGLActiveTextureProc)(GrGLenum texture);
typedef GrGLvoid (* GrGLAttachShaderProc)(GrGLuint program, GrGLuint shader);
typedef GrGLvoid (* GrGLBeginQueryProc)(GrGLenum target, GrGLuint id);
typedef GrGLvoid (* GrGLBindAttribLocationProc)(GrGLuint program, GrGLuint index, const char* name);
typedef GrGLvoid (* GrGLBindBufferProc)(GrGLenum target, GrGLuint buffer);
typedef GrGLvoid (* GrGLBindFramebufferProc)(GrGLenum target, GrGLuint framebuffer);
typedef GrGLvoid (* GrGLBindRenderbufferProc)(GrGLenum target, GrGLuint renderbuffer);
typedef GrGLvoid (* GrGLBindTextureProc)(GrGLenum target, GrGLuint texture);
typedef GrGLvoid (* GrGLBindFragDataLocationProc)(GrGLuint program, GrGLuint colorNumber, const GrGLchar* name);
typedef GrGLvoid (* GrGLBindFragDataLocationIndexedProc)(GrGLuint program, GrGLuint colorNumber, GrGLuint index, const GrGLchar * name);
typedef GrGLvoid (* GrGLBindVertexArrayProc)(GrGLuint array);
typedef GrGLvoid (* GrGLBlendBarrierProc)();
typedef GrGLvoid (* GrGLBlendColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha);
typedef GrGLvoid (* GrGLBlendEquationProc)(GrGLenum mode);
typedef GrGLvoid (* GrGLBlendFuncProc)(GrGLenum sfactor, GrGLenum dfactor);
typedef GrGLvoid (* GrGLBlitFramebufferProc)(GrGLint srcX0, GrGLint srcY0, GrGLint srcX1, GrGLint srcY1, GrGLint dstX0, GrGLint dstY0, GrGLint dstX1, GrGLint dstY1, GrGLbitfield mask, GrGLenum filter);
typedef GrGLvoid (* GrGLBufferDataProc)(GrGLenum target, GrGLsizeiptr size, const GrGLvoid* data, GrGLenum usage);
typedef GrGLvoid (* GrGLBufferSubDataProc)(GrGLenum target, GrGLintptr offset, GrGLsizeiptr size, const GrGLvoid* data);
typedef GrGLenum (* GrGLCheckFramebufferStatusProc)(GrGLenum target);
typedef GrGLvoid (* GrGLClearProc)(GrGLbitfield mask);
typedef GrGLvoid (* GrGLClearColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha);
typedef GrGLvoid (* GrGLClearStencilProc)(GrGLint s);
typedef GrGLvoid (* GrGLClearTexImageProc)(GrGLuint texture, GrGLint level, GrGLenum format, GrGLenum type,const GrGLvoid * data);
typedef GrGLvoid (* GrGLClearTexSubImageProc)(GrGLuint texture, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLint zoffset, GrGLsizei width, GrGLsizei height, GrGLsizei depth, GrGLenum format, GrGLenum type,const GrGLvoid * data);
typedef GrGLvoid (* GrGLColorMaskProc)(GrGLboolean red, GrGLboolean green, GrGLboolean blue, GrGLboolean alpha);
typedef GrGLvoid (* GrGLCompileShaderProc)(GrGLuint shader);
typedef GrGLvoid (* GrGLCompressedTexImage2DProc)(GrGLenum target, GrGLint level, GrGLenum internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLsizei imageSize, const GrGLvoid* data);
typedef GrGLvoid (* GrGLCompressedTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLsizei imageSize, const GrGLvoid* data);
typedef GrGLvoid (* GrGLCopyTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
typedef GrGLuint (* GrGLCreateProgramProc)();
typedef GrGLuint (* GrGLCreateShaderProc)(GrGLenum type);
typedef GrGLvoid (* GrGLCullFaceProc)(GrGLenum mode);
typedef GrGLvoid (* GrGLDeleteBuffersProc)(GrGLsizei n, const GrGLuint* buffers);
typedef GrGLvoid (* GrGLDeleteFramebuffersProc)(GrGLsizei n, const GrGLuint *framebuffers);
typedef GrGLvoid (* GrGLDeleteProgramProc)(GrGLuint program);
typedef GrGLvoid (* GrGLDeleteQueriesProc)(GrGLsizei n, const GrGLuint *ids);
typedef GrGLvoid (* GrGLDeleteRenderbuffersProc)(GrGLsizei n, const GrGLuint *renderbuffers);
typedef GrGLvoid (* GrGLDeleteShaderProc)(GrGLuint shader);
typedef GrGLvoid (* GrGLDeleteTexturesProc)(GrGLsizei n, const GrGLuint* textures);
typedef GrGLvoid (* GrGLDeleteVertexArraysProc)(GrGLsizei n, const GrGLuint *arrays);
typedef GrGLvoid (* GrGLDepthMaskProc)(GrGLboolean flag);
typedef GrGLvoid (* GrGLDisableProc)(GrGLenum cap);
typedef GrGLvoid (* GrGLDisableVertexAttribArrayProc)(GrGLuint index);
typedef GrGLvoid (* GrGLDrawArraysProc)(GrGLenum mode, GrGLint first, GrGLsizei count);
typedef GrGLvoid (* GrGLDrawArraysInstancedProc)(GrGLenum mode, GrGLint first, GrGLsizei count, GrGLsizei primcount);
typedef GrGLvoid (* GrGLDrawArraysIndirectProc)(GrGLenum mode, const GrGLvoid* indirect);
typedef GrGLvoid (* GrGLDrawBufferProc)(GrGLenum mode);
typedef GrGLvoid (* GrGLDrawBuffersProc)(GrGLsizei n, const GrGLenum* bufs);
typedef GrGLvoid (* GrGLDrawElementsProc)(GrGLenum mode, GrGLsizei count, GrGLenum type, const GrGLvoid* indices);
typedef GrGLvoid (* GrGLDrawElementsInstancedProc)(GrGLenum mode, GrGLsizei count, GrGLenum type, const GrGLvoid *indices, GrGLsizei primcount);
typedef GrGLvoid (* GrGLDrawElementsIndirectProc)(GrGLenum mode, GrGLenum type, const GrGLvoid* indirect);
typedef GrGLvoid (* GrGLDrawRangeElementsProc)(GrGLenum mode, GrGLuint start, GrGLuint end, GrGLsizei count, GrGLenum type, const GrGLvoid* indices);
typedef GrGLvoid (* GrGLEnableProc)(GrGLenum cap);
typedef GrGLvoid (* GrGLEnableVertexAttribArrayProc)(GrGLuint index);
typedef GrGLvoid (* GrGLEndQueryProc)(GrGLenum target);
typedef GrGLvoid (* GrGLFinishProc)();
typedef GrGLvoid (* GrGLFlushProc)();
typedef GrGLvoid (* GrGLFlushMappedBufferRangeProc)(GrGLenum target, GrGLintptr offset, GrGLsizeiptr length);
typedef GrGLvoid (* GrGLFramebufferRenderbufferProc)(GrGLenum target, GrGLenum attachment, GrGLenum renderbuffertarget, GrGLuint renderbuffer);
typedef GrGLvoid (* GrGLFramebufferTexture2DProc)(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level);
typedef GrGLvoid (* GrGLFramebufferTexture2DMultisampleProc)(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level, GrGLsizei samples);
typedef GrGLvoid (* GrGLFrontFaceProc)(GrGLenum mode);
typedef GrGLvoid (* GrGLGenBuffersProc)(GrGLsizei n, GrGLuint* buffers);
typedef GrGLvoid (* GrGLGenFramebuffersProc)(GrGLsizei n, GrGLuint *framebuffers);
typedef GrGLvoid (* GrGLGenerateMipmapProc)(GrGLenum target);
typedef GrGLvoid (* GrGLGenQueriesProc)(GrGLsizei n, GrGLuint *ids);
typedef GrGLvoid (* GrGLGenRenderbuffersProc)(GrGLsizei n, GrGLuint *renderbuffers);
typedef GrGLvoid (* GrGLGenTexturesProc)(GrGLsizei n, GrGLuint* textures);
typedef GrGLvoid (* GrGLGenVertexArraysProc)(GrGLsizei n, GrGLuint *arrays);
typedef GrGLvoid (* GrGLGetBufferParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params);
typedef GrGLenum (* GrGLGetErrorProc)();
typedef GrGLvoid (* GrGLGetFramebufferAttachmentParameterivProc)(GrGLenum target, GrGLenum attachment, GrGLenum pname, GrGLint* params);
typedef GrGLvoid (* GrGLGetIntegervProc)(GrGLenum pname, GrGLint* params);
typedef GrGLvoid (* GrGLGetMultisamplefvProc)(GrGLenum pname, GrGLuint index, GrGLfloat* val);
typedef GrGLvoid (* GrGLGetProgramBinaryProc)(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, GrGLenum *binaryFormat, void *binary);
typedef GrGLvoid (* GrGLGetProgramInfoLogProc)(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, char* infolog);
typedef GrGLvoid (* GrGLGetProgramivProc)(GrGLuint program, GrGLenum pname, GrGLint* params);
typedef GrGLvoid (* GrGLGetQueryivProc)(GrGLenum GLtarget, GrGLenum pname, GrGLint *params);
typedef GrGLvoid (* GrGLGetQueryObjecti64vProc)(GrGLuint id, GrGLenum pname, GrGLint64 *params);
typedef GrGLvoid (* GrGLGetQueryObjectivProc)(GrGLuint id, GrGLenum pname, GrGLint *params);
typedef GrGLvoid (* GrGLGetQueryObjectui64vProc)(GrGLuint id, GrGLenum pname, GrGLuint64 *params);
typedef GrGLvoid (* GrGLGetQueryObjectuivProc)(GrGLuint id, GrGLenum pname, GrGLuint *params);
typedef GrGLvoid (* GrGLGetRenderbufferParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params);
typedef GrGLvoid (* GrGLGetShaderInfoLogProc)(GrGLuint shader, GrGLsizei bufsize, GrGLsizei* length, char* infolog);
typedef GrGLvoid (* GrGLGetShaderivProc)(GrGLuint shader, GrGLenum pname, GrGLint* params);
typedef GrGLvoid (* GrGLGetShaderPrecisionFormatProc)(GrGLenum shadertype, GrGLenum precisiontype, GrGLint *range, GrGLint *precision);
typedef const GrGLubyte* (* GrGLGetStringProc)(GrGLenum name);
typedef const GrGLubyte* (* GrGLGetStringiProc)(GrGLenum name, GrGLuint index);
typedef GrGLvoid (* GrGLGetTexLevelParameterivProc)(GrGLenum target, GrGLint level, GrGLenum pname, GrGLint* params);
typedef GrGLint (* GrGLGetUniformLocationProc)(GrGLuint program, const char* name);
typedef GrGLvoid (* GrGLInsertEventMarkerProc)(GrGLsizei length, const char* marker);
typedef GrGLvoid (* GrGLInvalidateBufferDataProc)(GrGLuint buffer);
typedef GrGLvoid (* GrGLInvalidateBufferSubDataProc)(GrGLuint buffer, GrGLintptr offset, GrGLsizeiptr length);
typedef GrGLvoid (* GrGLInvalidateFramebufferProc)(GrGLenum target, GrGLsizei numAttachments, const GrGLenum *attachments);
typedef GrGLvoid (* GrGLInvalidateSubFramebufferProc)(GrGLenum target, GrGLsizei numAttachments, const GrGLenum *attachments, GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
typedef GrGLvoid (* GrGLInvalidateTexImageProc)(GrGLuint texture, GrGLint level);
typedef GrGLvoid (* GrGLInvalidateTexSubImageProc)(GrGLuint texture, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLint zoffset, GrGLsizei width, GrGLsizei height, GrGLsizei depth);
typedef GrGLboolean (* GrGLIsTextureProc)(GrGLuint texture);
typedef GrGLvoid (* GrGLLineWidthProc)(GrGLfloat width);
typedef GrGLvoid (* GrGLLinkProgramProc)(GrGLuint program);
typedef GrGLvoid* (* GrGLMapBufferProc)(GrGLenum target, GrGLenum access);
typedef GrGLvoid* (* GrGLMapBufferRangeProc)(GrGLenum target, GrGLintptr offset, GrGLsizeiptr length, GrGLbitfield access);
typedef GrGLvoid* (* GrGLMapBufferSubDataProc)(GrGLuint target, GrGLintptr offset, GrGLsizeiptr size, GrGLenum access);
typedef GrGLvoid* (* GrGLMapTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLenum access);
typedef GrGLvoid (* GrGLPixelStoreiProc)(GrGLenum pname, GrGLint param);
typedef GrGLvoid (* GrGLPolygonModeProc)(GrGLenum face, GrGLenum mode);
typedef GrGLvoid (* GrGLPopGroupMarkerProc)();
typedef GrGLvoid (* GrGLProgramBinaryProc)(GrGLuint program, GrGLenum binaryFormat, void *binary, GrGLsizei length);
typedef GrGLvoid (* GrGLProgramParameteriProc)(GrGLuint program, GrGLenum pname, GrGLint value);
typedef GrGLvoid (* GrGLPushGroupMarkerProc)(GrGLsizei length, const char* marker);
typedef GrGLvoid (* GrGLQueryCounterProc)(GrGLuint id, GrGLenum target);
typedef GrGLvoid (* GrGLRasterSamplesProc)(GrGLuint samples, GrGLboolean fixedsamplelocations);
typedef GrGLvoid (* GrGLReadBufferProc)(GrGLenum src);
typedef GrGLvoid (* GrGLReadPixelsProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels);
typedef GrGLvoid (* GrGLRenderbufferStorageProc)(GrGLenum target, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
typedef GrGLvoid (* GrGLRenderbufferStorageMultisampleProc)(GrGLenum target, GrGLsizei samples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
typedef GrGLvoid (* GrGLResolveMultisampleFramebufferProc)();
typedef GrGLvoid (* GrGLScissorProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
using GrGLActiveTextureFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum texture);
using GrGLAttachShaderFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLuint shader);
using GrGLBeginQueryFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLuint id);
using GrGLBindAttribLocationFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLuint index, const char* name);
using GrGLBindBufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLuint buffer);
using GrGLBindFramebufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLuint framebuffer);
using GrGLBindRenderbufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLuint renderbuffer);
using GrGLBindTextureFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLuint texture);
using GrGLBindFragDataLocationFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLuint colorNumber, const GrGLchar* name);
using GrGLBindFragDataLocationIndexedFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLuint colorNumber, GrGLuint index, const GrGLchar* name);
using GrGLBindVertexArrayFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint array);
using GrGLBlendBarrierFn = GrGLvoid GR_GL_FUNCTION_TYPE();
using GrGLBlendColorFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha);
using GrGLBlendEquationFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode);
using GrGLBlendFuncFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum sfactor, GrGLenum dfactor);
using GrGLBlitFramebufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint srcX0, GrGLint srcY0, GrGLint srcX1, GrGLint srcY1, GrGLint dstX0, GrGLint dstY0, GrGLint dstX1, GrGLint dstY1, GrGLbitfield mask, GrGLenum filter);
using GrGLBufferDataFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLsizeiptr size, const GrGLvoid* data, GrGLenum usage);
using GrGLBufferSubDataFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLintptr offset, GrGLsizeiptr size, const GrGLvoid* data);
using GrGLCheckFramebufferStatusFn = GrGLenum GR_GL_FUNCTION_TYPE(GrGLenum target);
using GrGLClearFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLbitfield mask);
using GrGLClearColorFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha);
using GrGLClearStencilFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint s);
using GrGLClearTexImageFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint texture, GrGLint level, GrGLenum format, GrGLenum type, const GrGLvoid* data);
using GrGLClearTexSubImageFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint texture, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLint zoffset, GrGLsizei width, GrGLsizei height, GrGLsizei depth, GrGLenum format, GrGLenum type, const GrGLvoid* data);
using GrGLColorMaskFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLboolean red, GrGLboolean green, GrGLboolean blue, GrGLboolean alpha);
using GrGLCompileShaderFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint shader);
using GrGLCompressedTexImage2DFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLint level, GrGLenum internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLsizei imageSize, const GrGLvoid* data);
using GrGLCompressedTexSubImage2DFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLsizei imageSize, const GrGLvoid* data);
using GrGLCopyTexSubImage2DFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
using GrGLCreateProgramFn = GrGLuint GR_GL_FUNCTION_TYPE();
using GrGLCreateShaderFn = GrGLuint GR_GL_FUNCTION_TYPE(GrGLenum type);
using GrGLCullFaceFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode);
using GrGLDeleteBuffersFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, const GrGLuint* buffers);
using GrGLDeleteFramebuffersFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, const GrGLuint* framebuffers);
using GrGLDeleteProgramFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program);
using GrGLDeleteQueriesFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, const GrGLuint* ids);
using GrGLDeleteRenderbuffersFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, const GrGLuint* renderbuffers);
using GrGLDeleteShaderFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint shader);
using GrGLDeleteTexturesFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, const GrGLuint* textures);
using GrGLDeleteVertexArraysFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, const GrGLuint* arrays);
using GrGLDepthMaskFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLboolean flag);
using GrGLDisableFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum cap);
using GrGLDisableVertexAttribArrayFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint index);
using GrGLDrawArraysFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, GrGLint first, GrGLsizei count);
using GrGLDrawArraysInstancedFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, GrGLint first, GrGLsizei count, GrGLsizei primcount);
using GrGLDrawArraysIndirectFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, const GrGLvoid* indirect);
using GrGLDrawBufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode);
using GrGLDrawBuffersFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, const GrGLenum* bufs);
using GrGLDrawElementsFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, GrGLsizei count, GrGLenum type, const GrGLvoid* indices);
using GrGLDrawElementsInstancedFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, GrGLsizei count, GrGLenum type, const GrGLvoid* indices, GrGLsizei primcount);
using GrGLDrawElementsIndirectFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, GrGLenum type, const GrGLvoid* indirect);
using GrGLDrawRangeElementsFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, GrGLuint start, GrGLuint end, GrGLsizei count, GrGLenum type, const GrGLvoid* indices);
using GrGLEnableFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum cap);
using GrGLEnableVertexAttribArrayFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint index);
using GrGLEndQueryFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target);
using GrGLFinishFn = GrGLvoid GR_GL_FUNCTION_TYPE();
using GrGLFlushFn = GrGLvoid GR_GL_FUNCTION_TYPE();
using GrGLFlushMappedBufferRangeFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLintptr offset, GrGLsizeiptr length);
using GrGLFramebufferRenderbufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum attachment, GrGLenum renderbuffertarget, GrGLuint renderbuffer);
using GrGLFramebufferTexture2DFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level);
using GrGLFramebufferTexture2DMultisampleFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level, GrGLsizei samples);
using GrGLFrontFaceFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode);
using GrGLGenBuffersFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, GrGLuint* buffers);
using GrGLGenFramebuffersFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, GrGLuint* framebuffers);
using GrGLGenerateMipmapFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target);
using GrGLGenQueriesFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, GrGLuint* ids);
using GrGLGenRenderbuffersFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, GrGLuint* renderbuffers);
using GrGLGenTexturesFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, GrGLuint* textures);
using GrGLGenVertexArraysFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei n, GrGLuint* arrays);
using GrGLGetBufferParameterivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum pname, GrGLint* params);
using GrGLGetErrorFn = GrGLenum GR_GL_FUNCTION_TYPE();
using GrGLGetFramebufferAttachmentParameterivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum attachment, GrGLenum pname, GrGLint* params);
using GrGLGetIntegervFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum pname, GrGLint* params);
using GrGLGetMultisamplefvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum pname, GrGLuint index, GrGLfloat* val);
using GrGLGetProgramBinaryFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, GrGLenum* binaryFormat, void* binary);
using GrGLGetProgramInfoLogFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, char* infolog);
using GrGLGetProgramivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLenum pname, GrGLint* params);
using GrGLGetQueryivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum GLtarget, GrGLenum pname, GrGLint* params);
using GrGLGetQueryObjecti64vFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint id, GrGLenum pname, GrGLint64* params);
using GrGLGetQueryObjectivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint id, GrGLenum pname, GrGLint* params);
using GrGLGetQueryObjectui64vFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint id, GrGLenum pname, GrGLuint64* params);
using GrGLGetQueryObjectuivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint id, GrGLenum pname, GrGLuint* params);
using GrGLGetRenderbufferParameterivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum pname, GrGLint* params);
using GrGLGetShaderInfoLogFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint shader, GrGLsizei bufsize, GrGLsizei* length, char* infolog);
using GrGLGetShaderivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint shader, GrGLenum pname, GrGLint* params);
using GrGLGetShaderPrecisionFormatFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum shadertype, GrGLenum precisiontype, GrGLint* range, GrGLint* precision);
using GrGLGetStringFn = const GrGLubyte* GR_GL_FUNCTION_TYPE(GrGLenum name);
using GrGLGetStringiFn = const GrGLubyte* GR_GL_FUNCTION_TYPE(GrGLenum name, GrGLuint index);
using GrGLGetTexLevelParameterivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLint level, GrGLenum pname, GrGLint* params);
using GrGLGetUniformLocationFn = GrGLint GR_GL_FUNCTION_TYPE(GrGLuint program, const char* name);
using GrGLInsertEventMarkerFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei length, const char* marker);
using GrGLInvalidateBufferDataFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint buffer);
using GrGLInvalidateBufferSubDataFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint buffer, GrGLintptr offset, GrGLsizeiptr length);
using GrGLInvalidateFramebufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLsizei numAttachments, const GrGLenum* attachments);
using GrGLInvalidateSubFramebufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLsizei numAttachments, const GrGLenum* attachments, GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
using GrGLInvalidateTexImageFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint texture, GrGLint level);
using GrGLInvalidateTexSubImageFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint texture, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLint zoffset, GrGLsizei width, GrGLsizei height, GrGLsizei depth);
using GrGLIsTextureFn = GrGLboolean GR_GL_FUNCTION_TYPE(GrGLuint texture);
using GrGLLineWidthFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLfloat width);
using GrGLLinkProgramFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program);
using GrGLMapBufferFn = GrGLvoid* GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum access);
using GrGLMapBufferRangeFn = GrGLvoid* GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLintptr offset, GrGLsizeiptr length, GrGLbitfield access);
using GrGLMapBufferSubDataFn = GrGLvoid* GR_GL_FUNCTION_TYPE(GrGLuint target, GrGLintptr offset, GrGLsizeiptr size, GrGLenum access);
using GrGLMapTexSubImage2DFn = GrGLvoid* GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLenum access);
using GrGLPixelStoreiFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum pname, GrGLint param);
using GrGLPolygonModeFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum face, GrGLenum mode);
using GrGLPopGroupMarkerFn = GrGLvoid GR_GL_FUNCTION_TYPE();
using GrGLProgramBinaryFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLenum binaryFormat, void* binary, GrGLsizei length);
using GrGLProgramParameteriFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLenum pname, GrGLint value);
using GrGLPushGroupMarkerFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei length, const char* marker);
using GrGLQueryCounterFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint id, GrGLenum target);
using GrGLRasterSamplesFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint samples, GrGLboolean fixedsamplelocations);
using GrGLReadBufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum src);
using GrGLReadPixelsFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels);
using GrGLRenderbufferStorageFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
using GrGLRenderbufferStorageMultisampleFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLsizei samples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
using GrGLResolveMultisampleFramebufferFn = GrGLvoid GR_GL_FUNCTION_TYPE();
using GrGLScissorFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
// GL_CHROMIUM_bind_uniform_location
typedef GrGLvoid (* GrGLBindUniformLocationProc)(GrGLuint program, GrGLint location, const char* name);
using GrGLBindUniformLocationFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLint location, const char* name);
#if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE
typedef GrGLvoid (* GrGLShaderSourceProc)(GrGLuint shader, GrGLsizei count, const char* const * str, const GrGLint* length);
using GrGLShaderSourceFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint shader, GrGLsizei count, const char* const* str, const GrGLint* length);
#else
typedef GrGLvoid (* GrGLShaderSourceProc)(GrGLuint shader, GrGLsizei count, const char** str, const GrGLint* length);
using GrGLShaderSourceFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint shader, GrGLsizei count, const char** str, const GrGLint* length);
#endif
typedef GrGLvoid (* GrGLStencilFuncProc)(GrGLenum func, GrGLint ref, GrGLuint mask);
typedef GrGLvoid (* GrGLStencilFuncSeparateProc)(GrGLenum face, GrGLenum func, GrGLint ref, GrGLuint mask);
typedef GrGLvoid (* GrGLStencilMaskProc)(GrGLuint mask);
typedef GrGLvoid (* GrGLStencilMaskSeparateProc)(GrGLenum face, GrGLuint mask);
typedef GrGLvoid (* GrGLStencilOpProc)(GrGLenum fail, GrGLenum zfail, GrGLenum zpass);
typedef GrGLvoid (* GrGLStencilOpSeparateProc)(GrGLenum face, GrGLenum fail, GrGLenum zfail, GrGLenum zpass);
typedef GrGLvoid (* GrGLTexBufferProc)(GrGLenum target, GrGLenum internalformat, GrGLuint buffer);
typedef GrGLvoid (* GrGLTexBufferRangeProc)(GrGLenum target, GrGLenum internalformat, GrGLuint buffer, GrGLintptr offset, GrGLsizeiptr size);
typedef GrGLvoid (* GrGLTexImage2DProc)(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
typedef GrGLvoid (* GrGLTexParameteriProc)(GrGLenum target, GrGLenum pname, GrGLint param);
typedef GrGLvoid (* GrGLTexParameterivProc)(GrGLenum target, GrGLenum pname, const GrGLint* params);
typedef GrGLvoid (* GrGLTexStorage2DProc)(GrGLenum target, GrGLsizei levels, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
typedef GrGLvoid (* GrGLDiscardFramebufferProc)(GrGLenum target, GrGLsizei numAttachments, const GrGLenum* attachments);
typedef GrGLvoid (* GrGLTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
typedef GrGLvoid (* GrGLTextureBarrierProc)();
typedef GrGLvoid (* GrGLUniform1fProc)(GrGLint location, GrGLfloat v0);
typedef GrGLvoid (* GrGLUniform1iProc)(GrGLint location, GrGLint v0);
typedef GrGLvoid (* GrGLUniform1fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (* GrGLUniform1ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (* GrGLUniform2fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1);
typedef GrGLvoid (* GrGLUniform2iProc)(GrGLint location, GrGLint v0, GrGLint v1);
typedef GrGLvoid (* GrGLUniform2fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (* GrGLUniform2ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (* GrGLUniform3fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2);
typedef GrGLvoid (* GrGLUniform3iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2);
typedef GrGLvoid (* GrGLUniform3fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (* GrGLUniform3ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (* GrGLUniform4fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2, GrGLfloat v3);
typedef GrGLvoid (* GrGLUniform4iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2, GrGLint v3);
typedef GrGLvoid (* GrGLUniform4fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (* GrGLUniform4ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (* GrGLUniformMatrix2fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLvoid (* GrGLUniformMatrix3fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLvoid (* GrGLUniformMatrix4fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLboolean (* GrGLUnmapBufferProc)(GrGLenum target);
typedef GrGLvoid (* GrGLUnmapBufferSubDataProc)(const GrGLvoid* mem);
typedef GrGLvoid (* GrGLUnmapTexSubImage2DProc)(const GrGLvoid* mem);
typedef GrGLvoid (* GrGLUseProgramProc)(GrGLuint program);
typedef GrGLvoid (* GrGLVertexAttrib1fProc)(GrGLuint indx, const GrGLfloat value);
typedef GrGLvoid (* GrGLVertexAttrib2fvProc)(GrGLuint indx, const GrGLfloat* values);
typedef GrGLvoid (* GrGLVertexAttrib3fvProc)(GrGLuint indx, const GrGLfloat* values);
typedef GrGLvoid (* GrGLVertexAttrib4fvProc)(GrGLuint indx, const GrGLfloat* values);
typedef GrGLvoid (* GrGLVertexAttribDivisorProc)(GrGLuint index, GrGLuint divisor);
typedef GrGLvoid (* GrGLVertexAttribIPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* ptr);
typedef GrGLvoid (* GrGLVertexAttribPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const GrGLvoid* ptr);
typedef GrGLvoid (* GrGLViewportProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
using GrGLStencilFuncFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum func, GrGLint ref, GrGLuint mask);
using GrGLStencilFuncSeparateFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum face, GrGLenum func, GrGLint ref, GrGLuint mask);
using GrGLStencilMaskFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint mask);
using GrGLStencilMaskSeparateFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum face, GrGLuint mask);
using GrGLStencilOpFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum fail, GrGLenum zfail, GrGLenum zpass);
using GrGLStencilOpSeparateFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum face, GrGLenum fail, GrGLenum zfail, GrGLenum zpass);
using GrGLTexBufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum internalformat, GrGLuint buffer);
using GrGLTexBufferRangeFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum internalformat, GrGLuint buffer, GrGLintptr offset, GrGLsizeiptr size);
using GrGLTexImage2DFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
using GrGLTexParameteriFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum pname, GrGLint param);
using GrGLTexParameterivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum pname, const GrGLint* params);
using GrGLTexStorage2DFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLsizei levels, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
using GrGLDiscardFramebufferFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLsizei numAttachments, const GrGLenum* attachments);
using GrGLTexSubImage2DFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
using GrGLTextureBarrierFn = GrGLvoid GR_GL_FUNCTION_TYPE();
using GrGLUniform1fFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLfloat v0);
using GrGLUniform1iFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLint v0);
using GrGLUniform1fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, const GrGLfloat* v);
using GrGLUniform1ivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, const GrGLint* v);
using GrGLUniform2fFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLfloat v0, GrGLfloat v1);
using GrGLUniform2iFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLint v0, GrGLint v1);
using GrGLUniform2fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, const GrGLfloat* v);
using GrGLUniform2ivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, const GrGLint* v);
using GrGLUniform3fFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2);
using GrGLUniform3iFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2);
using GrGLUniform3fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, const GrGLfloat* v);
using GrGLUniform3ivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, const GrGLint* v);
using GrGLUniform4fFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2, GrGLfloat v3);
using GrGLUniform4iFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2, GrGLint v3);
using GrGLUniform4fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, const GrGLfloat* v);
using GrGLUniform4ivFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, const GrGLint* v);
using GrGLUniformMatrix2fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
using GrGLUniformMatrix3fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
using GrGLUniformMatrix4fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
using GrGLUnmapBufferFn = GrGLboolean GR_GL_FUNCTION_TYPE(GrGLenum target);
using GrGLUnmapBufferSubDataFn = GrGLvoid GR_GL_FUNCTION_TYPE(const GrGLvoid* mem);
using GrGLUnmapTexSubImage2DFn = GrGLvoid GR_GL_FUNCTION_TYPE(const GrGLvoid* mem);
using GrGLUseProgramFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program);
using GrGLVertexAttrib1fFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint indx, const GrGLfloat value);
using GrGLVertexAttrib2fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint indx, const GrGLfloat* values);
using GrGLVertexAttrib3fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint indx, const GrGLfloat* values);
using GrGLVertexAttrib4fvFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint indx, const GrGLfloat* values);
using GrGLVertexAttribDivisorFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint index, GrGLuint divisor);
using GrGLVertexAttribIPointerFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint indx, GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* ptr);
using GrGLVertexAttribPointerFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint indx, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const GrGLvoid* ptr);
using GrGLViewportFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
/* GL_NV_path_rendering */
typedef GrGLvoid (* GrGLMatrixLoadfProc)(GrGLenum matrixMode, const GrGLfloat* m);
typedef GrGLvoid (* GrGLMatrixLoadIdentityProc)(GrGLenum);
typedef GrGLvoid (* GrGLPathCommandsProc)(GrGLuint path, GrGLsizei numCommands, const GrGLubyte *commands, GrGLsizei numCoords, GrGLenum coordType, const GrGLvoid *coords);
typedef GrGLvoid (* GrGLPathParameteriProc)(GrGLuint path, GrGLenum pname, GrGLint value);
typedef GrGLvoid (* GrGLPathParameterfProc)(GrGLuint path, GrGLenum pname, GrGLfloat value);
typedef GrGLuint (* GrGLGenPathsProc)(GrGLsizei range);
typedef GrGLvoid (* GrGLDeletePathsProc)(GrGLuint path, GrGLsizei range);
typedef GrGLboolean (* GrGLIsPathProc)(GrGLuint path);
typedef GrGLvoid (* GrGLPathStencilFuncProc)(GrGLenum func, GrGLint ref, GrGLuint mask);
typedef GrGLvoid (* GrGLStencilFillPathProc)(GrGLuint path, GrGLenum fillMode, GrGLuint mask);
typedef GrGLvoid (* GrGLStencilStrokePathProc)(GrGLuint path, GrGLint reference, GrGLuint mask);
typedef GrGLvoid (* GrGLStencilFillPathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, GrGLuint pathBase, GrGLenum fillMode, GrGLuint mask, GrGLenum transformType, const GrGLfloat *transformValues);
typedef GrGLvoid (* GrGLStencilStrokePathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, GrGLuint pathBase, GrGLint reference, GrGLuint mask, GrGLenum transformType, const GrGLfloat *transformValues);
typedef GrGLvoid (* GrGLCoverFillPathProc)(GrGLuint path, GrGLenum coverMode);
typedef GrGLvoid (* GrGLCoverStrokePathProc)(GrGLuint name, GrGLenum coverMode);
typedef GrGLvoid (* GrGLCoverFillPathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, GrGLuint pathBase, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat *transformValues);
typedef GrGLvoid (* GrGLCoverStrokePathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, GrGLuint pathBase, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat* transformValues);
using GrGLMatrixLoadfFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum matrixMode, const GrGLfloat* m);
using GrGLMatrixLoadIdentityFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum);
using GrGLPathCommandsFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint path, GrGLsizei numCommands, const GrGLubyte* commands, GrGLsizei numCoords, GrGLenum coordType, const GrGLvoid* coords);
using GrGLPathParameteriFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint path, GrGLenum pname, GrGLint value);
using GrGLPathParameterfFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint path, GrGLenum pname, GrGLfloat value);
using GrGLGenPathsFn = GrGLuint GR_GL_FUNCTION_TYPE(GrGLsizei range);
using GrGLDeletePathsFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint path, GrGLsizei range);
using GrGLIsPathFn = GrGLboolean GR_GL_FUNCTION_TYPE(GrGLuint path);
using GrGLPathStencilFuncFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum func, GrGLint ref, GrGLuint mask);
using GrGLStencilFillPathFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint path, GrGLenum fillMode, GrGLuint mask);
using GrGLStencilStrokePathFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint path, GrGLint reference, GrGLuint mask);
using GrGLStencilFillPathInstancedFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid* paths, GrGLuint pathBase, GrGLenum fillMode, GrGLuint mask, GrGLenum transformType, const GrGLfloat* transformValues);
using GrGLStencilStrokePathInstancedFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid* paths, GrGLuint pathBase, GrGLint reference, GrGLuint mask, GrGLenum transformType, const GrGLfloat* transformValues);
using GrGLCoverFillPathFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint path, GrGLenum coverMode);
using GrGLCoverStrokePathFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint name, GrGLenum coverMode);
using GrGLCoverFillPathInstancedFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid* paths, GrGLuint pathBase, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat* transformValues);
using GrGLCoverStrokePathInstancedFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid* paths, GrGLuint pathBase, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat* transformValues);
// NV_path_rendering v1.2
typedef GrGLvoid (* GrGLStencilThenCoverFillPathProc)(GrGLuint path, GrGLenum fillMode, GrGLuint mask, GrGLenum coverMode);
typedef GrGLvoid (* GrGLStencilThenCoverStrokePathProc)(GrGLuint path, GrGLint reference, GrGLuint mask, GrGLenum coverMode);
typedef GrGLvoid (* GrGLStencilThenCoverFillPathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, GrGLuint pathBase, GrGLenum fillMode, GrGLuint mask, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat *transformValues);
typedef GrGLvoid (* GrGLStencilThenCoverStrokePathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, GrGLuint pathBase, GrGLint reference, GrGLuint mask, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat *transformValues);
using GrGLStencilThenCoverFillPathFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint path, GrGLenum fillMode, GrGLuint mask, GrGLenum coverMode);
using GrGLStencilThenCoverStrokePathFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint path, GrGLint reference, GrGLuint mask, GrGLenum coverMode);
using GrGLStencilThenCoverFillPathInstancedFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid* paths, GrGLuint pathBase, GrGLenum fillMode, GrGLuint mask, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat* transformValues);
using GrGLStencilThenCoverStrokePathInstancedFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid* paths, GrGLuint pathBase, GrGLint reference, GrGLuint mask, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat* transformValues);
// NV_path_rendering v1.3
typedef GrGLvoid (* GrGLProgramPathFragmentInputGenProc)(GrGLuint program, GrGLint location, GrGLenum genMode, GrGLint components,const GrGLfloat *coeffs);
using GrGLProgramPathFragmentInputGenFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLint location, GrGLenum genMode, GrGLint components, const GrGLfloat* coeffs);
// CHROMIUM_path_rendering
typedef GrGLvoid (* GrGLBindFragmentInputLocationProc)(GrGLuint program, GrGLint location, const GrGLchar* name);
using GrGLBindFragmentInputLocationFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLint location, const GrGLchar* name);
/* ARB_program_interface_query */
typedef GrGLint (* GrGLGetProgramResourceLocationProc)(GrGLuint program, GrGLenum programInterface, const GrGLchar *name);
using GrGLGetProgramResourceLocationFn = GrGLint GR_GL_FUNCTION_TYPE(GrGLuint program, GrGLenum programInterface, const GrGLchar* name);
/* GL_NV_framebuffer_mixed_samples */
typedef GrGLvoid (* GrGLCoverageModulationProc)(GrGLenum components);
using GrGLCoverageModulationFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum components);
/* EXT_multi_draw_indirect */
typedef GrGLvoid (* GrGLMultiDrawArraysIndirectProc)(GrGLenum mode, const GrGLvoid *indirect, GrGLsizei drawcount, GrGLsizei stride);
typedef GrGLvoid (* GrGLMultiDrawElementsIndirectProc)(GrGLenum mode, GrGLenum type, const GrGLvoid *indirect, GrGLsizei drawcount, GrGLsizei stride);
using GrGLMultiDrawArraysIndirectFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, const GrGLvoid* indirect, GrGLsizei drawcount, GrGLsizei stride);
using GrGLMultiDrawElementsIndirectFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, GrGLenum type, const GrGLvoid* indirect, GrGLsizei drawcount, GrGLsizei stride);
/* ARB_sample_shading */
typedef GrGLvoid (* GrGLMinSampleShadingProc)(GrGLfloat value);
using GrGLMinSampleShadingFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLfloat value);
/* ARB_sync */
typedef GrGLsync (* GrGLFenceSyncProc)(GrGLenum condition, GrGLbitfield flags);
typedef GrGLboolean (* GrGLIsSyncProc)(GrGLsync sync);
typedef GrGLenum (* GrGLClientWaitSyncProc)(GrGLsync sync, GrGLbitfield flags, GrGLuint64 timeout);
typedef GrGLvoid (* GrGLWaitSyncProc)(GrGLsync sync, GrGLbitfield flags, GrGLuint64 timeout);
typedef GrGLvoid (* GrGLDeleteSyncProc)(GrGLsync sync);
using GrGLFenceSyncFn = GrGLsync GR_GL_FUNCTION_TYPE(GrGLenum condition, GrGLbitfield flags);
using GrGLIsSyncFn = GrGLboolean GR_GL_FUNCTION_TYPE(GrGLsync sync);
using GrGLClientWaitSyncFn = GrGLenum GR_GL_FUNCTION_TYPE(GrGLsync sync, GrGLbitfield flags, GrGLuint64 timeout);
using GrGLWaitSyncFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsync sync, GrGLbitfield flags, GrGLuint64 timeout);
using GrGLDeleteSyncFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLsync sync);
/* ARB_internalformat_query */
typedef GrGLvoid (* GrGLGetInternalformativProc)(GrGLenum target, GrGLenum internalformat, GrGLenum pname, GrGLsizei bufSize, GrGLint *params);
using GrGLGetInternalformativFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum target, GrGLenum internalformat, GrGLenum pname, GrGLsizei bufSize, GrGLint* params);
/* KHR_debug */
typedef GrGLvoid (* GrGLDebugMessageControlProc)(GrGLenum source, GrGLenum type, GrGLenum severity, GrGLsizei count, const GrGLuint* ids, GrGLboolean enabled);
typedef GrGLvoid (* GrGLDebugMessageInsertProc)(GrGLenum source, GrGLenum type, GrGLuint id, GrGLenum severity, GrGLsizei length, const GrGLchar* buf);
typedef GrGLvoid (* GrGLDebugMessageCallbackProc)(GRGLDEBUGPROC callback, const GrGLvoid* userParam);
typedef GrGLuint (* GrGLGetDebugMessageLogProc)(GrGLuint count, GrGLsizei bufSize, GrGLenum* sources, GrGLenum* types, GrGLuint* ids, GrGLenum* severities, GrGLsizei* lengths, GrGLchar* messageLog);
typedef GrGLvoid (* GrGLPushDebugGroupProc)(GrGLenum source, GrGLuint id, GrGLsizei length, const GrGLchar * message);
typedef GrGLvoid (* GrGLPopDebugGroupProc)();
typedef GrGLvoid (* GrGLObjectLabelProc)(GrGLenum identifier, GrGLuint name, GrGLsizei length, const GrGLchar *label);
using GrGLDebugMessageControlFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum source, GrGLenum type, GrGLenum severity, GrGLsizei count, const GrGLuint* ids, GrGLboolean enabled);
using GrGLDebugMessageInsertFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum source, GrGLenum type, GrGLuint id, GrGLenum severity, GrGLsizei length, const GrGLchar* buf);
using GrGLDebugMessageCallbackFn = GrGLvoid GR_GL_FUNCTION_TYPE(GRGLDEBUGPROC callback, const GrGLvoid* userParam);
using GrGLGetDebugMessageLogFn = GrGLuint GR_GL_FUNCTION_TYPE(GrGLuint count, GrGLsizei bufSize, GrGLenum* sources, GrGLenum* types, GrGLuint* ids, GrGLenum* severities, GrGLsizei* lengths, GrGLchar* messageLog);
using GrGLPushDebugGroupFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum source, GrGLuint id, GrGLsizei length, const GrGLchar* message);
using GrGLPopDebugGroupFn = GrGLvoid GR_GL_FUNCTION_TYPE();
using GrGLObjectLabelFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum identifier, GrGLuint name, GrGLsizei length, const GrGLchar* label);
/** EXT_window_rectangles */
typedef GrGLvoid (* GrGLWindowRectanglesProc)(GrGLenum mode, GrGLsizei count, const GrGLint box[]);
using GrGLWindowRectanglesFn = GrGLvoid GR_GL_FUNCTION_TYPE(GrGLenum mode, GrGLsizei count, const GrGLint box[]);
/** EGL functions */
typedef const char* (* GrEGLQueryStringProc)(GrEGLDisplay dpy, GrEGLint name);
typedef GrEGLDisplay (* GrEGLGetCurrentDisplayProc)();
typedef GrEGLImage (* GrEGLCreateImageProc)(GrEGLDisplay dpy, GrEGLContext ctx, GrEGLenum target, GrEGLClientBuffer buffer, const GrEGLint *attrib_list);
typedef GrEGLBoolean (* GrEGLDestroyImageProc)(GrEGLDisplay dpy, GrEGLImage image);
using GrEGLQueryStringFn = const char* GR_GL_FUNCTION_TYPE(GrEGLDisplay dpy, GrEGLint name);
using GrEGLGetCurrentDisplayFn = GrEGLDisplay GR_GL_FUNCTION_TYPE();
using GrEGLCreateImageFn = GrEGLImage GR_GL_FUNCTION_TYPE(GrEGLDisplay dpy, GrEGLContext ctx, GrEGLenum target, GrEGLClientBuffer buffer, const GrEGLint* attrib_list);
using GrEGLDestroyImageFn = GrEGLBoolean GR_GL_FUNCTION_TYPE(GrEGLDisplay dpy, GrEGLImage image);
} // extern "C"
// Legacy name used in Chrome. TODO: Remove when removed from Chrome.
using GrGLGetStringProc = GrGLGetStringFn;
// This is a lighter-weight std::function, trying to reduce code size and compile time
// by only supporting the exact use cases we require.
template <typename T> class GrGLFunction;
template <typename R, typename... Args>
class GrGLFunction<R(*)(Args...)>{
class GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> {
public:
using Fn = R GR_GL_FUNCTION_TYPE(Args...);
// Construct empty.
GrGLFunction() : fCall(nullptr) {}
GrGLFunction(std::nullptr_t) : GrGLFunction() {}
GrGLFunction() = default;
GrGLFunction(std::nullptr_t) {}
// Construct from a simple function pointer.
GrGLFunction(R (GR_GL_FUNCTION_TYPE* fn_ptr)(Args...)) : GrGLFunction() {
GrGLFunction(Fn* fn_ptr) {
static_assert(sizeof(fn_ptr) <= sizeof(fBuf), "fBuf is too small");
if (fn_ptr) {
memcpy(fBuf, &fn_ptr, sizeof(fn_ptr));
fCall = [](const void* buf, Args... args) {
auto fn_ptr = *(R (GR_GL_FUNCTION_TYPE**)(Args...))buf;
return fn_ptr(args...);
return (*(Fn**)buf)(std::forward<Args>(args)...);
};
}
}
@ -287,10 +291,10 @@ public:
template <typename Closure>
GrGLFunction(Closure closure) : GrGLFunction() {
static_assert(sizeof(Closure) <= sizeof(fBuf), "fBuf is too small");
#if defined(__APPLE__) // I am having serious trouble getting these to work with all STLs...
#if defined(__APPLE__) // I am having serious trouble getting these to work with all STLs...
static_assert(std::is_trivially_copyable<Closure>::value, "");
static_assert(std::is_trivially_destructible<Closure>::value, "");
#endif
#endif
memcpy(fBuf, &closure, sizeof(closure));
fCall = [](const void* buf, Args... args) {
@ -299,20 +303,40 @@ public:
};
}
// See other (temporary) specialization below.
GrGLFunction(const GrGLFunction<R(*)(Args...)>& that);
R operator()(Args... args) const {
SkASSERT(fCall);
return fCall(fBuf, args...);
return fCall(fBuf, std::forward<Args>(args)...);
}
explicit operator bool() const {
return fCall != nullptr;
}
explicit operator bool() const { return fCall != nullptr; }
void reset() { fCall = nullptr; }
private:
R (*fCall)(const void*, Args...);
using Call = R(const void* buf, Args...);
Call* fCall = nullptr;
size_t fBuf[4];
};
/**
* Chrome instantiates GrGLFunctions on function pointers that don't include GR_GL_FUNCTION_TYPE.
* This can go away after Chrome is updated to use the above specialization.
*/
template <typename R, typename... Args>
class GrGLFunction<R (*)(Args...)> : public GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> {
public:
template <typename Closure>
GrGLFunction(Closure closure)
: GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)>(std::move(closure)) {}
};
template <typename R, typename... Args>
GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)>::GrGLFunction(const GrGLFunction<R (*)(Args...)>& that)
: fCall(that.fCall) {
memcpy(fBuf, that.fBuf, sizeof(fBuf));
}
#endif

View File

@ -79,123 +79,123 @@ public:
* operator.
*/
struct Functions {
GrGLFunction<GrGLActiveTextureProc> fActiveTexture;
GrGLFunction<GrGLAttachShaderProc> fAttachShader;
GrGLFunction<GrGLBeginQueryProc> fBeginQuery;
GrGLFunction<GrGLBindAttribLocationProc> fBindAttribLocation;
GrGLFunction<GrGLBindBufferProc> fBindBuffer;
GrGLFunction<GrGLBindFragDataLocationProc> fBindFragDataLocation;
GrGLFunction<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed;
GrGLFunction<GrGLBindFramebufferProc> fBindFramebuffer;
GrGLFunction<GrGLBindRenderbufferProc> fBindRenderbuffer;
GrGLFunction<GrGLBindTextureProc> fBindTexture;
GrGLFunction<GrGLBindVertexArrayProc> fBindVertexArray;
GrGLFunction<GrGLBlendBarrierProc> fBlendBarrier;
GrGLFunction<GrGLBlendColorProc> fBlendColor;
GrGLFunction<GrGLBlendEquationProc> fBlendEquation;
GrGLFunction<GrGLBlendFuncProc> fBlendFunc;
GrGLFunction<GrGLBlitFramebufferProc> fBlitFramebuffer;
GrGLFunction<GrGLBufferDataProc> fBufferData;
GrGLFunction<GrGLBufferSubDataProc> fBufferSubData;
GrGLFunction<GrGLCheckFramebufferStatusProc> fCheckFramebufferStatus;
GrGLFunction<GrGLClearProc> fClear;
GrGLFunction<GrGLClearColorProc> fClearColor;
GrGLFunction<GrGLClearStencilProc> fClearStencil;
GrGLFunction<GrGLClearTexImageProc> fClearTexImage;
GrGLFunction<GrGLClearTexSubImageProc> fClearTexSubImage;
GrGLFunction<GrGLColorMaskProc> fColorMask;
GrGLFunction<GrGLCompileShaderProc> fCompileShader;
GrGLFunction<GrGLCompressedTexImage2DProc> fCompressedTexImage2D;
GrGLFunction<GrGLCompressedTexSubImage2DProc> fCompressedTexSubImage2D;
GrGLFunction<GrGLCopyTexSubImage2DProc> fCopyTexSubImage2D;
GrGLFunction<GrGLCreateProgramProc> fCreateProgram;
GrGLFunction<GrGLCreateShaderProc> fCreateShader;
GrGLFunction<GrGLCullFaceProc> fCullFace;
GrGLFunction<GrGLDeleteBuffersProc> fDeleteBuffers;
GrGLFunction<GrGLDeleteFramebuffersProc> fDeleteFramebuffers;
GrGLFunction<GrGLDeleteProgramProc> fDeleteProgram;
GrGLFunction<GrGLDeleteQueriesProc> fDeleteQueries;
GrGLFunction<GrGLDeleteRenderbuffersProc> fDeleteRenderbuffers;
GrGLFunction<GrGLDeleteShaderProc> fDeleteShader;
GrGLFunction<GrGLDeleteTexturesProc> fDeleteTextures;
GrGLFunction<GrGLDeleteVertexArraysProc> fDeleteVertexArrays;
GrGLFunction<GrGLDepthMaskProc> fDepthMask;
GrGLFunction<GrGLDisableProc> fDisable;
GrGLFunction<GrGLDisableVertexAttribArrayProc> fDisableVertexAttribArray;
GrGLFunction<GrGLDrawArraysProc> fDrawArrays;
GrGLFunction<GrGLDrawArraysIndirectProc> fDrawArraysIndirect;
GrGLFunction<GrGLDrawArraysInstancedProc> fDrawArraysInstanced;
GrGLFunction<GrGLDrawBufferProc> fDrawBuffer;
GrGLFunction<GrGLDrawBuffersProc> fDrawBuffers;
GrGLFunction<GrGLDrawElementsProc> fDrawElements;
GrGLFunction<GrGLDrawElementsIndirectProc> fDrawElementsIndirect;
GrGLFunction<GrGLDrawElementsInstancedProc> fDrawElementsInstanced;
GrGLFunction<GrGLDrawRangeElementsProc> fDrawRangeElements;
GrGLFunction<GrGLEnableProc> fEnable;
GrGLFunction<GrGLEnableVertexAttribArrayProc> fEnableVertexAttribArray;
GrGLFunction<GrGLEndQueryProc> fEndQuery;
GrGLFunction<GrGLFinishProc> fFinish;
GrGLFunction<GrGLFlushProc> fFlush;
GrGLFunction<GrGLFlushMappedBufferRangeProc> fFlushMappedBufferRange;
GrGLFunction<GrGLFramebufferRenderbufferProc> fFramebufferRenderbuffer;
GrGLFunction<GrGLFramebufferTexture2DProc> fFramebufferTexture2D;
GrGLFunction<GrGLFramebufferTexture2DMultisampleProc> fFramebufferTexture2DMultisample;
GrGLFunction<GrGLFrontFaceProc> fFrontFace;
GrGLFunction<GrGLGenBuffersProc> fGenBuffers;
GrGLFunction<GrGLGenFramebuffersProc> fGenFramebuffers;
GrGLFunction<GrGLGenerateMipmapProc> fGenerateMipmap;
GrGLFunction<GrGLGenQueriesProc> fGenQueries;
GrGLFunction<GrGLGenRenderbuffersProc> fGenRenderbuffers;
GrGLFunction<GrGLGenTexturesProc> fGenTextures;
GrGLFunction<GrGLGenVertexArraysProc> fGenVertexArrays;
GrGLFunction<GrGLGetBufferParameterivProc> fGetBufferParameteriv;
GrGLFunction<GrGLGetErrorProc> fGetError;
GrGLFunction<GrGLGetFramebufferAttachmentParameterivProc> fGetFramebufferAttachmentParameteriv;
GrGLFunction<GrGLGetIntegervProc> fGetIntegerv;
GrGLFunction<GrGLGetMultisamplefvProc> fGetMultisamplefv;
GrGLFunction<GrGLGetProgramBinaryProc> fGetProgramBinary;
GrGLFunction<GrGLGetProgramInfoLogProc> fGetProgramInfoLog;
GrGLFunction<GrGLGetProgramivProc> fGetProgramiv;
GrGLFunction<GrGLGetQueryObjecti64vProc> fGetQueryObjecti64v;
GrGLFunction<GrGLGetQueryObjectivProc> fGetQueryObjectiv;
GrGLFunction<GrGLGetQueryObjectui64vProc> fGetQueryObjectui64v;
GrGLFunction<GrGLGetQueryObjectuivProc> fGetQueryObjectuiv;
GrGLFunction<GrGLGetQueryivProc> fGetQueryiv;
GrGLFunction<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv;
GrGLFunction<GrGLGetShaderInfoLogProc> fGetShaderInfoLog;
GrGLFunction<GrGLGetShaderivProc> fGetShaderiv;
GrGLFunction<GrGLGetShaderPrecisionFormatProc> fGetShaderPrecisionFormat;
GrGLFunction<GrGLGetStringProc> fGetString;
GrGLFunction<GrGLGetStringiProc> fGetStringi;
GrGLFunction<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
GrGLFunction<GrGLGetUniformLocationProc> fGetUniformLocation;
GrGLFunction<GrGLInsertEventMarkerProc> fInsertEventMarker;
GrGLFunction<GrGLInvalidateBufferDataProc> fInvalidateBufferData;
GrGLFunction<GrGLInvalidateBufferSubDataProc> fInvalidateBufferSubData;
GrGLFunction<GrGLInvalidateFramebufferProc> fInvalidateFramebuffer;
GrGLFunction<GrGLInvalidateSubFramebufferProc> fInvalidateSubFramebuffer;
GrGLFunction<GrGLInvalidateTexImageProc> fInvalidateTexImage;
GrGLFunction<GrGLInvalidateTexSubImageProc> fInvalidateTexSubImage;
GrGLFunction<GrGLIsTextureProc> fIsTexture;
GrGLFunction<GrGLLineWidthProc> fLineWidth;
GrGLFunction<GrGLLinkProgramProc> fLinkProgram;
GrGLFunction<GrGLProgramBinaryProc> fProgramBinary;
GrGLFunction<GrGLProgramParameteriProc> fProgramParameteri;
GrGLFunction<GrGLMapBufferProc> fMapBuffer;
GrGLFunction<GrGLMapBufferRangeProc> fMapBufferRange;
GrGLFunction<GrGLMapBufferSubDataProc> fMapBufferSubData;
GrGLFunction<GrGLMapTexSubImage2DProc> fMapTexSubImage2D;
GrGLFunction<GrGLMultiDrawArraysIndirectProc> fMultiDrawArraysIndirect;
GrGLFunction<GrGLMultiDrawElementsIndirectProc> fMultiDrawElementsIndirect;
GrGLFunction<GrGLPixelStoreiProc> fPixelStorei;
GrGLFunction<GrGLPolygonModeProc> fPolygonMode;
GrGLFunction<GrGLPopGroupMarkerProc> fPopGroupMarker;
GrGLFunction<GrGLPushGroupMarkerProc> fPushGroupMarker;
GrGLFunction<GrGLQueryCounterProc> fQueryCounter;
GrGLFunction<GrGLRasterSamplesProc> fRasterSamples;
GrGLFunction<GrGLReadBufferProc> fReadBuffer;
GrGLFunction<GrGLReadPixelsProc> fReadPixels;
GrGLFunction<GrGLRenderbufferStorageProc> fRenderbufferStorage;
GrGLFunction<GrGLActiveTextureFn> fActiveTexture;
GrGLFunction<GrGLAttachShaderFn> fAttachShader;
GrGLFunction<GrGLBeginQueryFn> fBeginQuery;
GrGLFunction<GrGLBindAttribLocationFn> fBindAttribLocation;
GrGLFunction<GrGLBindBufferFn> fBindBuffer;
GrGLFunction<GrGLBindFragDataLocationFn> fBindFragDataLocation;
GrGLFunction<GrGLBindFragDataLocationIndexedFn> fBindFragDataLocationIndexed;
GrGLFunction<GrGLBindFramebufferFn> fBindFramebuffer;
GrGLFunction<GrGLBindRenderbufferFn> fBindRenderbuffer;
GrGLFunction<GrGLBindTextureFn> fBindTexture;
GrGLFunction<GrGLBindVertexArrayFn> fBindVertexArray;
GrGLFunction<GrGLBlendBarrierFn> fBlendBarrier;
GrGLFunction<GrGLBlendColorFn> fBlendColor;
GrGLFunction<GrGLBlendEquationFn> fBlendEquation;
GrGLFunction<GrGLBlendFuncFn> fBlendFunc;
GrGLFunction<GrGLBlitFramebufferFn> fBlitFramebuffer;
GrGLFunction<GrGLBufferDataFn> fBufferData;
GrGLFunction<GrGLBufferSubDataFn> fBufferSubData;
GrGLFunction<GrGLCheckFramebufferStatusFn> fCheckFramebufferStatus;
GrGLFunction<GrGLClearFn> fClear;
GrGLFunction<GrGLClearColorFn> fClearColor;
GrGLFunction<GrGLClearStencilFn> fClearStencil;
GrGLFunction<GrGLClearTexImageFn> fClearTexImage;
GrGLFunction<GrGLClearTexSubImageFn> fClearTexSubImage;
GrGLFunction<GrGLColorMaskFn> fColorMask;
GrGLFunction<GrGLCompileShaderFn> fCompileShader;
GrGLFunction<GrGLCompressedTexImage2DFn> fCompressedTexImage2D;
GrGLFunction<GrGLCompressedTexSubImage2DFn> fCompressedTexSubImage2D;
GrGLFunction<GrGLCopyTexSubImage2DFn> fCopyTexSubImage2D;
GrGLFunction<GrGLCreateProgramFn> fCreateProgram;
GrGLFunction<GrGLCreateShaderFn> fCreateShader;
GrGLFunction<GrGLCullFaceFn> fCullFace;
GrGLFunction<GrGLDeleteBuffersFn> fDeleteBuffers;
GrGLFunction<GrGLDeleteFramebuffersFn> fDeleteFramebuffers;
GrGLFunction<GrGLDeleteProgramFn> fDeleteProgram;
GrGLFunction<GrGLDeleteQueriesFn> fDeleteQueries;
GrGLFunction<GrGLDeleteRenderbuffersFn> fDeleteRenderbuffers;
GrGLFunction<GrGLDeleteShaderFn> fDeleteShader;
GrGLFunction<GrGLDeleteTexturesFn> fDeleteTextures;
GrGLFunction<GrGLDeleteVertexArraysFn> fDeleteVertexArrays;
GrGLFunction<GrGLDepthMaskFn> fDepthMask;
GrGLFunction<GrGLDisableFn> fDisable;
GrGLFunction<GrGLDisableVertexAttribArrayFn> fDisableVertexAttribArray;
GrGLFunction<GrGLDrawArraysFn> fDrawArrays;
GrGLFunction<GrGLDrawArraysIndirectFn> fDrawArraysIndirect;
GrGLFunction<GrGLDrawArraysInstancedFn> fDrawArraysInstanced;
GrGLFunction<GrGLDrawBufferFn> fDrawBuffer;
GrGLFunction<GrGLDrawBuffersFn> fDrawBuffers;
GrGLFunction<GrGLDrawElementsFn> fDrawElements;
GrGLFunction<GrGLDrawElementsIndirectFn> fDrawElementsIndirect;
GrGLFunction<GrGLDrawElementsInstancedFn> fDrawElementsInstanced;
GrGLFunction<GrGLDrawRangeElementsFn> fDrawRangeElements;
GrGLFunction<GrGLEnableFn> fEnable;
GrGLFunction<GrGLEnableVertexAttribArrayFn> fEnableVertexAttribArray;
GrGLFunction<GrGLEndQueryFn> fEndQuery;
GrGLFunction<GrGLFinishFn> fFinish;
GrGLFunction<GrGLFlushFn> fFlush;
GrGLFunction<GrGLFlushMappedBufferRangeFn> fFlushMappedBufferRange;
GrGLFunction<GrGLFramebufferRenderbufferFn> fFramebufferRenderbuffer;
GrGLFunction<GrGLFramebufferTexture2DFn> fFramebufferTexture2D;
GrGLFunction<GrGLFramebufferTexture2DMultisampleFn> fFramebufferTexture2DMultisample;
GrGLFunction<GrGLFrontFaceFn> fFrontFace;
GrGLFunction<GrGLGenBuffersFn> fGenBuffers;
GrGLFunction<GrGLGenFramebuffersFn> fGenFramebuffers;
GrGLFunction<GrGLGenerateMipmapFn> fGenerateMipmap;
GrGLFunction<GrGLGenQueriesFn> fGenQueries;
GrGLFunction<GrGLGenRenderbuffersFn> fGenRenderbuffers;
GrGLFunction<GrGLGenTexturesFn> fGenTextures;
GrGLFunction<GrGLGenVertexArraysFn> fGenVertexArrays;
GrGLFunction<GrGLGetBufferParameterivFn> fGetBufferParameteriv;
GrGLFunction<GrGLGetErrorFn> fGetError;
GrGLFunction<GrGLGetFramebufferAttachmentParameterivFn> fGetFramebufferAttachmentParameteriv;
GrGLFunction<GrGLGetIntegervFn> fGetIntegerv;
GrGLFunction<GrGLGetMultisamplefvFn> fGetMultisamplefv;
GrGLFunction<GrGLGetProgramBinaryFn> fGetProgramBinary;
GrGLFunction<GrGLGetProgramInfoLogFn> fGetProgramInfoLog;
GrGLFunction<GrGLGetProgramivFn> fGetProgramiv;
GrGLFunction<GrGLGetQueryObjecti64vFn> fGetQueryObjecti64v;
GrGLFunction<GrGLGetQueryObjectivFn> fGetQueryObjectiv;
GrGLFunction<GrGLGetQueryObjectui64vFn> fGetQueryObjectui64v;
GrGLFunction<GrGLGetQueryObjectuivFn> fGetQueryObjectuiv;
GrGLFunction<GrGLGetQueryivFn> fGetQueryiv;
GrGLFunction<GrGLGetRenderbufferParameterivFn> fGetRenderbufferParameteriv;
GrGLFunction<GrGLGetShaderInfoLogFn> fGetShaderInfoLog;
GrGLFunction<GrGLGetShaderivFn> fGetShaderiv;
GrGLFunction<GrGLGetShaderPrecisionFormatFn> fGetShaderPrecisionFormat;
GrGLFunction<GrGLGetStringFn> fGetString;
GrGLFunction<GrGLGetStringiFn> fGetStringi;
GrGLFunction<GrGLGetTexLevelParameterivFn> fGetTexLevelParameteriv;
GrGLFunction<GrGLGetUniformLocationFn> fGetUniformLocation;
GrGLFunction<GrGLInsertEventMarkerFn> fInsertEventMarker;
GrGLFunction<GrGLInvalidateBufferDataFn> fInvalidateBufferData;
GrGLFunction<GrGLInvalidateBufferSubDataFn> fInvalidateBufferSubData;
GrGLFunction<GrGLInvalidateFramebufferFn> fInvalidateFramebuffer;
GrGLFunction<GrGLInvalidateSubFramebufferFn> fInvalidateSubFramebuffer;
GrGLFunction<GrGLInvalidateTexImageFn> fInvalidateTexImage;
GrGLFunction<GrGLInvalidateTexSubImageFn> fInvalidateTexSubImage;
GrGLFunction<GrGLIsTextureFn> fIsTexture;
GrGLFunction<GrGLLineWidthFn> fLineWidth;
GrGLFunction<GrGLLinkProgramFn> fLinkProgram;
GrGLFunction<GrGLProgramBinaryFn> fProgramBinary;
GrGLFunction<GrGLProgramParameteriFn> fProgramParameteri;
GrGLFunction<GrGLMapBufferFn> fMapBuffer;
GrGLFunction<GrGLMapBufferRangeFn> fMapBufferRange;
GrGLFunction<GrGLMapBufferSubDataFn> fMapBufferSubData;
GrGLFunction<GrGLMapTexSubImage2DFn> fMapTexSubImage2D;
GrGLFunction<GrGLMultiDrawArraysIndirectFn> fMultiDrawArraysIndirect;
GrGLFunction<GrGLMultiDrawElementsIndirectFn> fMultiDrawElementsIndirect;
GrGLFunction<GrGLPixelStoreiFn> fPixelStorei;
GrGLFunction<GrGLPolygonModeFn> fPolygonMode;
GrGLFunction<GrGLPopGroupMarkerFn> fPopGroupMarker;
GrGLFunction<GrGLPushGroupMarkerFn> fPushGroupMarker;
GrGLFunction<GrGLQueryCounterFn> fQueryCounter;
GrGLFunction<GrGLRasterSamplesFn> fRasterSamples;
GrGLFunction<GrGLReadBufferFn> fReadBuffer;
GrGLFunction<GrGLReadPixelsFn> fReadPixels;
GrGLFunction<GrGLRenderbufferStorageFn> fRenderbufferStorage;
// On OpenGL ES there are multiple incompatible extensions that add support for MSAA
// and ES3 adds MSAA support to the standard. On an ES3 driver we may still use the
@ -212,127 +212,127 @@ public:
// functionality.
// GL_EXT_multisampled_render_to_texture (preferred) or GL_IMG_multisampled_render_to_texture
GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2EXT;
GrGLFunction<GrGLRenderbufferStorageMultisampleFn> fRenderbufferStorageMultisampleES2EXT;
// GL_APPLE_framebuffer_multisample
GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2APPLE;
GrGLFunction<GrGLRenderbufferStorageMultisampleFn> fRenderbufferStorageMultisampleES2APPLE;
// This is used to store the pointer for GL_ARB/EXT/ANGLE/CHROMIUM_framebuffer_multisample or
// the standard function in ES3+ or GL 3.0+.
GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample;
GrGLFunction<GrGLRenderbufferStorageMultisampleFn> fRenderbufferStorageMultisample;
// Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension.
GrGLFunction<GrGLBindUniformLocationProc> fBindUniformLocation;
GrGLFunction<GrGLBindUniformLocationFn> fBindUniformLocation;
GrGLFunction<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer;
GrGLFunction<GrGLScissorProc> fScissor;
GrGLFunction<GrGLShaderSourceProc> fShaderSource;
GrGLFunction<GrGLStencilFuncProc> fStencilFunc;
GrGLFunction<GrGLStencilFuncSeparateProc> fStencilFuncSeparate;
GrGLFunction<GrGLStencilMaskProc> fStencilMask;
GrGLFunction<GrGLStencilMaskSeparateProc> fStencilMaskSeparate;
GrGLFunction<GrGLStencilOpProc> fStencilOp;
GrGLFunction<GrGLStencilOpSeparateProc> fStencilOpSeparate;
GrGLFunction<GrGLTexBufferProc> fTexBuffer;
GrGLFunction<GrGLTexBufferRangeProc> fTexBufferRange;
GrGLFunction<GrGLTexImage2DProc> fTexImage2D;
GrGLFunction<GrGLTexParameteriProc> fTexParameteri;
GrGLFunction<GrGLTexParameterivProc> fTexParameteriv;
GrGLFunction<GrGLTexSubImage2DProc> fTexSubImage2D;
GrGLFunction<GrGLTexStorage2DProc> fTexStorage2D;
GrGLFunction<GrGLTextureBarrierProc> fTextureBarrier;
GrGLFunction<GrGLDiscardFramebufferProc> fDiscardFramebuffer;
GrGLFunction<GrGLUniform1fProc> fUniform1f;
GrGLFunction<GrGLUniform1iProc> fUniform1i;
GrGLFunction<GrGLUniform1fvProc> fUniform1fv;
GrGLFunction<GrGLUniform1ivProc> fUniform1iv;
GrGLFunction<GrGLUniform2fProc> fUniform2f;
GrGLFunction<GrGLUniform2iProc> fUniform2i;
GrGLFunction<GrGLUniform2fvProc> fUniform2fv;
GrGLFunction<GrGLUniform2ivProc> fUniform2iv;
GrGLFunction<GrGLUniform3fProc> fUniform3f;
GrGLFunction<GrGLUniform3iProc> fUniform3i;
GrGLFunction<GrGLUniform3fvProc> fUniform3fv;
GrGLFunction<GrGLUniform3ivProc> fUniform3iv;
GrGLFunction<GrGLUniform4fProc> fUniform4f;
GrGLFunction<GrGLUniform4iProc> fUniform4i;
GrGLFunction<GrGLUniform4fvProc> fUniform4fv;
GrGLFunction<GrGLUniform4ivProc> fUniform4iv;
GrGLFunction<GrGLUniformMatrix2fvProc> fUniformMatrix2fv;
GrGLFunction<GrGLUniformMatrix3fvProc> fUniformMatrix3fv;
GrGLFunction<GrGLUniformMatrix4fvProc> fUniformMatrix4fv;
GrGLFunction<GrGLUnmapBufferProc> fUnmapBuffer;
GrGLFunction<GrGLUnmapBufferSubDataProc> fUnmapBufferSubData;
GrGLFunction<GrGLUnmapTexSubImage2DProc> fUnmapTexSubImage2D;
GrGLFunction<GrGLUseProgramProc> fUseProgram;
GrGLFunction<GrGLVertexAttrib1fProc> fVertexAttrib1f;
GrGLFunction<GrGLVertexAttrib2fvProc> fVertexAttrib2fv;
GrGLFunction<GrGLVertexAttrib3fvProc> fVertexAttrib3fv;
GrGLFunction<GrGLVertexAttrib4fvProc> fVertexAttrib4fv;
GrGLFunction<GrGLVertexAttribDivisorProc> fVertexAttribDivisor;
GrGLFunction<GrGLVertexAttribIPointerProc> fVertexAttribIPointer;
GrGLFunction<GrGLVertexAttribPointerProc> fVertexAttribPointer;
GrGLFunction<GrGLViewportProc> fViewport;
GrGLFunction<GrGLResolveMultisampleFramebufferFn> fResolveMultisampleFramebuffer;
GrGLFunction<GrGLScissorFn> fScissor;
GrGLFunction<GrGLShaderSourceFn> fShaderSource;
GrGLFunction<GrGLStencilFuncFn> fStencilFunc;
GrGLFunction<GrGLStencilFuncSeparateFn> fStencilFuncSeparate;
GrGLFunction<GrGLStencilMaskFn> fStencilMask;
GrGLFunction<GrGLStencilMaskSeparateFn> fStencilMaskSeparate;
GrGLFunction<GrGLStencilOpFn> fStencilOp;
GrGLFunction<GrGLStencilOpSeparateFn> fStencilOpSeparate;
GrGLFunction<GrGLTexBufferFn> fTexBuffer;
GrGLFunction<GrGLTexBufferRangeFn> fTexBufferRange;
GrGLFunction<GrGLTexImage2DFn> fTexImage2D;
GrGLFunction<GrGLTexParameteriFn> fTexParameteri;
GrGLFunction<GrGLTexParameterivFn> fTexParameteriv;
GrGLFunction<GrGLTexSubImage2DFn> fTexSubImage2D;
GrGLFunction<GrGLTexStorage2DFn> fTexStorage2D;
GrGLFunction<GrGLTextureBarrierFn> fTextureBarrier;
GrGLFunction<GrGLDiscardFramebufferFn> fDiscardFramebuffer;
GrGLFunction<GrGLUniform1fFn> fUniform1f;
GrGLFunction<GrGLUniform1iFn> fUniform1i;
GrGLFunction<GrGLUniform1fvFn> fUniform1fv;
GrGLFunction<GrGLUniform1ivFn> fUniform1iv;
GrGLFunction<GrGLUniform2fFn> fUniform2f;
GrGLFunction<GrGLUniform2iFn> fUniform2i;
GrGLFunction<GrGLUniform2fvFn> fUniform2fv;
GrGLFunction<GrGLUniform2ivFn> fUniform2iv;
GrGLFunction<GrGLUniform3fFn> fUniform3f;
GrGLFunction<GrGLUniform3iFn> fUniform3i;
GrGLFunction<GrGLUniform3fvFn> fUniform3fv;
GrGLFunction<GrGLUniform3ivFn> fUniform3iv;
GrGLFunction<GrGLUniform4fFn> fUniform4f;
GrGLFunction<GrGLUniform4iFn> fUniform4i;
GrGLFunction<GrGLUniform4fvFn> fUniform4fv;
GrGLFunction<GrGLUniform4ivFn> fUniform4iv;
GrGLFunction<GrGLUniformMatrix2fvFn> fUniformMatrix2fv;
GrGLFunction<GrGLUniformMatrix3fvFn> fUniformMatrix3fv;
GrGLFunction<GrGLUniformMatrix4fvFn> fUniformMatrix4fv;
GrGLFunction<GrGLUnmapBufferFn> fUnmapBuffer;
GrGLFunction<GrGLUnmapBufferSubDataFn> fUnmapBufferSubData;
GrGLFunction<GrGLUnmapTexSubImage2DFn> fUnmapTexSubImage2D;
GrGLFunction<GrGLUseProgramFn> fUseProgram;
GrGLFunction<GrGLVertexAttrib1fFn> fVertexAttrib1f;
GrGLFunction<GrGLVertexAttrib2fvFn> fVertexAttrib2fv;
GrGLFunction<GrGLVertexAttrib3fvFn> fVertexAttrib3fv;
GrGLFunction<GrGLVertexAttrib4fvFn> fVertexAttrib4fv;
GrGLFunction<GrGLVertexAttribDivisorFn> fVertexAttribDivisor;
GrGLFunction<GrGLVertexAttribIPointerFn> fVertexAttribIPointer;
GrGLFunction<GrGLVertexAttribPointerFn> fVertexAttribPointer;
GrGLFunction<GrGLViewportFn> fViewport;
/* GL_NV_path_rendering */
GrGLFunction<GrGLMatrixLoadfProc> fMatrixLoadf;
GrGLFunction<GrGLMatrixLoadIdentityProc> fMatrixLoadIdentity;
GrGLFunction<GrGLGetProgramResourceLocationProc> fGetProgramResourceLocation;
GrGLFunction<GrGLPathCommandsProc> fPathCommands;
GrGLFunction<GrGLPathParameteriProc> fPathParameteri;
GrGLFunction<GrGLPathParameterfProc> fPathParameterf;
GrGLFunction<GrGLGenPathsProc> fGenPaths;
GrGLFunction<GrGLDeletePathsProc> fDeletePaths;
GrGLFunction<GrGLIsPathProc> fIsPath;
GrGLFunction<GrGLPathStencilFuncProc> fPathStencilFunc;
GrGLFunction<GrGLStencilFillPathProc> fStencilFillPath;
GrGLFunction<GrGLStencilStrokePathProc> fStencilStrokePath;
GrGLFunction<GrGLStencilFillPathInstancedProc> fStencilFillPathInstanced;
GrGLFunction<GrGLStencilStrokePathInstancedProc> fStencilStrokePathInstanced;
GrGLFunction<GrGLCoverFillPathProc> fCoverFillPath;
GrGLFunction<GrGLCoverStrokePathProc> fCoverStrokePath;
GrGLFunction<GrGLCoverFillPathInstancedProc> fCoverFillPathInstanced;
GrGLFunction<GrGLCoverStrokePathInstancedProc> fCoverStrokePathInstanced;
GrGLFunction<GrGLMatrixLoadfFn> fMatrixLoadf;
GrGLFunction<GrGLMatrixLoadIdentityFn> fMatrixLoadIdentity;
GrGLFunction<GrGLGetProgramResourceLocationFn> fGetProgramResourceLocation;
GrGLFunction<GrGLPathCommandsFn> fPathCommands;
GrGLFunction<GrGLPathParameteriFn> fPathParameteri;
GrGLFunction<GrGLPathParameterfFn> fPathParameterf;
GrGLFunction<GrGLGenPathsFn> fGenPaths;
GrGLFunction<GrGLDeletePathsFn> fDeletePaths;
GrGLFunction<GrGLIsPathFn> fIsPath;
GrGLFunction<GrGLPathStencilFuncFn> fPathStencilFunc;
GrGLFunction<GrGLStencilFillPathFn> fStencilFillPath;
GrGLFunction<GrGLStencilStrokePathFn> fStencilStrokePath;
GrGLFunction<GrGLStencilFillPathInstancedFn> fStencilFillPathInstanced;
GrGLFunction<GrGLStencilStrokePathInstancedFn> fStencilStrokePathInstanced;
GrGLFunction<GrGLCoverFillPathFn> fCoverFillPath;
GrGLFunction<GrGLCoverStrokePathFn> fCoverStrokePath;
GrGLFunction<GrGLCoverFillPathInstancedFn> fCoverFillPathInstanced;
GrGLFunction<GrGLCoverStrokePathInstancedFn> fCoverStrokePathInstanced;
// NV_path_rendering v1.2
GrGLFunction<GrGLStencilThenCoverFillPathProc> fStencilThenCoverFillPath;
GrGLFunction<GrGLStencilThenCoverStrokePathProc> fStencilThenCoverStrokePath;
GrGLFunction<GrGLStencilThenCoverFillPathInstancedProc> fStencilThenCoverFillPathInstanced;
GrGLFunction<GrGLStencilThenCoverStrokePathInstancedProc> fStencilThenCoverStrokePathInstanced;
GrGLFunction<GrGLStencilThenCoverFillPathFn> fStencilThenCoverFillPath;
GrGLFunction<GrGLStencilThenCoverStrokePathFn> fStencilThenCoverStrokePath;
GrGLFunction<GrGLStencilThenCoverFillPathInstancedFn> fStencilThenCoverFillPathInstanced;
GrGLFunction<GrGLStencilThenCoverStrokePathInstancedFn> fStencilThenCoverStrokePathInstanced;
// NV_path_rendering v1.3
GrGLFunction<GrGLProgramPathFragmentInputGenProc> fProgramPathFragmentInputGen;
GrGLFunction<GrGLProgramPathFragmentInputGenFn> fProgramPathFragmentInputGen;
// CHROMIUM_path_rendering
GrGLFunction<GrGLBindFragmentInputLocationProc> fBindFragmentInputLocation;
GrGLFunction<GrGLBindFragmentInputLocationFn> fBindFragmentInputLocation;
/* NV_framebuffer_mixed_samples */
GrGLFunction<GrGLCoverageModulationProc> fCoverageModulation;
GrGLFunction<GrGLCoverageModulationFn> fCoverageModulation;
/* ARB_sample_shading */
GrGLFunction<GrGLMinSampleShadingProc> fMinSampleShading;
GrGLFunction<GrGLMinSampleShadingFn> fMinSampleShading;
/* ARB_sync */
GrGLFunction<GrGLFenceSyncProc> fFenceSync;
GrGLFunction<GrGLIsSyncProc> fIsSync;
GrGLFunction<GrGLClientWaitSyncProc> fClientWaitSync;
GrGLFunction<GrGLWaitSyncProc> fWaitSync;
GrGLFunction<GrGLDeleteSyncProc> fDeleteSync;
GrGLFunction<GrGLFenceSyncFn> fFenceSync;
GrGLFunction<GrGLIsSyncFn> fIsSync;
GrGLFunction<GrGLClientWaitSyncFn> fClientWaitSync;
GrGLFunction<GrGLWaitSyncFn> fWaitSync;
GrGLFunction<GrGLDeleteSyncFn> fDeleteSync;
/* ARB_internalforamt_query */
GrGLFunction<GrGLGetInternalformativProc> fGetInternalformativ;
GrGLFunction<GrGLGetInternalformativFn> fGetInternalformativ;
/* KHR_debug */
GrGLFunction<GrGLDebugMessageControlProc> fDebugMessageControl;
GrGLFunction<GrGLDebugMessageInsertProc> fDebugMessageInsert;
GrGLFunction<GrGLDebugMessageCallbackProc> fDebugMessageCallback;
GrGLFunction<GrGLGetDebugMessageLogProc> fGetDebugMessageLog;
GrGLFunction<GrGLPushDebugGroupProc> fPushDebugGroup;
GrGLFunction<GrGLPopDebugGroupProc> fPopDebugGroup;
GrGLFunction<GrGLObjectLabelProc> fObjectLabel;
GrGLFunction<GrGLDebugMessageControlFn> fDebugMessageControl;
GrGLFunction<GrGLDebugMessageInsertFn> fDebugMessageInsert;
GrGLFunction<GrGLDebugMessageCallbackFn> fDebugMessageCallback;
GrGLFunction<GrGLGetDebugMessageLogFn> fGetDebugMessageLog;
GrGLFunction<GrGLPushDebugGroupFn> fPushDebugGroup;
GrGLFunction<GrGLPopDebugGroupFn> fPopDebugGroup;
GrGLFunction<GrGLObjectLabelFn> fObjectLabel;
/* EXT_window_rectangles */
GrGLFunction<GrGLWindowRectanglesProc> fWindowRectangles;
GrGLFunction<GrGLWindowRectanglesFn> fWindowRectangles;
/* EGL functions */
GrGLFunction<GrEGLCreateImageProc> fEGLCreateImage;
GrGLFunction<GrEGLDestroyImageProc> fEGLDestroyImage;
GrGLFunction<GrEGLCreateImageFn> fEGLCreateImage;
GrGLFunction<GrEGLDestroyImageFn> fEGLDestroyImage;
} fFunctions;
#if GR_TEST_UTILS

View File

@ -9,11 +9,11 @@
#include "gl/GrGLAssembleInterface.h"
#include "GrGLUtil.h"
#define GET_PROC(F) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "gl" #F)
#define GET_PROC_SUFFIX(F, S) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "gl" #F #S)
#define GET_PROC_LOCAL(F) GrGL ## F ## Proc F = (GrGL ## F ## Proc) get(ctx, "gl" #F)
#define GET_PROC(F) functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F)
#define GET_PROC_SUFFIX(F, S) functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F #S)
#define GET_PROC_LOCAL(F) GrGL##F##Fn* F = (GrGL##F##Fn*)get(ctx, "gl" #F)
#define GET_EGL_PROC_SUFFIX(F, S) functions->fEGL ## F = (GrEGL ## F ## Proc) get(ctx, "egl" #F #S)
#define GET_EGL_PROC_SUFFIX(F, S) functions->fEGL##F = (GrEGL##F##Fn*)get(ctx, "egl" #F #S)
sk_sp<const GrGLInterface> GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get) {
GET_PROC_LOCAL(GetString);
@ -36,13 +36,13 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get
return nullptr;
}
static void get_egl_query_and_display(GrEGLQueryStringProc* queryString, GrEGLDisplay* display,
static void get_egl_query_and_display(GrEGLQueryStringFn** queryString, GrEGLDisplay* display,
void* ctx, GrGLGetProc get) {
*queryString = (GrEGLQueryStringProc) get(ctx, "eglQueryString");
*queryString = (GrEGLQueryStringFn*)get(ctx, "eglQueryString");
*display = GR_EGL_NO_DISPLAY;
if (*queryString) {
GrEGLGetCurrentDisplayProc getCurrentDisplay =
(GrEGLGetCurrentDisplayProc) get(ctx, "eglGetCurrentDisplay");
GrEGLGetCurrentDisplayFn* getCurrentDisplay =
(GrEGLGetCurrentDisplayFn*)get(ctx, "eglGetCurrentDisplay");
if (getCurrentDisplay) {
*display = getCurrentDisplay();
} else {
@ -69,7 +69,7 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc g
return nullptr;
}
GrEGLQueryStringProc queryString;
GrEGLQueryStringFn* queryString;
GrEGLDisplay display;
get_egl_query_and_display(&queryString, &display, ctx, get);
GrGLExtensions extensions;
@ -429,7 +429,7 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc
GET_PROC_LOCAL(GetIntegerv);
GET_PROC_LOCAL(GetStringi);
GrEGLQueryStringProc queryString;
GrEGLQueryStringFn* queryString;
GrEGLDisplay display;
get_egl_query_and_display(&queryString, &display, ctx, get);
GrGLExtensions extensions;
@ -666,12 +666,18 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc
if (extensions.has("GL_EXT_multisampled_render_to_texture")) {
GET_PROC_SUFFIX(FramebufferTexture2DMultisample, EXT);
functions->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) get(ctx, "glRenderbufferStorageMultisampleEXT");
functions->fRenderbufferStorageMultisampleES2EXT =
(GrGLRenderbufferStorageMultisampleFn*)get(ctx,
"glRenderbufferStorageMultisampleEXT");
} else if (extensions.has("GL_IMG_multisampled_render_to_texture")) {
GET_PROC_SUFFIX(FramebufferTexture2DMultisample, IMG);
functions->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) get(ctx, "glRenderbufferStorageMultisampleIMG");
functions->fRenderbufferStorageMultisampleES2EXT =
(GrGLRenderbufferStorageMultisampleFn*)get(ctx,
"glRenderbufferStorageMultisampleIMG");
} else if (extensions.has("GL_APPLE_framebuffer_multisample")) {
functions->fRenderbufferStorageMultisampleES2APPLE = (GrGLRenderbufferStorageMultisampleProc) get(ctx, "glRenderbufferStorageMultisampleAPPLE");
functions->fRenderbufferStorageMultisampleES2APPLE =
(GrGLRenderbufferStorageMultisampleFn*)get(ctx,
"glRenderbufferStorageMultisampleAPPLE");
GET_PROC_SUFFIX(ResolveMultisampleFramebuffer, APPLE);
}

View File

@ -66,10 +66,10 @@ static void eat_space_sep_strings(SkTArray<SkString>* out, const char in[]) {
}
bool GrGLExtensions::init(GrGLStandard standard,
GrGLFunction<GrGLGetStringProc> getString,
GrGLFunction<GrGLGetStringiProc> getStringi,
GrGLFunction<GrGLGetIntegervProc> getIntegerv,
GrGLFunction<GrEGLQueryStringProc> queryString,
GrGLFunction<GrGLGetStringFn> getString,
GrGLFunction<GrGLGetStringiFn> getStringi,
GrGLFunction<GrGLGetIntegervFn> getIntegerv,
GrGLFunction<GrEGLQueryStringFn> queryString,
GrEGLDisplay eglDisplay) {
fInitialized = false;
fStrings.reset();

View File

@ -8,11 +8,11 @@
#include "GrGLTestInterface.h"
namespace {
template<typename R, typename... A>
GrGLFunction<R(*)(A...)> bind_to_member(GrGLTestInterface* interface,
R (GrGLTestInterface::*member)(A...)) {
return [interface, member] (A... a) -> R { return (interface->*member)(a...); };
}
template <typename R, typename... A>
GrGLFunction<R GR_GL_FUNCTION_TYPE(A...)> bind_to_member(GrGLTestInterface* interface,
R (GrGLTestInterface::*member)(A...)) {
return [interface, member](A... a) -> R { return (interface->*member)(a...); };
}
} // anonymous namespace
GrGLTestInterface::GrGLTestInterface() {

View File

@ -72,7 +72,7 @@ sk_sp<const GrGLInterface> GrGLMakeNativeInterface() {
return nullptr;
}
GrGLGetStringProc getString = (GrGLGetStringProc)getter.getProc("glGetString");
GrGLGetStringFn* getString = (GrGLGetStringFn*)getter.getProc("glGetString");
if (nullptr == getString) {
return nullptr;
}