*/
class GrGLExtensions : public SkNoncopyable {
public:
-
GrGLExtensions() : fInitialized(false), fStrings(SkNEW(SkTArray<SkString>)) {}
void swap(GrGLExtensions* that) {
template <typename FNPTR_TYPE> class GLPtr {
public:
GLPtr() : fPtr(NULL) {}
- GLPtr operator =(FNPTR_TYPE ptr) { fPtr = ptr; return *this; }
+ GLPtr operator=(FNPTR_TYPE ptr) { fPtr = ptr; return *this; }
operator FNPTR_TYPE() const { return fPtr; }
private:
FNPTR_TYPE fPtr;
};
+ // This is a temporary workaround to keep Chromium's GrGLInterface factories compiling until
+ // they're updated to use the Functions struct.
+ template <typename FNPTR_TYPE> class GLPtrAlias {
+ public:
+ GLPtrAlias(GLPtr<FNPTR_TYPE>* base) : fBase(base) {}
+ void operator=(FNPTR_TYPE ptr) { *fBase = ptr; }
+ private:
+ GLPtr<FNPTR_TYPE>* fBase;
+ };
+
typedef SkRefCnt INHERITED;
public:
bool hasExtension(const char ext[]) const {
if (!fExtensions.isInitialized()) {
GrGLExtensions* extensions = const_cast<GrGLExtensions*>(&fExtensions);
- if (!extensions->init(fStandard, fGetString, fGetStringi, fGetIntegerv)) {
+ if (!extensions->init(fStandard, fFunctions.fGetString,
+ fFunctions.fGetStringi, fFunctions.fGetIntegerv)) {
return false;
}
}
return fExtensions.has(ext);
}
- GLPtr<GrGLActiveTextureProc> fActiveTexture;
- GLPtr<GrGLAttachShaderProc> fAttachShader;
- GLPtr<GrGLBeginQueryProc> fBeginQuery;
- GLPtr<GrGLBindAttribLocationProc> fBindAttribLocation;
- GLPtr<GrGLBindBufferProc> fBindBuffer;
- GLPtr<GrGLBindFragDataLocationProc> fBindFragDataLocation;
- GLPtr<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed;
- GLPtr<GrGLBindFramebufferProc> fBindFramebuffer;
- GLPtr<GrGLBindRenderbufferProc> fBindRenderbuffer;
- GLPtr<GrGLBindTextureProc> fBindTexture;
- GLPtr<GrGLBindVertexArrayProc> fBindVertexArray;
- GLPtr<GrGLBlendColorProc> fBlendColor;
- GLPtr<GrGLBlendFuncProc> fBlendFunc;
- GLPtr<GrGLBlitFramebufferProc> fBlitFramebuffer;
- GLPtr<GrGLBufferDataProc> fBufferData;
- GLPtr<GrGLBufferSubDataProc> fBufferSubData;
- GLPtr<GrGLCheckFramebufferStatusProc> fCheckFramebufferStatus;
- GLPtr<GrGLClearProc> fClear;
- GLPtr<GrGLClearColorProc> fClearColor;
- GLPtr<GrGLClearStencilProc> fClearStencil;
- GLPtr<GrGLClientActiveTextureProc> fClientActiveTexture;
- GLPtr<GrGLColorMaskProc> fColorMask;
- GLPtr<GrGLCompileShaderProc> fCompileShader;
- GLPtr<GrGLCompressedTexImage2DProc> fCompressedTexImage2D;
- GLPtr<GrGLCopyTexSubImage2DProc> fCopyTexSubImage2D;
- GLPtr<GrGLCreateProgramProc> fCreateProgram;
- GLPtr<GrGLCreateShaderProc> fCreateShader;
- GLPtr<GrGLCullFaceProc> fCullFace;
- GLPtr<GrGLDeleteBuffersProc> fDeleteBuffers;
- GLPtr<GrGLDeleteFramebuffersProc> fDeleteFramebuffers;
- GLPtr<GrGLDeleteProgramProc> fDeleteProgram;
- GLPtr<GrGLDeleteQueriesProc> fDeleteQueries;
- GLPtr<GrGLDeleteRenderbuffersProc> fDeleteRenderbuffers;
- GLPtr<GrGLDeleteShaderProc> fDeleteShader;
- GLPtr<GrGLDeleteTexturesProc> fDeleteTextures;
- GLPtr<GrGLDeleteVertexArraysProc> fDeleteVertexArrays;
- GLPtr<GrGLDepthMaskProc> fDepthMask;
- GLPtr<GrGLDisableProc> fDisable;
- GLPtr<GrGLDisableClientStateProc> fDisableClientState;
- GLPtr<GrGLDisableVertexAttribArrayProc> fDisableVertexAttribArray;
- GLPtr<GrGLDrawArraysProc> fDrawArrays;
- GLPtr<GrGLDrawBufferProc> fDrawBuffer;
- GLPtr<GrGLDrawBuffersProc> fDrawBuffers;
- GLPtr<GrGLDrawElementsProc> fDrawElements;
- GLPtr<GrGLEnableProc> fEnable;
- GLPtr<GrGLEnableClientStateProc> fEnableClientState;
- GLPtr<GrGLEnableVertexAttribArrayProc> fEnableVertexAttribArray;
- GLPtr<GrGLEndQueryProc> fEndQuery;
- GLPtr<GrGLFinishProc> fFinish;
- GLPtr<GrGLFlushProc> fFlush;
- GLPtr<GrGLFramebufferRenderbufferProc> fFramebufferRenderbuffer;
- GLPtr<GrGLFramebufferTexture2DProc> fFramebufferTexture2D;
- GLPtr<GrGLFramebufferTexture2DMultisampleProc> fFramebufferTexture2DMultisample;
- GLPtr<GrGLFrontFaceProc> fFrontFace;
- GLPtr<GrGLGenBuffersProc> fGenBuffers;
- GLPtr<GrGLGenFramebuffersProc> fGenFramebuffers;
- GLPtr<GrGLGenerateMipmapProc> fGenerateMipmap;
- GLPtr<GrGLGenQueriesProc> fGenQueries;
- GLPtr<GrGLGenRenderbuffersProc> fGenRenderbuffers;
- GLPtr<GrGLGenTexturesProc> fGenTextures;
- GLPtr<GrGLGenVertexArraysProc> fGenVertexArrays;
- GLPtr<GrGLGetBufferParameterivProc> fGetBufferParameteriv;
- GLPtr<GrGLGetErrorProc> fGetError;
- GLPtr<GrGLGetFramebufferAttachmentParameterivProc> fGetFramebufferAttachmentParameteriv;
- GLPtr<GrGLGetIntegervProc> fGetIntegerv;
- GLPtr<GrGLGetQueryObjecti64vProc> fGetQueryObjecti64v;
- GLPtr<GrGLGetQueryObjectivProc> fGetQueryObjectiv;
- GLPtr<GrGLGetQueryObjectui64vProc> fGetQueryObjectui64v;
- GLPtr<GrGLGetQueryObjectuivProc> fGetQueryObjectuiv;
- GLPtr<GrGLGetQueryivProc> fGetQueryiv;
- GLPtr<GrGLGetProgramInfoLogProc> fGetProgramInfoLog;
- GLPtr<GrGLGetProgramivProc> fGetProgramiv;
- GLPtr<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv;
- GLPtr<GrGLGetShaderInfoLogProc> fGetShaderInfoLog;
- GLPtr<GrGLGetShaderivProc> fGetShaderiv;
- GLPtr<GrGLGetStringProc> fGetString;
- GLPtr<GrGLGetStringiProc> fGetStringi;
- GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
- GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation;
- GLPtr<GrGLLineWidthProc> fLineWidth;
- GLPtr<GrGLLinkProgramProc> fLinkProgram;
- GLPtr<GrGLLoadIdentityProc> fLoadIdentity;
- GLPtr<GrGLLoadMatrixfProc> fLoadMatrixf;
- GLPtr<GrGLMapBufferProc> fMapBuffer;
- GLPtr<GrGLMatrixModeProc> fMatrixMode;
- GLPtr<GrGLPixelStoreiProc> fPixelStorei;
- GLPtr<GrGLQueryCounterProc> fQueryCounter;
- GLPtr<GrGLReadBufferProc> fReadBuffer;
- GLPtr<GrGLReadPixelsProc> fReadPixels;
- GLPtr<GrGLRenderbufferStorageProc> 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
- // older extensions for performance reasons or due to ES3 driver bugs. We want the function
- // that creates the GrGLInterface to provide all available functions and internally
- // we will select among them. They all have a method called glRenderbufferStorageMultisample*.
- // So we have separate function pointers for GL_IMG/EXT_multisampled_to_texture,
- // GL_CHROMIUM/ANGLE_framebuffer_multisample/ES3, and GL_APPLE_framebuffer_multisample
- // variations.
- //
- // If a driver supports multiple GL_ARB_framebuffer_multisample-style extensions then we will
- // assume the function pointers for the standard (or equivalent GL_ARB) version have
- // been preferred over GL_EXT, GL_CHROMIUM, or GL_ANGLE variations that have reduced
- // functionality.
-
- // GL_EXT_multisampled_render_to_texture (preferred) or GL_IMG_multisampled_render_to_texture
- GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2EXT;
- // GL_APPLE_framebuffer_multisample
- GLPtr<GrGLRenderbufferStorageMultisampleProc> 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+.
- GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample;
-
- // Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension.
- GLPtr<GrGLBindUniformLocation> fBindUniformLocation;
-
- GLPtr<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer;
- GLPtr<GrGLScissorProc> fScissor;
- GLPtr<GrGLShaderSourceProc> fShaderSource;
- GLPtr<GrGLStencilFuncProc> fStencilFunc;
- GLPtr<GrGLStencilFuncSeparateProc> fStencilFuncSeparate;
- GLPtr<GrGLStencilMaskProc> fStencilMask;
- GLPtr<GrGLStencilMaskSeparateProc> fStencilMaskSeparate;
- GLPtr<GrGLStencilOpProc> fStencilOp;
- GLPtr<GrGLStencilOpSeparateProc> fStencilOpSeparate;
- GLPtr<GrGLTexGenfProc> fTexGenf;
- GLPtr<GrGLTexGenfvProc> fTexGenfv;
- GLPtr<GrGLTexGeniProc> fTexGeni;
- GLPtr<GrGLTexImage2DProc> fTexImage2D;
- GLPtr<GrGLTexParameteriProc> fTexParameteri;
- GLPtr<GrGLTexParameterivProc> fTexParameteriv;
- GLPtr<GrGLTexSubImage2DProc> fTexSubImage2D;
- GLPtr<GrGLTexStorage2DProc> fTexStorage2D;
- GLPtr<GrGLDiscardFramebufferProc> fDiscardFramebuffer;
- GLPtr<GrGLUniform1fProc> fUniform1f;
- GLPtr<GrGLUniform1iProc> fUniform1i;
- GLPtr<GrGLUniform1fvProc> fUniform1fv;
- GLPtr<GrGLUniform1ivProc> fUniform1iv;
- GLPtr<GrGLUniform2fProc> fUniform2f;
- GLPtr<GrGLUniform2iProc> fUniform2i;
- GLPtr<GrGLUniform2fvProc> fUniform2fv;
- GLPtr<GrGLUniform2ivProc> fUniform2iv;
- GLPtr<GrGLUniform3fProc> fUniform3f;
- GLPtr<GrGLUniform3iProc> fUniform3i;
- GLPtr<GrGLUniform3fvProc> fUniform3fv;
- GLPtr<GrGLUniform3ivProc> fUniform3iv;
- GLPtr<GrGLUniform4fProc> fUniform4f;
- GLPtr<GrGLUniform4iProc> fUniform4i;
- GLPtr<GrGLUniform4fvProc> fUniform4fv;
- GLPtr<GrGLUniform4ivProc> fUniform4iv;
- GLPtr<GrGLUniformMatrix2fvProc> fUniformMatrix2fv;
- GLPtr<GrGLUniformMatrix3fvProc> fUniformMatrix3fv;
- GLPtr<GrGLUniformMatrix4fvProc> fUniformMatrix4fv;
- GLPtr<GrGLUnmapBufferProc> fUnmapBuffer;
- GLPtr<GrGLUseProgramProc> fUseProgram;
- GLPtr<GrGLVertexAttrib4fvProc> fVertexAttrib4fv;
- GLPtr<GrGLVertexAttribPointerProc> fVertexAttribPointer;
- GLPtr<GrGLVertexPointerProc> fVertexPointer;
- GLPtr<GrGLViewportProc> 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<GrGLPathCommandsProc> fPathCommands;
- GLPtr<GrGLPathCoordsProc> fPathCoords;
- GLPtr<GrGLPathSubCommandsProc> fPathSubCommands;
- GLPtr<GrGLPathSubCoordsProc> fPathSubCoords;
- GLPtr<GrGLPathStringProc> fPathString;
- GLPtr<GrGLPathGlyphsProc> fPathGlyphs;
- GLPtr<GrGLPathGlyphRangeProc> fPathGlyphRange;
- GLPtr<GrGLWeightPathsProc> fWeightPaths;
- GLPtr<GrGLCopyPathProc> fCopyPath;
- GLPtr<GrGLInterpolatePathsProc> fInterpolatePaths;
- GLPtr<GrGLTransformPathProc> fTransformPath;
- GLPtr<GrGLPathParameterivProc> fPathParameteriv;
- GLPtr<GrGLPathParameteriProc> fPathParameteri;
- GLPtr<GrGLPathParameterfvProc> fPathParameterfv;
- GLPtr<GrGLPathParameterfProc> fPathParameterf;
- GLPtr<GrGLPathDashArrayProc> fPathDashArray;
- GLPtr<GrGLGenPathsProc> fGenPaths;
- GLPtr<GrGLDeletePathsProc> fDeletePaths;
- GLPtr<GrGLIsPathProc> fIsPath;
- GLPtr<GrGLPathStencilFuncProc> fPathStencilFunc;
- GLPtr<GrGLPathStencilDepthOffsetProc> fPathStencilDepthOffset;
- GLPtr<GrGLStencilFillPathProc> fStencilFillPath;
- GLPtr<GrGLStencilStrokePathProc> fStencilStrokePath;
- GLPtr<GrGLStencilFillPathInstancedProc> fStencilFillPathInstanced;
- GLPtr<GrGLStencilStrokePathInstancedProc> fStencilStrokePathInstanced;
- GLPtr<GrGLPathCoverDepthFuncProc> fPathCoverDepthFunc;
- GLPtr<GrGLPathColorGenProc> fPathColorGen;
- GLPtr<GrGLPathTexGenProc> fPathTexGen;
- GLPtr<GrGLPathFogGenProc> fPathFogGen;
- GLPtr<GrGLCoverFillPathProc> fCoverFillPath;
- GLPtr<GrGLCoverStrokePathProc> fCoverStrokePath;
- GLPtr<GrGLCoverFillPathInstancedProc> fCoverFillPathInstanced;
- GLPtr<GrGLCoverStrokePathInstancedProc> fCoverStrokePathInstanced;
- GLPtr<GrGLGetPathParameterivProc> fGetPathParameteriv;
- GLPtr<GrGLGetPathParameterfvProc> fGetPathParameterfv;
- GLPtr<GrGLGetPathCommandsProc> fGetPathCommands;
- GLPtr<GrGLGetPathCoordsProc> fGetPathCoords;
- GLPtr<GrGLGetPathDashArrayProc> fGetPathDashArray;
- GLPtr<GrGLGetPathMetricsProc> fGetPathMetrics;
- GLPtr<GrGLGetPathMetricRangeProc> fGetPathMetricRange;
- GLPtr<GrGLGetPathSpacingProc> fGetPathSpacing;
- GLPtr<GrGLGetPathColorGenivProc> fGetPathColorGeniv;
- GLPtr<GrGLGetPathColorGenfvProc> fGetPathColorGenfv;
- GLPtr<GrGLGetPathTexGenivProc> fGetPathTexGeniv;
- GLPtr<GrGLGetPathTexGenfvProc> fGetPathTexGenfv;
- GLPtr<GrGLIsPointInFillPathProc> fIsPointInFillPath;
- GLPtr<GrGLIsPointInStrokePathProc> fIsPointInStrokePath;
- GLPtr<GrGLGetPathLengthProc> fGetPathLength;
- GLPtr<GrGLPointAlongPathProc> fPointAlongPath;
+ /**
+ * The function pointers are in a struct so that we can have a compiler generated assignment
+ * operator.
+ */
+ struct Functions {
+ GLPtr<GrGLActiveTextureProc> fActiveTexture;
+ GLPtr<GrGLAttachShaderProc> fAttachShader;
+ GLPtr<GrGLBeginQueryProc> fBeginQuery;
+ GLPtr<GrGLBindAttribLocationProc> fBindAttribLocation;
+ GLPtr<GrGLBindBufferProc> fBindBuffer;
+ GLPtr<GrGLBindFragDataLocationProc> fBindFragDataLocation;
+ GLPtr<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed;
+ GLPtr<GrGLBindFramebufferProc> fBindFramebuffer;
+ GLPtr<GrGLBindRenderbufferProc> fBindRenderbuffer;
+ GLPtr<GrGLBindTextureProc> fBindTexture;
+ GLPtr<GrGLBindVertexArrayProc> fBindVertexArray;
+ GLPtr<GrGLBlendColorProc> fBlendColor;
+ GLPtr<GrGLBlendFuncProc> fBlendFunc;
+ GLPtr<GrGLBlitFramebufferProc> fBlitFramebuffer;
+ GLPtr<GrGLBufferDataProc> fBufferData;
+ GLPtr<GrGLBufferSubDataProc> fBufferSubData;
+ GLPtr<GrGLCheckFramebufferStatusProc> fCheckFramebufferStatus;
+ GLPtr<GrGLClearProc> fClear;
+ GLPtr<GrGLClearColorProc> fClearColor;
+ GLPtr<GrGLClearStencilProc> fClearStencil;
+ GLPtr<GrGLClientActiveTextureProc> fClientActiveTexture;
+ GLPtr<GrGLColorMaskProc> fColorMask;
+ GLPtr<GrGLCompileShaderProc> fCompileShader;
+ GLPtr<GrGLCompressedTexImage2DProc> fCompressedTexImage2D;
+ GLPtr<GrGLCopyTexSubImage2DProc> fCopyTexSubImage2D;
+ GLPtr<GrGLCreateProgramProc> fCreateProgram;
+ GLPtr<GrGLCreateShaderProc> fCreateShader;
+ GLPtr<GrGLCullFaceProc> fCullFace;
+ GLPtr<GrGLDeleteBuffersProc> fDeleteBuffers;
+ GLPtr<GrGLDeleteFramebuffersProc> fDeleteFramebuffers;
+ GLPtr<GrGLDeleteProgramProc> fDeleteProgram;
+ GLPtr<GrGLDeleteQueriesProc> fDeleteQueries;
+ GLPtr<GrGLDeleteRenderbuffersProc> fDeleteRenderbuffers;
+ GLPtr<GrGLDeleteShaderProc> fDeleteShader;
+ GLPtr<GrGLDeleteTexturesProc> fDeleteTextures;
+ GLPtr<GrGLDeleteVertexArraysProc> fDeleteVertexArrays;
+ GLPtr<GrGLDepthMaskProc> fDepthMask;
+ GLPtr<GrGLDisableProc> fDisable;
+ GLPtr<GrGLDisableClientStateProc> fDisableClientState;
+ GLPtr<GrGLDisableVertexAttribArrayProc> fDisableVertexAttribArray;
+ GLPtr<GrGLDrawArraysProc> fDrawArrays;
+ GLPtr<GrGLDrawBufferProc> fDrawBuffer;
+ GLPtr<GrGLDrawBuffersProc> fDrawBuffers;
+ GLPtr<GrGLDrawElementsProc> fDrawElements;
+ GLPtr<GrGLEnableProc> fEnable;
+ GLPtr<GrGLEnableClientStateProc> fEnableClientState;
+ GLPtr<GrGLEnableVertexAttribArrayProc> fEnableVertexAttribArray;
+ GLPtr<GrGLEndQueryProc> fEndQuery;
+ GLPtr<GrGLFinishProc> fFinish;
+ GLPtr<GrGLFlushProc> fFlush;
+ GLPtr<GrGLFramebufferRenderbufferProc> fFramebufferRenderbuffer;
+ GLPtr<GrGLFramebufferTexture2DProc> fFramebufferTexture2D;
+ GLPtr<GrGLFramebufferTexture2DMultisampleProc> fFramebufferTexture2DMultisample;
+ GLPtr<GrGLFrontFaceProc> fFrontFace;
+ GLPtr<GrGLGenBuffersProc> fGenBuffers;
+ GLPtr<GrGLGenFramebuffersProc> fGenFramebuffers;
+ GLPtr<GrGLGenerateMipmapProc> fGenerateMipmap;
+ GLPtr<GrGLGenQueriesProc> fGenQueries;
+ GLPtr<GrGLGenRenderbuffersProc> fGenRenderbuffers;
+ GLPtr<GrGLGenTexturesProc> fGenTextures;
+ GLPtr<GrGLGenVertexArraysProc> fGenVertexArrays;
+ GLPtr<GrGLGetBufferParameterivProc> fGetBufferParameteriv;
+ GLPtr<GrGLGetErrorProc> fGetError;
+ GLPtr<GrGLGetFramebufferAttachmentParameterivProc> fGetFramebufferAttachmentParameteriv;
+ GLPtr<GrGLGetIntegervProc> fGetIntegerv;
+ GLPtr<GrGLGetQueryObjecti64vProc> fGetQueryObjecti64v;
+ GLPtr<GrGLGetQueryObjectivProc> fGetQueryObjectiv;
+ GLPtr<GrGLGetQueryObjectui64vProc> fGetQueryObjectui64v;
+ GLPtr<GrGLGetQueryObjectuivProc> fGetQueryObjectuiv;
+ GLPtr<GrGLGetQueryivProc> fGetQueryiv;
+ GLPtr<GrGLGetProgramInfoLogProc> fGetProgramInfoLog;
+ GLPtr<GrGLGetProgramivProc> fGetProgramiv;
+ GLPtr<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv;
+ GLPtr<GrGLGetShaderInfoLogProc> fGetShaderInfoLog;
+ GLPtr<GrGLGetShaderivProc> fGetShaderiv;
+ GLPtr<GrGLGetStringProc> fGetString;
+ GLPtr<GrGLGetStringiProc> fGetStringi;
+ GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
+ GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation;
+ GLPtr<GrGLLineWidthProc> fLineWidth;
+ GLPtr<GrGLLinkProgramProc> fLinkProgram;
+ GLPtr<GrGLLoadIdentityProc> fLoadIdentity;
+ GLPtr<GrGLLoadMatrixfProc> fLoadMatrixf;
+ GLPtr<GrGLMapBufferProc> fMapBuffer;
+ GLPtr<GrGLMatrixModeProc> fMatrixMode;
+ GLPtr<GrGLPixelStoreiProc> fPixelStorei;
+ GLPtr<GrGLQueryCounterProc> fQueryCounter;
+ GLPtr<GrGLReadBufferProc> fReadBuffer;
+ GLPtr<GrGLReadPixelsProc> fReadPixels;
+ GLPtr<GrGLRenderbufferStorageProc> 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
+ // older extensions for performance reasons or due to ES3 driver bugs. We want the function
+ // that creates the GrGLInterface to provide all available functions and internally
+ // we will select among them. They all have a method called glRenderbufferStorageMultisample*.
+ // So we have separate function pointers for GL_IMG/EXT_multisampled_to_texture,
+ // GL_CHROMIUM/ANGLE_framebuffer_multisample/ES3, and GL_APPLE_framebuffer_multisample
+ // variations.
+ //
+ // If a driver supports multiple GL_ARB_framebuffer_multisample-style extensions then we will
+ // assume the function pointers for the standard (or equivalent GL_ARB) version have
+ // been preferred over GL_EXT, GL_CHROMIUM, or GL_ANGLE variations that have reduced
+ // functionality.
+
+ // GL_EXT_multisampled_render_to_texture (preferred) or GL_IMG_multisampled_render_to_texture
+ GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2EXT;
+ // GL_APPLE_framebuffer_multisample
+ GLPtr<GrGLRenderbufferStorageMultisampleProc> 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+.
+ GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample;
+
+ // Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension.
+ GLPtr<GrGLBindUniformLocation> fBindUniformLocation;
+
+ GLPtr<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer;
+ GLPtr<GrGLScissorProc> fScissor;
+ GLPtr<GrGLShaderSourceProc> fShaderSource;
+ GLPtr<GrGLStencilFuncProc> fStencilFunc;
+ GLPtr<GrGLStencilFuncSeparateProc> fStencilFuncSeparate;
+ GLPtr<GrGLStencilMaskProc> fStencilMask;
+ GLPtr<GrGLStencilMaskSeparateProc> fStencilMaskSeparate;
+ GLPtr<GrGLStencilOpProc> fStencilOp;
+ GLPtr<GrGLStencilOpSeparateProc> fStencilOpSeparate;
+ GLPtr<GrGLTexGenfProc> fTexGenf;
+ GLPtr<GrGLTexGenfvProc> fTexGenfv;
+ GLPtr<GrGLTexGeniProc> fTexGeni;
+ GLPtr<GrGLTexImage2DProc> fTexImage2D;
+ GLPtr<GrGLTexParameteriProc> fTexParameteri;
+ GLPtr<GrGLTexParameterivProc> fTexParameteriv;
+ GLPtr<GrGLTexSubImage2DProc> fTexSubImage2D;
+ GLPtr<GrGLTexStorage2DProc> fTexStorage2D;
+ GLPtr<GrGLDiscardFramebufferProc> fDiscardFramebuffer;
+ GLPtr<GrGLUniform1fProc> fUniform1f;
+ GLPtr<GrGLUniform1iProc> fUniform1i;
+ GLPtr<GrGLUniform1fvProc> fUniform1fv;
+ GLPtr<GrGLUniform1ivProc> fUniform1iv;
+ GLPtr<GrGLUniform2fProc> fUniform2f;
+ GLPtr<GrGLUniform2iProc> fUniform2i;
+ GLPtr<GrGLUniform2fvProc> fUniform2fv;
+ GLPtr<GrGLUniform2ivProc> fUniform2iv;
+ GLPtr<GrGLUniform3fProc> fUniform3f;
+ GLPtr<GrGLUniform3iProc> fUniform3i;
+ GLPtr<GrGLUniform3fvProc> fUniform3fv;
+ GLPtr<GrGLUniform3ivProc> fUniform3iv;
+ GLPtr<GrGLUniform4fProc> fUniform4f;
+ GLPtr<GrGLUniform4iProc> fUniform4i;
+ GLPtr<GrGLUniform4fvProc> fUniform4fv;
+ GLPtr<GrGLUniform4ivProc> fUniform4iv;
+ GLPtr<GrGLUniformMatrix2fvProc> fUniformMatrix2fv;
+ GLPtr<GrGLUniformMatrix3fvProc> fUniformMatrix3fv;
+ GLPtr<GrGLUniformMatrix4fvProc> fUniformMatrix4fv;
+ GLPtr<GrGLUnmapBufferProc> fUnmapBuffer;
+ GLPtr<GrGLUseProgramProc> fUseProgram;
+ GLPtr<GrGLVertexAttrib4fvProc> fVertexAttrib4fv;
+ GLPtr<GrGLVertexAttribPointerProc> fVertexAttribPointer;
+ GLPtr<GrGLVertexPointerProc> fVertexPointer;
+ GLPtr<GrGLViewportProc> 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<GrGLPathCommandsProc> fPathCommands;
+ GLPtr<GrGLPathCoordsProc> fPathCoords;
+ GLPtr<GrGLPathSubCommandsProc> fPathSubCommands;
+ GLPtr<GrGLPathSubCoordsProc> fPathSubCoords;
+ GLPtr<GrGLPathStringProc> fPathString;
+ GLPtr<GrGLPathGlyphsProc> fPathGlyphs;
+ GLPtr<GrGLPathGlyphRangeProc> fPathGlyphRange;
+ GLPtr<GrGLWeightPathsProc> fWeightPaths;
+ GLPtr<GrGLCopyPathProc> fCopyPath;
+ GLPtr<GrGLInterpolatePathsProc> fInterpolatePaths;
+ GLPtr<GrGLTransformPathProc> fTransformPath;
+ GLPtr<GrGLPathParameterivProc> fPathParameteriv;
+ GLPtr<GrGLPathParameteriProc> fPathParameteri;
+ GLPtr<GrGLPathParameterfvProc> fPathParameterfv;
+ GLPtr<GrGLPathParameterfProc> fPathParameterf;
+ GLPtr<GrGLPathDashArrayProc> fPathDashArray;
+ GLPtr<GrGLGenPathsProc> fGenPaths;
+ GLPtr<GrGLDeletePathsProc> fDeletePaths;
+ GLPtr<GrGLIsPathProc> fIsPath;
+ GLPtr<GrGLPathStencilFuncProc> fPathStencilFunc;
+ GLPtr<GrGLPathStencilDepthOffsetProc> fPathStencilDepthOffset;
+ GLPtr<GrGLStencilFillPathProc> fStencilFillPath;
+ GLPtr<GrGLStencilStrokePathProc> fStencilStrokePath;
+ GLPtr<GrGLStencilFillPathInstancedProc> fStencilFillPathInstanced;
+ GLPtr<GrGLStencilStrokePathInstancedProc> fStencilStrokePathInstanced;
+ GLPtr<GrGLPathCoverDepthFuncProc> fPathCoverDepthFunc;
+ GLPtr<GrGLPathColorGenProc> fPathColorGen;
+ GLPtr<GrGLPathTexGenProc> fPathTexGen;
+ GLPtr<GrGLPathFogGenProc> fPathFogGen;
+ GLPtr<GrGLCoverFillPathProc> fCoverFillPath;
+ GLPtr<GrGLCoverStrokePathProc> fCoverStrokePath;
+ GLPtr<GrGLCoverFillPathInstancedProc> fCoverFillPathInstanced;
+ GLPtr<GrGLCoverStrokePathInstancedProc> fCoverStrokePathInstanced;
+ GLPtr<GrGLGetPathParameterivProc> fGetPathParameteriv;
+ GLPtr<GrGLGetPathParameterfvProc> fGetPathParameterfv;
+ GLPtr<GrGLGetPathCommandsProc> fGetPathCommands;
+ GLPtr<GrGLGetPathCoordsProc> fGetPathCoords;
+ GLPtr<GrGLGetPathDashArrayProc> fGetPathDashArray;
+ GLPtr<GrGLGetPathMetricsProc> fGetPathMetrics;
+ GLPtr<GrGLGetPathMetricRangeProc> fGetPathMetricRange;
+ GLPtr<GrGLGetPathSpacingProc> fGetPathSpacing;
+ GLPtr<GrGLGetPathColorGenivProc> fGetPathColorGeniv;
+ GLPtr<GrGLGetPathColorGenfvProc> fGetPathColorGenfv;
+ GLPtr<GrGLGetPathTexGenivProc> fGetPathTexGeniv;
+ GLPtr<GrGLGetPathTexGenfvProc> fGetPathTexGenfv;
+ GLPtr<GrGLIsPointInFillPathProc> fIsPointInFillPath;
+ GLPtr<GrGLIsPointInStrokePathProc> fIsPointInStrokePath;
+ GLPtr<GrGLGetPathLengthProc> fGetPathLength;
+ GLPtr<GrGLPointAlongPathProc> fPointAlongPath;
+ } fFunctions;
+
+
+ // Temporary workaround aliases to keep Chromium GrGLInterface factories compiling until they
+ // assign the members of fFunctions.
+ GLPtrAlias<GrGLActiveTextureProc> fActiveTexture;
+ GLPtrAlias<GrGLAttachShaderProc> fAttachShader;
+ GLPtrAlias<GrGLBeginQueryProc> fBeginQuery;
+ GLPtrAlias<GrGLBindAttribLocationProc> fBindAttribLocation;
+ GLPtrAlias<GrGLBindBufferProc> fBindBuffer;
+ GLPtrAlias<GrGLBindFragDataLocationProc> fBindFragDataLocation;
+ GLPtrAlias<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed;
+ GLPtrAlias<GrGLBindFramebufferProc> fBindFramebuffer;
+ GLPtrAlias<GrGLBindRenderbufferProc> fBindRenderbuffer;
+ GLPtrAlias<GrGLBindTextureProc> fBindTexture;
+ GLPtrAlias<GrGLBindVertexArrayProc> fBindVertexArray;
+ GLPtrAlias<GrGLBlendColorProc> fBlendColor;
+ GLPtrAlias<GrGLBlendFuncProc> fBlendFunc;
+ GLPtrAlias<GrGLBlitFramebufferProc> fBlitFramebuffer;
+ GLPtrAlias<GrGLBufferDataProc> fBufferData;
+ GLPtrAlias<GrGLBufferSubDataProc> fBufferSubData;
+ GLPtrAlias<GrGLCheckFramebufferStatusProc> fCheckFramebufferStatus;
+ GLPtrAlias<GrGLClearProc> fClear;
+ GLPtrAlias<GrGLClearColorProc> fClearColor;
+ GLPtrAlias<GrGLClearStencilProc> fClearStencil;
+ GLPtrAlias<GrGLClientActiveTextureProc> fClientActiveTexture;
+ GLPtrAlias<GrGLColorMaskProc> fColorMask;
+ GLPtrAlias<GrGLCompileShaderProc> fCompileShader;
+ GLPtrAlias<GrGLCompressedTexImage2DProc> fCompressedTexImage2D;
+ GLPtrAlias<GrGLCopyTexSubImage2DProc> fCopyTexSubImage2D;
+ GLPtrAlias<GrGLCreateProgramProc> fCreateProgram;
+ GLPtrAlias<GrGLCreateShaderProc> fCreateShader;
+ GLPtrAlias<GrGLCullFaceProc> fCullFace;
+ GLPtrAlias<GrGLDeleteBuffersProc> fDeleteBuffers;
+ GLPtrAlias<GrGLDeleteFramebuffersProc> fDeleteFramebuffers;
+ GLPtrAlias<GrGLDeleteProgramProc> fDeleteProgram;
+ GLPtrAlias<GrGLDeleteQueriesProc> fDeleteQueries;
+ GLPtrAlias<GrGLDeleteRenderbuffersProc> fDeleteRenderbuffers;
+ GLPtrAlias<GrGLDeleteShaderProc> fDeleteShader;
+ GLPtrAlias<GrGLDeleteTexturesProc> fDeleteTextures;
+ GLPtrAlias<GrGLDeleteVertexArraysProc> fDeleteVertexArrays;
+ GLPtrAlias<GrGLDepthMaskProc> fDepthMask;
+ GLPtrAlias<GrGLDisableProc> fDisable;
+ GLPtrAlias<GrGLDisableClientStateProc> fDisableClientState;
+ GLPtrAlias<GrGLDisableVertexAttribArrayProc> fDisableVertexAttribArray;
+ GLPtrAlias<GrGLDrawArraysProc> fDrawArrays;
+ GLPtrAlias<GrGLDrawBufferProc> fDrawBuffer;
+ GLPtrAlias<GrGLDrawBuffersProc> fDrawBuffers;
+ GLPtrAlias<GrGLDrawElementsProc> fDrawElements;
+ GLPtrAlias<GrGLEnableProc> fEnable;
+ GLPtrAlias<GrGLEnableClientStateProc> fEnableClientState;
+ GLPtrAlias<GrGLEnableVertexAttribArrayProc> fEnableVertexAttribArray;
+ GLPtrAlias<GrGLEndQueryProc> fEndQuery;
+ GLPtrAlias<GrGLFinishProc> fFinish;
+ GLPtrAlias<GrGLFlushProc> fFlush;
+ GLPtrAlias<GrGLFramebufferRenderbufferProc> fFramebufferRenderbuffer;
+ GLPtrAlias<GrGLFramebufferTexture2DProc> fFramebufferTexture2D;
+ GLPtrAlias<GrGLFramebufferTexture2DMultisampleProc> fFramebufferTexture2DMultisample;
+ GLPtrAlias<GrGLFrontFaceProc> fFrontFace;
+ GLPtrAlias<GrGLGenBuffersProc> fGenBuffers;
+ GLPtrAlias<GrGLGenFramebuffersProc> fGenFramebuffers;
+ GLPtrAlias<GrGLGenerateMipmapProc> fGenerateMipmap;
+ GLPtrAlias<GrGLGenQueriesProc> fGenQueries;
+ GLPtrAlias<GrGLGenRenderbuffersProc> fGenRenderbuffers;
+ GLPtrAlias<GrGLGenTexturesProc> fGenTextures;
+ GLPtrAlias<GrGLGenVertexArraysProc> fGenVertexArrays;
+ GLPtrAlias<GrGLGetBufferParameterivProc> fGetBufferParameteriv;
+ GLPtrAlias<GrGLGetErrorProc> fGetError;
+ GLPtrAlias<GrGLGetFramebufferAttachmentParameterivProc> fGetFramebufferAttachmentParameteriv;
+ GLPtrAlias<GrGLGetIntegervProc> fGetIntegerv;
+ GLPtrAlias<GrGLGetQueryObjecti64vProc> fGetQueryObjecti64v;
+ GLPtrAlias<GrGLGetQueryObjectivProc> fGetQueryObjectiv;
+ GLPtrAlias<GrGLGetQueryObjectui64vProc> fGetQueryObjectui64v;
+ GLPtrAlias<GrGLGetQueryObjectuivProc> fGetQueryObjectuiv;
+ GLPtrAlias<GrGLGetQueryivProc> fGetQueryiv;
+ GLPtrAlias<GrGLGetProgramInfoLogProc> fGetProgramInfoLog;
+ GLPtrAlias<GrGLGetProgramivProc> fGetProgramiv;
+ GLPtrAlias<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv;
+ GLPtrAlias<GrGLGetShaderInfoLogProc> fGetShaderInfoLog;
+ GLPtrAlias<GrGLGetShaderivProc> fGetShaderiv;
+ GLPtrAlias<GrGLGetStringProc> fGetString;
+ GLPtrAlias<GrGLGetStringiProc> fGetStringi;
+ GLPtrAlias<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
+ GLPtrAlias<GrGLGetUniformLocationProc> fGetUniformLocation;
+ GLPtrAlias<GrGLLineWidthProc> fLineWidth;
+ GLPtrAlias<GrGLLinkProgramProc> fLinkProgram;
+ GLPtrAlias<GrGLLoadIdentityProc> fLoadIdentity;
+ GLPtrAlias<GrGLLoadMatrixfProc> fLoadMatrixf;
+ GLPtrAlias<GrGLMapBufferProc> fMapBuffer;
+ GLPtrAlias<GrGLMatrixModeProc> fMatrixMode;
+ GLPtrAlias<GrGLPixelStoreiProc> fPixelStorei;
+ GLPtrAlias<GrGLQueryCounterProc> fQueryCounter;
+ GLPtrAlias<GrGLReadBufferProc> fReadBuffer;
+ GLPtrAlias<GrGLReadPixelsProc> fReadPixels;
+ GLPtrAlias<GrGLRenderbufferStorageProc> fRenderbufferStorage;
+ GLPtrAlias<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2EXT;
+ GLPtrAlias<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2APPLE;
+ GLPtrAlias<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample;
+ GLPtrAlias<GrGLBindUniformLocation> fBindUniformLocation;
+ GLPtrAlias<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer;
+ GLPtrAlias<GrGLScissorProc> fScissor;
+ GLPtrAlias<GrGLShaderSourceProc> fShaderSource;
+ GLPtrAlias<GrGLStencilFuncProc> fStencilFunc;
+ GLPtrAlias<GrGLStencilFuncSeparateProc> fStencilFuncSeparate;
+ GLPtrAlias<GrGLStencilMaskProc> fStencilMask;
+ GLPtrAlias<GrGLStencilMaskSeparateProc> fStencilMaskSeparate;
+ GLPtrAlias<GrGLStencilOpProc> fStencilOp;
+ GLPtrAlias<GrGLStencilOpSeparateProc> fStencilOpSeparate;
+ GLPtrAlias<GrGLTexGenfProc> fTexGenf;
+ GLPtrAlias<GrGLTexGenfvProc> fTexGenfv;
+ GLPtrAlias<GrGLTexGeniProc> fTexGeni;
+ GLPtrAlias<GrGLTexImage2DProc> fTexImage2D;
+ GLPtrAlias<GrGLTexParameteriProc> fTexParameteri;
+ GLPtrAlias<GrGLTexParameterivProc> fTexParameteriv;
+ GLPtrAlias<GrGLTexSubImage2DProc> fTexSubImage2D;
+ GLPtrAlias<GrGLTexStorage2DProc> fTexStorage2D;
+ GLPtrAlias<GrGLDiscardFramebufferProc> fDiscardFramebuffer;
+ GLPtrAlias<GrGLUniform1fProc> fUniform1f;
+ GLPtrAlias<GrGLUniform1iProc> fUniform1i;
+ GLPtrAlias<GrGLUniform1fvProc> fUniform1fv;
+ GLPtrAlias<GrGLUniform1ivProc> fUniform1iv;
+ GLPtrAlias<GrGLUniform2fProc> fUniform2f;
+ GLPtrAlias<GrGLUniform2iProc> fUniform2i;
+ GLPtrAlias<GrGLUniform2fvProc> fUniform2fv;
+ GLPtrAlias<GrGLUniform2ivProc> fUniform2iv;
+ GLPtrAlias<GrGLUniform3fProc> fUniform3f;
+ GLPtrAlias<GrGLUniform3iProc> fUniform3i;
+ GLPtrAlias<GrGLUniform3fvProc> fUniform3fv;
+ GLPtrAlias<GrGLUniform3ivProc> fUniform3iv;
+ GLPtrAlias<GrGLUniform4fProc> fUniform4f;
+ GLPtrAlias<GrGLUniform4iProc> fUniform4i;
+ GLPtrAlias<GrGLUniform4fvProc> fUniform4fv;
+ GLPtrAlias<GrGLUniform4ivProc> fUniform4iv;
+ GLPtrAlias<GrGLUniformMatrix2fvProc> fUniformMatrix2fv;
+ GLPtrAlias<GrGLUniformMatrix3fvProc> fUniformMatrix3fv;
+ GLPtrAlias<GrGLUniformMatrix4fvProc> fUniformMatrix4fv;
+ GLPtrAlias<GrGLUnmapBufferProc> fUnmapBuffer;
+ GLPtrAlias<GrGLUseProgramProc> fUseProgram;
+ GLPtrAlias<GrGLVertexAttrib4fvProc> fVertexAttrib4fv;
+ GLPtrAlias<GrGLVertexAttribPointerProc> fVertexAttribPointer;
+ GLPtrAlias<GrGLVertexPointerProc> fVertexPointer;
+ GLPtrAlias<GrGLViewportProc> fViewport;
+ GLPtrAlias<GrGLPathCommandsProc> fPathCommands;
+ GLPtrAlias<GrGLPathCoordsProc> fPathCoords;
+ GLPtrAlias<GrGLPathSubCommandsProc> fPathSubCommands;
+ GLPtrAlias<GrGLPathSubCoordsProc> fPathSubCoords;
+ GLPtrAlias<GrGLPathStringProc> fPathString;
+ GLPtrAlias<GrGLPathGlyphsProc> fPathGlyphs;
+ GLPtrAlias<GrGLPathGlyphRangeProc> fPathGlyphRange;
+ GLPtrAlias<GrGLWeightPathsProc> fWeightPaths;
+ GLPtrAlias<GrGLCopyPathProc> fCopyPath;
+ GLPtrAlias<GrGLInterpolatePathsProc> fInterpolatePaths;
+ GLPtrAlias<GrGLTransformPathProc> fTransformPath;
+ GLPtrAlias<GrGLPathParameterivProc> fPathParameteriv;
+ GLPtrAlias<GrGLPathParameteriProc> fPathParameteri;
+ GLPtrAlias<GrGLPathParameterfvProc> fPathParameterfv;
+ GLPtrAlias<GrGLPathParameterfProc> fPathParameterf;
+ GLPtrAlias<GrGLPathDashArrayProc> fPathDashArray;
+ GLPtrAlias<GrGLGenPathsProc> fGenPaths;
+ GLPtrAlias<GrGLDeletePathsProc> fDeletePaths;
+ GLPtrAlias<GrGLIsPathProc> fIsPath;
+ GLPtrAlias<GrGLPathStencilFuncProc> fPathStencilFunc;
+ GLPtrAlias<GrGLPathStencilDepthOffsetProc> fPathStencilDepthOffset;
+ GLPtrAlias<GrGLStencilFillPathProc> fStencilFillPath;
+ GLPtrAlias<GrGLStencilStrokePathProc> fStencilStrokePath;
+ GLPtrAlias<GrGLStencilFillPathInstancedProc> fStencilFillPathInstanced;
+ GLPtrAlias<GrGLStencilStrokePathInstancedProc> fStencilStrokePathInstanced;
+ GLPtrAlias<GrGLPathCoverDepthFuncProc> fPathCoverDepthFunc;
+ GLPtrAlias<GrGLPathColorGenProc> fPathColorGen;
+ GLPtrAlias<GrGLPathTexGenProc> fPathTexGen;
+ GLPtrAlias<GrGLPathFogGenProc> fPathFogGen;
+ GLPtrAlias<GrGLCoverFillPathProc> fCoverFillPath;
+ GLPtrAlias<GrGLCoverStrokePathProc> fCoverStrokePath;
+ GLPtrAlias<GrGLCoverFillPathInstancedProc> fCoverFillPathInstanced;
+ GLPtrAlias<GrGLCoverStrokePathInstancedProc> fCoverStrokePathInstanced;
+ GLPtrAlias<GrGLGetPathParameterivProc> fGetPathParameteriv;
+ GLPtrAlias<GrGLGetPathParameterfvProc> fGetPathParameterfv;
+ GLPtrAlias<GrGLGetPathCommandsProc> fGetPathCommands;
+ GLPtrAlias<GrGLGetPathCoordsProc> fGetPathCoords;
+ GLPtrAlias<GrGLGetPathDashArrayProc> fGetPathDashArray;
+ GLPtrAlias<GrGLGetPathMetricsProc> fGetPathMetrics;
+ GLPtrAlias<GrGLGetPathMetricRangeProc> fGetPathMetricRange;
+ GLPtrAlias<GrGLGetPathSpacingProc> fGetPathSpacing;
+ GLPtrAlias<GrGLGetPathColorGenivProc> fGetPathColorGeniv;
+ GLPtrAlias<GrGLGetPathColorGenfvProc> fGetPathColorGenfv;
+ GLPtrAlias<GrGLGetPathTexGenivProc> fGetPathTexGeniv;
+ GLPtrAlias<GrGLGetPathTexGenfvProc> fGetPathTexGenfv;
+ GLPtrAlias<GrGLIsPointInFillPathProc> fIsPointInFillPath;
+ GLPtrAlias<GrGLIsPointInStrokePathProc> fIsPointInStrokePath;
+ GLPtrAlias<GrGLGetPathLengthProc> fGetPathLength;
+ GLPtrAlias<GrGLPointAlongPathProc> fPointAlongPath;
// Per-GL func callback
#if GR_GL_PER_GL_FUNC_CALLBACK
* Helper macros for using the GL context through the GrGLInterface. Example:
* SK_GL(glCtx, GenTextures(1, &texID));
*/
-#define SK_GL(ctx, X) (ctx).gl()->f ## X; \
- SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fGetError())
-#define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->f ## X; \
- SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fGetError())
-#define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->f ## X
-#define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->f ## X
+#define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \
+ SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fFunctions.fGetError())
+#define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \
+ SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fFunctions.fGetError())
+#define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X
+#define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X
#endif
this->reset();
// We haven't validated the GrGLInterface yet, so check for GetString
// function pointer
- if (interface->fGetString) {
+ if (interface->fFunctions.fGetString) {
const GrGLubyte* verUByte;
GR_GL_CALL_RET(interface, verUByte, GetString(GR_GL_VERSION));
const char* ver = reinterpret_cast<const char*>(verUByte);
if (!glInterface.get()) {
GrGLInterface* interface = SkNEW(GrGLInterface);
glInterface.reset(interface);
+
interface->fStandard = kGL_GrGLStandard;
- interface->fActiveTexture = nullGLActiveTexture;
- interface->fAttachShader = nullGLAttachShader;
- interface->fBeginQuery = nullGLBeginQuery;
- interface->fBindAttribLocation = nullGLBindAttribLocation;
- interface->fBindBuffer = nullGLBindBuffer;
- interface->fBindFragDataLocation = noOpGLBindFragDataLocation;
- interface->fBindTexture = nullGLBindTexture;
- interface->fBindVertexArray = nullGLBindVertexArray;
- interface->fBlendColor = noOpGLBlendColor;
- interface->fBlendFunc = noOpGLBlendFunc;
- interface->fBufferData = nullGLBufferData;
- interface->fBufferSubData = noOpGLBufferSubData;
- interface->fClear = noOpGLClear;
- interface->fClearColor = noOpGLClearColor;
- interface->fClearStencil = noOpGLClearStencil;
- interface->fClientActiveTexture = nullGLClientActiveTexture;
- interface->fColorMask = noOpGLColorMask;
- interface->fCompileShader = noOpGLCompileShader;
- interface->fCompressedTexImage2D = noOpGLCompressedTexImage2D;
- interface->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D;
- interface->fCreateProgram = nullGLCreateProgram;
- interface->fCreateShader = nullGLCreateShader;
- interface->fCullFace = noOpGLCullFace;
- interface->fDeleteBuffers = nullGLDeleteBuffers;
- interface->fDeleteProgram = nullGLDelete;
- interface->fDeleteQueries = noOpGLDeleteIds;
- interface->fDeleteShader = nullGLDelete;
- interface->fDeleteTextures = noOpGLDeleteIds;
- interface->fDeleteVertexArrays = noOpGLDeleteIds;
- interface->fDepthMask = noOpGLDepthMask;
- interface->fDisable = noOpGLDisable;
- interface->fDisableClientState = noOpGLDisableClientState;
- interface->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray;
- interface->fDrawArrays = noOpGLDrawArrays;
- interface->fDrawBuffer = noOpGLDrawBuffer;
- interface->fDrawBuffers = noOpGLDrawBuffers;
- interface->fDrawElements = noOpGLDrawElements;
- interface->fEnable = noOpGLEnable;
- interface->fEnableClientState = noOpGLEnableClientState;
- interface->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray;
- interface->fEndQuery = noOpGLEndQuery;
- interface->fFinish = noOpGLFinish;
- interface->fFlush = noOpGLFlush;
- interface->fFrontFace = noOpGLFrontFace;
- interface->fGenBuffers = nullGLGenBuffers;
- interface->fGenerateMipmap = nullGLGenerateMipmap;
- interface->fGenQueries = noOpGLGenIds;
- interface->fGenTextures = noOpGLGenIds;
- interface->fGenVertexArrays = noOpGLGenIds;
- interface->fGetBufferParameteriv = nullGLGetBufferParameteriv;
- interface->fGetError = noOpGLGetError;
- interface->fGetIntegerv = noOpGLGetIntegerv;
- interface->fGetQueryObjecti64v = noOpGLGetQueryObjecti64v;
- interface->fGetQueryObjectiv = noOpGLGetQueryObjectiv;
- interface->fGetQueryObjectui64v = noOpGLGetQueryObjectui64v;
- interface->fGetQueryObjectuiv = noOpGLGetQueryObjectuiv;
- interface->fGetQueryiv = noOpGLGetQueryiv;
- interface->fGetProgramInfoLog = noOpGLGetInfoLog;
- interface->fGetProgramiv = noOpGLGetShaderOrProgramiv;
- interface->fGetShaderInfoLog = noOpGLGetInfoLog;
- interface->fGetShaderiv = noOpGLGetShaderOrProgramiv;
- interface->fGetString = noOpGLGetString;
- interface->fGetStringi = noOpGLGetStringi;
- interface->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv;
- interface->fGetUniformLocation = noOpGLGetUniformLocation;
- interface->fLoadIdentity = noOpGLLoadIdentity;
- interface->fLoadMatrixf = noOpGLLoadMatrixf;
- interface->fLineWidth = noOpGLLineWidth;
- interface->fLinkProgram = noOpGLLinkProgram;
- interface->fMatrixMode = noOpGLMatrixMode;
- interface->fPixelStorei = nullGLPixelStorei;
- interface->fQueryCounter = noOpGLQueryCounter;
- interface->fReadBuffer = noOpGLReadBuffer;
- interface->fReadPixels = nullGLReadPixels;
- interface->fScissor = noOpGLScissor;
- interface->fShaderSource = noOpGLShaderSource;
- interface->fStencilFunc = noOpGLStencilFunc;
- interface->fStencilFuncSeparate = noOpGLStencilFuncSeparate;
- interface->fStencilMask = noOpGLStencilMask;
- interface->fStencilMaskSeparate = noOpGLStencilMaskSeparate;
- interface->fStencilOp = noOpGLStencilOp;
- interface->fStencilOpSeparate = noOpGLStencilOpSeparate;
- interface->fTexGenf = noOpGLTexGenf;
- interface->fTexGenfv = noOpGLTexGenfv;
- interface->fTexGeni = noOpGLTexGeni;
- interface->fTexImage2D = noOpGLTexImage2D;
- interface->fTexParameteri = noOpGLTexParameteri;
- interface->fTexParameteriv = noOpGLTexParameteriv;
- interface->fTexSubImage2D = noOpGLTexSubImage2D;
- interface->fTexStorage2D = noOpGLTexStorage2D;
- interface->fDiscardFramebuffer = noOpGLDiscardFramebuffer;
- interface->fUniform1f = noOpGLUniform1f;
- interface->fUniform1i = noOpGLUniform1i;
- interface->fUniform1fv = noOpGLUniform1fv;
- interface->fUniform1iv = noOpGLUniform1iv;
- interface->fUniform2f = noOpGLUniform2f;
- interface->fUniform2i = noOpGLUniform2i;
- interface->fUniform2fv = noOpGLUniform2fv;
- interface->fUniform2iv = noOpGLUniform2iv;
- interface->fUniform3f = noOpGLUniform3f;
- interface->fUniform3i = noOpGLUniform3i;
- interface->fUniform3fv = noOpGLUniform3fv;
- interface->fUniform3iv = noOpGLUniform3iv;
- interface->fUniform4f = noOpGLUniform4f;
- interface->fUniform4i = noOpGLUniform4i;
- interface->fUniform4fv = noOpGLUniform4fv;
- interface->fUniform4iv = noOpGLUniform4iv;
- interface->fUniformMatrix2fv = noOpGLUniformMatrix2fv;
- interface->fUniformMatrix3fv = noOpGLUniformMatrix3fv;
- interface->fUniformMatrix4fv = noOpGLUniformMatrix4fv;
- interface->fUseProgram = nullGLUseProgram;
- interface->fVertexAttrib4fv = noOpGLVertexAttrib4fv;
- interface->fVertexAttribPointer = noOpGLVertexAttribPointer;
- interface->fVertexPointer = noOpGLVertexPointer;
- interface->fViewport = nullGLViewport;
- interface->fBindFramebuffer = nullGLBindFramebuffer;
- interface->fBindRenderbuffer = nullGLBindRenderbuffer;
- interface->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus;
- interface->fDeleteFramebuffers = nullGLDeleteFramebuffers;
- interface->fDeleteRenderbuffers = nullGLDeleteRenderbuffers;
- interface->fFramebufferRenderbuffer = nullGLFramebufferRenderbuffer;
- interface->fFramebufferTexture2D = nullGLFramebufferTexture2D;
- interface->fGenFramebuffers = noOpGLGenIds;
- interface->fGenRenderbuffers = noOpGLGenIds;
- interface->fGetFramebufferAttachmentParameteriv = noOpGLGetFramebufferAttachmentParameteriv;
- interface->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteriv;
- interface->fRenderbufferStorage = noOpGLRenderbufferStorage;
- interface->fRenderbufferStorageMultisample = noOpGLRenderbufferStorageMultisample;
- interface->fBlitFramebuffer = noOpGLBlitFramebuffer;
- interface->fResolveMultisampleFramebuffer = noOpGLResolveMultisampleFramebuffer;
- interface->fMapBuffer = nullGLMapBuffer;
- interface->fUnmapBuffer = nullGLUnmapBuffer;
- interface->fBindFragDataLocationIndexed = noOpGLBindFragDataLocationIndexed;
+
+ GrGLInterface::Functions* functions = &interface->fFunctions;
+ functions->fActiveTexture = nullGLActiveTexture;
+ functions->fAttachShader = nullGLAttachShader;
+ functions->fBeginQuery = nullGLBeginQuery;
+ functions->fBindAttribLocation = nullGLBindAttribLocation;
+ functions->fBindBuffer = nullGLBindBuffer;
+ functions->fBindFragDataLocation = noOpGLBindFragDataLocation;
+ functions->fBindTexture = nullGLBindTexture;
+ functions->fBindVertexArray = nullGLBindVertexArray;
+ functions->fBlendColor = noOpGLBlendColor;
+ functions->fBlendFunc = noOpGLBlendFunc;
+ functions->fBufferData = nullGLBufferData;
+ functions->fBufferSubData = noOpGLBufferSubData;
+ functions->fClear = noOpGLClear;
+ functions->fClearColor = noOpGLClearColor;
+ functions->fClearStencil = noOpGLClearStencil;
+ functions->fClientActiveTexture = nullGLClientActiveTexture;
+ functions->fColorMask = noOpGLColorMask;
+ functions->fCompileShader = noOpGLCompileShader;
+ functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D;
+ functions->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D;
+ functions->fCreateProgram = nullGLCreateProgram;
+ functions->fCreateShader = nullGLCreateShader;
+ functions->fCullFace = noOpGLCullFace;
+ functions->fDeleteBuffers = nullGLDeleteBuffers;
+ functions->fDeleteProgram = nullGLDelete;
+ functions->fDeleteQueries = noOpGLDeleteIds;
+ functions->fDeleteShader = nullGLDelete;
+ functions->fDeleteTextures = noOpGLDeleteIds;
+ functions->fDeleteVertexArrays = noOpGLDeleteIds;
+ functions->fDepthMask = noOpGLDepthMask;
+ functions->fDisable = noOpGLDisable;
+ functions->fDisableClientState = noOpGLDisableClientState;
+ functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray;
+ functions->fDrawArrays = noOpGLDrawArrays;
+ functions->fDrawBuffer = noOpGLDrawBuffer;
+ functions->fDrawBuffers = noOpGLDrawBuffers;
+ functions->fDrawElements = noOpGLDrawElements;
+ functions->fEnable = noOpGLEnable;
+ functions->fEnableClientState = noOpGLEnableClientState;
+ functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray;
+ functions->fEndQuery = noOpGLEndQuery;
+ functions->fFinish = noOpGLFinish;
+ functions->fFlush = noOpGLFlush;
+ functions->fFrontFace = noOpGLFrontFace;
+ functions->fGenBuffers = nullGLGenBuffers;
+ functions->fGenerateMipmap = nullGLGenerateMipmap;
+ functions->fGenQueries = noOpGLGenIds;
+ functions->fGenTextures = noOpGLGenIds;
+ functions->fGenVertexArrays = noOpGLGenIds;
+ functions->fGetBufferParameteriv = nullGLGetBufferParameteriv;
+ functions->fGetError = noOpGLGetError;
+ functions->fGetIntegerv = noOpGLGetIntegerv;
+ functions->fGetQueryObjecti64v = noOpGLGetQueryObjecti64v;
+ functions->fGetQueryObjectiv = noOpGLGetQueryObjectiv;
+ functions->fGetQueryObjectui64v = noOpGLGetQueryObjectui64v;
+ functions->fGetQueryObjectuiv = noOpGLGetQueryObjectuiv;
+ functions->fGetQueryiv = noOpGLGetQueryiv;
+ functions->fGetProgramInfoLog = noOpGLGetInfoLog;
+ functions->fGetProgramiv = noOpGLGetShaderOrProgramiv;
+ functions->fGetShaderInfoLog = noOpGLGetInfoLog;
+ functions->fGetShaderiv = noOpGLGetShaderOrProgramiv;
+ functions->fGetString = noOpGLGetString;
+ functions->fGetStringi = noOpGLGetStringi;
+ functions->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv;
+ functions->fGetUniformLocation = noOpGLGetUniformLocation;
+ functions->fLoadIdentity = noOpGLLoadIdentity;
+ functions->fLoadMatrixf = noOpGLLoadMatrixf;
+ functions->fLineWidth = noOpGLLineWidth;
+ functions->fLinkProgram = noOpGLLinkProgram;
+ functions->fMatrixMode = noOpGLMatrixMode;
+ functions->fPixelStorei = nullGLPixelStorei;
+ functions->fQueryCounter = noOpGLQueryCounter;
+ functions->fReadBuffer = noOpGLReadBuffer;
+ functions->fReadPixels = nullGLReadPixels;
+ functions->fScissor = noOpGLScissor;
+ functions->fShaderSource = noOpGLShaderSource;
+ functions->fStencilFunc = noOpGLStencilFunc;
+ functions->fStencilFuncSeparate = noOpGLStencilFuncSeparate;
+ functions->fStencilMask = noOpGLStencilMask;
+ functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate;
+ functions->fStencilOp = noOpGLStencilOp;
+ functions->fStencilOpSeparate = noOpGLStencilOpSeparate;
+ functions->fTexGenf = noOpGLTexGenf;
+ functions->fTexGenfv = noOpGLTexGenfv;
+ functions->fTexGeni = noOpGLTexGeni;
+ functions->fTexImage2D = noOpGLTexImage2D;
+ functions->fTexParameteri = noOpGLTexParameteri;
+ functions->fTexParameteriv = noOpGLTexParameteriv;
+ functions->fTexSubImage2D = noOpGLTexSubImage2D;
+ functions->fTexStorage2D = noOpGLTexStorage2D;
+ functions->fDiscardFramebuffer = noOpGLDiscardFramebuffer;
+ functions->fUniform1f = noOpGLUniform1f;
+ functions->fUniform1i = noOpGLUniform1i;
+ functions->fUniform1fv = noOpGLUniform1fv;
+ functions->fUniform1iv = noOpGLUniform1iv;
+ functions->fUniform2f = noOpGLUniform2f;
+ functions->fUniform2i = noOpGLUniform2i;
+ functions->fUniform2fv = noOpGLUniform2fv;
+ functions->fUniform2iv = noOpGLUniform2iv;
+ functions->fUniform3f = noOpGLUniform3f;
+ functions->fUniform3i = noOpGLUniform3i;
+ functions->fUniform3fv = noOpGLUniform3fv;
+ functions->fUniform3iv = noOpGLUniform3iv;
+ functions->fUniform4f = noOpGLUniform4f;
+ functions->fUniform4i = noOpGLUniform4i;
+ functions->fUniform4fv = noOpGLUniform4fv;
+ functions->fUniform4iv = noOpGLUniform4iv;
+ functions->fUniformMatrix2fv = noOpGLUniformMatrix2fv;
+ functions->fUniformMatrix3fv = noOpGLUniformMatrix3fv;
+ functions->fUniformMatrix4fv = noOpGLUniformMatrix4fv;
+ functions->fUseProgram = nullGLUseProgram;
+ functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv;
+ functions->fVertexAttribPointer = noOpGLVertexAttribPointer;
+ functions->fVertexPointer = noOpGLVertexPointer;
+ functions->fViewport = nullGLViewport;
+ functions->fBindFramebuffer = nullGLBindFramebuffer;
+ functions->fBindRenderbuffer = nullGLBindRenderbuffer;
+ functions->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus;
+ functions->fDeleteFramebuffers = nullGLDeleteFramebuffers;
+ functions->fDeleteRenderbuffers = nullGLDeleteRenderbuffers;
+ functions->fFramebufferRenderbuffer = nullGLFramebufferRenderbuffer;
+ functions->fFramebufferTexture2D = nullGLFramebufferTexture2D;
+ functions->fGenFramebuffers = noOpGLGenIds;
+ functions->fGenRenderbuffers = noOpGLGenIds;
+ functions->fGetFramebufferAttachmentParameteriv = noOpGLGetFramebufferAttachmentParameteriv;
+ functions->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteriv;
+ functions->fRenderbufferStorage = noOpGLRenderbufferStorage;
+ functions->fRenderbufferStorageMultisample = noOpGLRenderbufferStorageMultisample;
+ functions->fBlitFramebuffer = noOpGLBlitFramebuffer;
+ functions->fResolveMultisampleFramebuffer = noOpGLResolveMultisampleFramebuffer;
+ functions->fMapBuffer = nullGLMapBuffer;
+ functions->fUnmapBuffer = nullGLUnmapBuffer;
+ functions->fBindFragDataLocationIndexed = noOpGLBindFragDataLocationIndexed;
}
glInterface.get()->ref();
return glInterface.get();
}
#endif
-GrGLInterface::GrGLInterface() {
+GrGLInterface::GrGLInterface()
+ // TODO: Remove this madness ASAP.
+ : fActiveTexture(&fFunctions.fActiveTexture)
+ , fAttachShader(&fFunctions.fAttachShader)
+ , fBeginQuery(&fFunctions.fBeginQuery)
+ , fBindAttribLocation(&fFunctions.fBindAttribLocation)
+ , fBindBuffer(&fFunctions.fBindBuffer)
+ , fBindFragDataLocation(&fFunctions.fBindFragDataLocation)
+ , fBindFragDataLocationIndexed(&fFunctions.fBindFragDataLocationIndexed)
+ , fBindFramebuffer(&fFunctions.fBindFramebuffer)
+ , fBindRenderbuffer(&fFunctions.fBindRenderbuffer)
+ , fBindTexture(&fFunctions.fBindTexture)
+ , fBindVertexArray(&fFunctions.fBindVertexArray)
+ , fBlendColor(&fFunctions.fBlendColor)
+ , fBlendFunc(&fFunctions.fBlendFunc)
+ , fBlitFramebuffer(&fFunctions.fBlitFramebuffer)
+ , fBufferData(&fFunctions.fBufferData)
+ , fBufferSubData(&fFunctions.fBufferSubData)
+ , fCheckFramebufferStatus(&fFunctions.fCheckFramebufferStatus)
+ , fClear(&fFunctions.fClear)
+ , fClearColor(&fFunctions.fClearColor)
+ , fClearStencil(&fFunctions.fClearStencil)
+ , fClientActiveTexture(&fFunctions.fClientActiveTexture)
+ , fColorMask(&fFunctions.fColorMask)
+ , fCompileShader(&fFunctions.fCompileShader)
+ , fCompressedTexImage2D(&fFunctions.fCompressedTexImage2D)
+ , fCopyTexSubImage2D(&fFunctions.fCopyTexSubImage2D)
+ , fCreateProgram(&fFunctions.fCreateProgram)
+ , fCreateShader(&fFunctions.fCreateShader)
+ , fCullFace(&fFunctions.fCullFace)
+ , fDeleteBuffers(&fFunctions.fDeleteBuffers)
+ , fDeleteFramebuffers(&fFunctions.fDeleteFramebuffers)
+ , fDeleteProgram(&fFunctions.fDeleteProgram)
+ , fDeleteQueries(&fFunctions.fDeleteQueries)
+ , fDeleteRenderbuffers(&fFunctions.fDeleteRenderbuffers)
+ , fDeleteShader(&fFunctions.fDeleteShader)
+ , fDeleteTextures(&fFunctions.fDeleteTextures)
+ , fDeleteVertexArrays(&fFunctions.fDeleteVertexArrays)
+ , fDepthMask(&fFunctions.fDepthMask)
+ , fDisable(&fFunctions.fDisable)
+ , fDisableClientState(&fFunctions.fDisableClientState)
+ , fDisableVertexAttribArray(&fFunctions.fDisableVertexAttribArray)
+ , fDrawArrays(&fFunctions.fDrawArrays)
+ , fDrawBuffer(&fFunctions.fDrawBuffer)
+ , fDrawBuffers(&fFunctions.fDrawBuffers)
+ , fDrawElements(&fFunctions.fDrawElements)
+ , fEnable(&fFunctions.fEnable)
+ , fEnableClientState(&fFunctions.fEnableClientState)
+ , fEnableVertexAttribArray(&fFunctions.fEnableVertexAttribArray)
+ , fEndQuery(&fFunctions.fEndQuery)
+ , fFinish(&fFunctions.fFinish)
+ , fFlush(&fFunctions.fFlush)
+ , fFramebufferRenderbuffer(&fFunctions.fFramebufferRenderbuffer)
+ , fFramebufferTexture2D(&fFunctions.fFramebufferTexture2D)
+ , fFramebufferTexture2DMultisample(&fFunctions.fFramebufferTexture2DMultisample)
+ , fFrontFace(&fFunctions.fFrontFace)
+ , fGenBuffers(&fFunctions.fGenBuffers)
+ , fGenFramebuffers(&fFunctions.fGenFramebuffers)
+ , fGenerateMipmap(&fFunctions.fGenerateMipmap)
+ , fGenQueries(&fFunctions.fGenQueries)
+ , fGenRenderbuffers(&fFunctions.fGenRenderbuffers)
+ , fGenTextures(&fFunctions.fGenTextures)
+ , fGenVertexArrays(&fFunctions.fGenVertexArrays)
+ , fGetBufferParameteriv(&fFunctions.fGetBufferParameteriv)
+ , fGetError(&fFunctions.fGetError)
+ , fGetFramebufferAttachmentParameteriv(&fFunctions.fGetFramebufferAttachmentParameteriv)
+ , fGetIntegerv(&fFunctions.fGetIntegerv)
+ , fGetQueryObjecti64v(&fFunctions.fGetQueryObjecti64v)
+ , fGetQueryObjectiv(&fFunctions.fGetQueryObjectiv)
+ , fGetQueryObjectui64v(&fFunctions.fGetQueryObjectui64v)
+ , fGetQueryObjectuiv(&fFunctions.fGetQueryObjectuiv)
+ , fGetQueryiv(&fFunctions.fGetQueryiv)
+ , fGetProgramInfoLog(&fFunctions.fGetProgramInfoLog)
+ , fGetProgramiv(&fFunctions.fGetProgramiv)
+ , fGetRenderbufferParameteriv(&fFunctions.fGetRenderbufferParameteriv)
+ , fGetShaderInfoLog(&fFunctions.fGetShaderInfoLog)
+ , fGetShaderiv(&fFunctions.fGetShaderiv)
+ , fGetString(&fFunctions.fGetString)
+ , fGetStringi(&fFunctions.fGetStringi)
+ , fGetTexLevelParameteriv(&fFunctions.fGetTexLevelParameteriv)
+ , fGetUniformLocation(&fFunctions.fGetUniformLocation)
+ , fLineWidth(&fFunctions.fLineWidth)
+ , fLinkProgram(&fFunctions.fLinkProgram)
+ , fLoadIdentity(&fFunctions.fLoadIdentity)
+ , fLoadMatrixf(&fFunctions.fLoadMatrixf)
+ , fMapBuffer(&fFunctions.fMapBuffer)
+ , fMatrixMode(&fFunctions.fMatrixMode)
+ , fPixelStorei(&fFunctions.fPixelStorei)
+ , fQueryCounter(&fFunctions.fQueryCounter)
+ , fReadBuffer(&fFunctions.fReadBuffer)
+ , fReadPixels(&fFunctions.fReadPixels)
+ , fRenderbufferStorage(&fFunctions.fRenderbufferStorage)
+ , fRenderbufferStorageMultisampleES2EXT(&fFunctions.fRenderbufferStorageMultisampleES2EXT)
+ , fRenderbufferStorageMultisampleES2APPLE(&fFunctions.fRenderbufferStorageMultisampleES2APPLE)
+ , fRenderbufferStorageMultisample(&fFunctions.fRenderbufferStorageMultisample)
+ , fBindUniformLocation(&fFunctions.fBindUniformLocation)
+ , fResolveMultisampleFramebuffer(&fFunctions.fResolveMultisampleFramebuffer)
+ , fScissor(&fFunctions.fScissor)
+ , fShaderSource(&fFunctions.fShaderSource)
+ , fStencilFunc(&fFunctions.fStencilFunc)
+ , fStencilFuncSeparate(&fFunctions.fStencilFuncSeparate)
+ , fStencilMask(&fFunctions.fStencilMask)
+ , fStencilMaskSeparate(&fFunctions.fStencilMaskSeparate)
+ , fStencilOp(&fFunctions.fStencilOp)
+ , fStencilOpSeparate(&fFunctions.fStencilOpSeparate)
+ , fTexGenf(&fFunctions.fTexGenf)
+ , fTexGenfv(&fFunctions.fTexGenfv)
+ , fTexGeni(&fFunctions.fTexGeni)
+ , fTexImage2D(&fFunctions.fTexImage2D)
+ , fTexParameteri(&fFunctions.fTexParameteri)
+ , fTexParameteriv(&fFunctions.fTexParameteriv)
+ , fTexSubImage2D(&fFunctions.fTexSubImage2D)
+ , fTexStorage2D(&fFunctions.fTexStorage2D)
+ , fDiscardFramebuffer(&fFunctions.fDiscardFramebuffer)
+ , fUniform1f(&fFunctions.fUniform1f)
+ , fUniform1i(&fFunctions.fUniform1i)
+ , fUniform1fv(&fFunctions.fUniform1fv)
+ , fUniform1iv(&fFunctions.fUniform1iv)
+ , fUniform2f(&fFunctions.fUniform2f)
+ , fUniform2i(&fFunctions.fUniform2i)
+ , fUniform2fv(&fFunctions.fUniform2fv)
+ , fUniform2iv(&fFunctions.fUniform2iv)
+ , fUniform3f(&fFunctions.fUniform3f)
+ , fUniform3i(&fFunctions.fUniform3i)
+ , fUniform3fv(&fFunctions.fUniform3fv)
+ , fUniform3iv(&fFunctions.fUniform3iv)
+ , fUniform4f(&fFunctions.fUniform4f)
+ , fUniform4i(&fFunctions.fUniform4i)
+ , fUniform4fv(&fFunctions.fUniform4fv)
+ , fUniform4iv(&fFunctions.fUniform4iv)
+ , fUniformMatrix2fv(&fFunctions.fUniformMatrix2fv)
+ , fUniformMatrix3fv(&fFunctions.fUniformMatrix3fv)
+ , fUniformMatrix4fv(&fFunctions.fUniformMatrix4fv)
+ , fUnmapBuffer(&fFunctions.fUnmapBuffer)
+ , fUseProgram(&fFunctions.fUseProgram)
+ , fVertexAttrib4fv(&fFunctions.fVertexAttrib4fv)
+ , fVertexAttribPointer(&fFunctions.fVertexAttribPointer)
+ , fVertexPointer(&fFunctions.fVertexPointer)
+ , fViewport(&fFunctions.fViewport)
+ , fPathCommands(&fFunctions.fPathCommands)
+ , fPathCoords(&fFunctions.fPathCoords)
+ , fPathSubCommands(&fFunctions.fPathSubCommands)
+ , fPathSubCoords(&fFunctions.fPathSubCoords)
+ , fPathString(&fFunctions.fPathString)
+ , fPathGlyphs(&fFunctions.fPathGlyphs)
+ , fPathGlyphRange(&fFunctions.fPathGlyphRange)
+ , fWeightPaths(&fFunctions.fWeightPaths)
+ , fCopyPath(&fFunctions.fCopyPath)
+ , fInterpolatePaths(&fFunctions.fInterpolatePaths)
+ , fTransformPath(&fFunctions.fTransformPath)
+ , fPathParameteriv(&fFunctions.fPathParameteriv)
+ , fPathParameteri(&fFunctions.fPathParameteri)
+ , fPathParameterfv(&fFunctions.fPathParameterfv)
+ , fPathParameterf(&fFunctions.fPathParameterf)
+ , fPathDashArray(&fFunctions.fPathDashArray)
+ , fGenPaths(&fFunctions.fGenPaths)
+ , fDeletePaths(&fFunctions.fDeletePaths)
+ , fIsPath(&fFunctions.fIsPath)
+ , fPathStencilFunc(&fFunctions.fPathStencilFunc)
+ , fPathStencilDepthOffset(&fFunctions.fPathStencilDepthOffset)
+ , fStencilFillPath(&fFunctions.fStencilFillPath)
+ , fStencilStrokePath(&fFunctions.fStencilStrokePath)
+ , fStencilFillPathInstanced(&fFunctions.fStencilFillPathInstanced)
+ , fStencilStrokePathInstanced(&fFunctions.fStencilStrokePathInstanced)
+ , fPathCoverDepthFunc(&fFunctions.fPathCoverDepthFunc)
+ , fPathColorGen(&fFunctions.fPathColorGen)
+ , fPathTexGen(&fFunctions.fPathTexGen)
+ , fPathFogGen(&fFunctions.fPathFogGen)
+ , fCoverFillPath(&fFunctions.fCoverFillPath)
+ , fCoverStrokePath(&fFunctions.fCoverStrokePath)
+ , fCoverFillPathInstanced(&fFunctions.fCoverFillPathInstanced)
+ , fCoverStrokePathInstanced(&fFunctions.fCoverStrokePathInstanced)
+ , fGetPathParameteriv(&fFunctions.fGetPathParameteriv)
+ , fGetPathParameterfv(&fFunctions.fGetPathParameterfv)
+ , fGetPathCommands(&fFunctions.fGetPathCommands)
+ , fGetPathCoords(&fFunctions.fGetPathCoords)
+ , fGetPathDashArray(&fFunctions.fGetPathDashArray)
+ , fGetPathMetrics(&fFunctions.fGetPathMetrics)
+ , fGetPathMetricRange(&fFunctions.fGetPathMetricRange)
+ , fGetPathSpacing(&fFunctions.fGetPathSpacing)
+ , fGetPathColorGeniv(&fFunctions.fGetPathColorGeniv)
+ , fGetPathColorGenfv(&fFunctions.fGetPathColorGenfv)
+ , fGetPathTexGeniv(&fFunctions.fGetPathTexGeniv)
+ , fGetPathTexGenfv(&fFunctions.fGetPathTexGenfv)
+ , fIsPointInFillPath(&fFunctions.fIsPointInFillPath)
+ , fIsPointInStrokePath(&fFunctions.fIsPointInStrokePath)
+ , fGetPathLength(&fFunctions.fGetPathLength)
+ , fPointAlongPath(&fFunctions.fPointAlongPath)
+{
fStandard = kNone_GrGLStandard;
#if GR_GL_PER_GL_FUNC_CALLBACK
// fExtensions.
if (!fExtensions.isInitialized()) {
GrGLExtensions* extensions = const_cast<GrGLExtensions*>(&fExtensions);
- if (!extensions->init(fStandard, fGetString, fGetStringi, fGetIntegerv)) {
+ if (!extensions->init(fStandard, fFunctions.fGetString, fFunctions.fGetStringi,
+ fFunctions.fGetIntegerv)) {
return false;
}
}
// functions that are always required
- if (NULL == fActiveTexture ||
- NULL == fAttachShader ||
- NULL == fBindAttribLocation ||
- NULL == fBindBuffer ||
- NULL == fBindTexture ||
- NULL == fBlendFunc ||
- NULL == fBlendColor || // -> GL >= 1.4, ES >= 2.0 or extension
- NULL == fBufferData ||
- NULL == fBufferSubData ||
- NULL == fClear ||
- NULL == fClearColor ||
- NULL == fClearStencil ||
- NULL == fColorMask ||
- NULL == fCompileShader ||
- NULL == fCopyTexSubImage2D ||
- NULL == fCreateProgram ||
- NULL == fCreateShader ||
- NULL == fCullFace ||
- NULL == fDeleteBuffers ||
- NULL == fDeleteProgram ||
- NULL == fDeleteShader ||
- NULL == fDeleteTextures ||
- NULL == fDepthMask ||
- NULL == fDisable ||
- NULL == fDisableVertexAttribArray ||
- NULL == fDrawArrays ||
- NULL == fDrawElements ||
- NULL == fEnable ||
- NULL == fEnableVertexAttribArray ||
- NULL == fFrontFace ||
- NULL == fGenBuffers ||
- NULL == fGenTextures ||
- NULL == fGetBufferParameteriv ||
- NULL == fGenerateMipmap ||
- NULL == fGetError ||
- NULL == fGetIntegerv ||
- NULL == fGetProgramInfoLog ||
- NULL == fGetProgramiv ||
- NULL == fGetShaderInfoLog ||
- NULL == fGetShaderiv ||
- NULL == fGetString ||
- NULL == fGetUniformLocation ||
- NULL == fLinkProgram ||
- NULL == fLineWidth ||
- NULL == fPixelStorei ||
- NULL == fReadPixels ||
- NULL == fScissor ||
- NULL == fShaderSource ||
- NULL == fStencilFunc ||
- NULL == fStencilMask ||
- NULL == fStencilOp ||
- NULL == fTexImage2D ||
- NULL == fTexParameteri ||
- NULL == fTexParameteriv ||
- NULL == fTexSubImage2D ||
- NULL == fUniform1f ||
- NULL == fUniform1i ||
- NULL == fUniform1fv ||
- NULL == fUniform1iv ||
- NULL == fUniform2f ||
- NULL == fUniform2i ||
- NULL == fUniform2fv ||
- NULL == fUniform2iv ||
- NULL == fUniform3f ||
- NULL == fUniform3i ||
- NULL == fUniform3fv ||
- NULL == fUniform3iv ||
- NULL == fUniform4f ||
- NULL == fUniform4i ||
- NULL == fUniform4fv ||
- NULL == fUniform4iv ||
- NULL == fUniformMatrix2fv ||
- NULL == fUniformMatrix3fv ||
- NULL == fUniformMatrix4fv ||
- NULL == fUseProgram ||
- NULL == fVertexAttrib4fv ||
- NULL == fVertexAttribPointer ||
- NULL == fViewport ||
- NULL == fBindFramebuffer ||
- NULL == fBindRenderbuffer ||
- NULL == fCheckFramebufferStatus ||
- NULL == fDeleteFramebuffers ||
- NULL == fDeleteRenderbuffers ||
- NULL == fFinish ||
- NULL == fFlush ||
- NULL == fFramebufferRenderbuffer ||
- NULL == fFramebufferTexture2D ||
- NULL == fGetFramebufferAttachmentParameteriv ||
- NULL == fGetRenderbufferParameteriv ||
- NULL == fGenFramebuffers ||
- NULL == fGenRenderbuffers ||
- NULL == fRenderbufferStorage) {
+ if (NULL == fFunctions.fActiveTexture ||
+ NULL == fFunctions.fAttachShader ||
+ NULL == fFunctions.fBindAttribLocation ||
+ NULL == fFunctions.fBindBuffer ||
+ NULL == fFunctions.fBindTexture ||
+ NULL == fFunctions.fBlendFunc ||
+ NULL == fFunctions.fBlendColor || // -> GL >= 1.4, ES >= 2.0 or extension
+ NULL == fFunctions.fBufferData ||
+ NULL == fFunctions.fBufferSubData ||
+ NULL == fFunctions.fClear ||
+ NULL == fFunctions.fClearColor ||
+ NULL == fFunctions.fClearStencil ||
+ NULL == fFunctions.fColorMask ||
+ NULL == fFunctions.fCompileShader ||
+ NULL == fFunctions.fCopyTexSubImage2D ||
+ NULL == fFunctions.fCreateProgram ||
+ NULL == fFunctions.fCreateShader ||
+ NULL == fFunctions.fCullFace ||
+ NULL == fFunctions.fDeleteBuffers ||
+ NULL == fFunctions.fDeleteProgram ||
+ NULL == fFunctions.fDeleteShader ||
+ NULL == fFunctions.fDeleteTextures ||
+ NULL == fFunctions.fDepthMask ||
+ NULL == fFunctions.fDisable ||
+ NULL == fFunctions.fDisableVertexAttribArray ||
+ NULL == fFunctions.fDrawArrays ||
+ NULL == fFunctions.fDrawElements ||
+ NULL == fFunctions.fEnable ||
+ NULL == fFunctions.fEnableVertexAttribArray ||
+ NULL == fFunctions.fFrontFace ||
+ NULL == fFunctions.fGenBuffers ||
+ NULL == fFunctions.fGenTextures ||
+ NULL == fFunctions.fGetBufferParameteriv ||
+ NULL == fFunctions.fGenerateMipmap ||
+ NULL == fFunctions.fGetError ||
+ NULL == fFunctions.fGetIntegerv ||
+ NULL == fFunctions.fGetProgramInfoLog ||
+ NULL == fFunctions.fGetProgramiv ||
+ NULL == fFunctions.fGetShaderInfoLog ||
+ NULL == fFunctions.fGetShaderiv ||
+ NULL == fFunctions.fGetString ||
+ NULL == fFunctions.fGetUniformLocation ||
+ NULL == fFunctions.fLinkProgram ||
+ NULL == fFunctions.fLineWidth ||
+ NULL == fFunctions.fPixelStorei ||
+ NULL == fFunctions.fReadPixels ||
+ NULL == fFunctions.fScissor ||
+ NULL == fFunctions.fShaderSource ||
+ NULL == fFunctions.fStencilFunc ||
+ NULL == fFunctions.fStencilMask ||
+ NULL == fFunctions.fStencilOp ||
+ NULL == fFunctions.fTexImage2D ||
+ NULL == fFunctions.fTexParameteri ||
+ NULL == fFunctions.fTexParameteriv ||
+ NULL == fFunctions.fTexSubImage2D ||
+ NULL == fFunctions.fUniform1f ||
+ NULL == fFunctions.fUniform1i ||
+ NULL == fFunctions.fUniform1fv ||
+ NULL == fFunctions.fUniform1iv ||
+ NULL == fFunctions.fUniform2f ||
+ NULL == fFunctions.fUniform2i ||
+ NULL == fFunctions.fUniform2fv ||
+ NULL == fFunctions.fUniform2iv ||
+ NULL == fFunctions.fUniform3f ||
+ NULL == fFunctions.fUniform3i ||
+ NULL == fFunctions.fUniform3fv ||
+ NULL == fFunctions.fUniform3iv ||
+ NULL == fFunctions.fUniform4f ||
+ NULL == fFunctions.fUniform4i ||
+ NULL == fFunctions.fUniform4fv ||
+ NULL == fFunctions.fUniform4iv ||
+ NULL == fFunctions.fUniformMatrix2fv ||
+ NULL == fFunctions.fUniformMatrix3fv ||
+ NULL == fFunctions.fUniformMatrix4fv ||
+ NULL == fFunctions.fUseProgram ||
+ NULL == fFunctions.fVertexAttrib4fv ||
+ NULL == fFunctions.fVertexAttribPointer ||
+ NULL == fFunctions.fViewport ||
+ NULL == fFunctions.fBindFramebuffer ||
+ NULL == fFunctions.fBindRenderbuffer ||
+ NULL == fFunctions.fCheckFramebufferStatus ||
+ NULL == fFunctions.fDeleteFramebuffers ||
+ NULL == fFunctions.fDeleteRenderbuffers ||
+ NULL == fFunctions.fFinish ||
+ NULL == fFunctions.fFlush ||
+ NULL == fFunctions.fFramebufferRenderbuffer ||
+ NULL == fFunctions.fFramebufferTexture2D ||
+ NULL == fFunctions.fGetFramebufferAttachmentParameteriv ||
+ NULL == fFunctions.fGetRenderbufferParameteriv ||
+ NULL == fFunctions.fGenFramebuffers ||
+ NULL == fFunctions.fGenRenderbuffers ||
+ NULL == fFunctions.fRenderbufferStorage) {
return false;
}
// On the desktop we assume they are available if the extension
// is present or GL version is high enough.
if (kGLES_GrGLStandard == fStandard) {
- if (NULL == fStencilFuncSeparate ||
- NULL == fStencilMaskSeparate ||
- NULL == fStencilOpSeparate) {
+ if (NULL == fFunctions.fStencilFuncSeparate ||
+ NULL == fFunctions.fStencilMaskSeparate ||
+ NULL == fFunctions.fStencilOpSeparate) {
return false;
}
} else if (kGL_GrGLStandard == fStandard) {
if (glVer >= GR_GL_VER(2,0)) {
- if (NULL == fStencilFuncSeparate ||
- NULL == fStencilMaskSeparate ||
- NULL == fStencilOpSeparate) {
+ if (NULL == fFunctions.fStencilFuncSeparate ||
+ NULL == fFunctions.fStencilMaskSeparate ||
+ NULL == fFunctions.fStencilOpSeparate) {
return false;
}
}
- if (glVer >= GR_GL_VER(3,0) && NULL == fBindFragDataLocation) {
+ if (glVer >= GR_GL_VER(3,0) && NULL == fFunctions.fBindFragDataLocation) {
return false;
}
if (glVer >= GR_GL_VER(2,0) || fExtensions.has("GL_ARB_draw_buffers")) {
- if (NULL == fDrawBuffers) {
+ if (NULL == fFunctions.fDrawBuffers) {
return false;
}
}
if (glVer >= GR_GL_VER(1,5) || fExtensions.has("GL_ARB_occlusion_query")) {
- if (NULL == fGenQueries ||
- NULL == fDeleteQueries ||
- NULL == fBeginQuery ||
- NULL == fEndQuery ||
- NULL == fGetQueryiv ||
- NULL == fGetQueryObjectiv ||
- NULL == fGetQueryObjectuiv) {
+ if (NULL == fFunctions.fGenQueries ||
+ NULL == fFunctions.fDeleteQueries ||
+ NULL == fFunctions.fBeginQuery ||
+ NULL == fFunctions.fEndQuery ||
+ NULL == fFunctions.fGetQueryiv ||
+ NULL == fFunctions.fGetQueryObjectiv ||
+ NULL == fFunctions.fGetQueryObjectuiv) {
return false;
}
}
if (glVer >= GR_GL_VER(3,3) ||
fExtensions.has("GL_ARB_timer_query") ||
fExtensions.has("GL_EXT_timer_query")) {
- if (NULL == fGetQueryObjecti64v ||
- NULL == fGetQueryObjectui64v) {
+ if (NULL == fFunctions.fGetQueryObjecti64v ||
+ NULL == fFunctions.fGetQueryObjectui64v) {
return false;
}
}
if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) {
- if (NULL == fQueryCounter) {
+ if (NULL == fFunctions.fQueryCounter) {
return false;
}
}
if (!isCoreProfile) {
- if (NULL == fClientActiveTexture ||
- NULL == fDisableClientState ||
- NULL == fEnableClientState ||
- NULL == fLoadIdentity ||
- NULL == fLoadMatrixf ||
- NULL == fMatrixMode ||
- NULL == fTexGenf ||
- NULL == fTexGenfv ||
- NULL == fTexGeni ||
- NULL == fVertexPointer) {
+ if (NULL == fFunctions.fClientActiveTexture ||
+ NULL == fFunctions.fDisableClientState ||
+ NULL == fFunctions.fEnableClientState ||
+ NULL == fFunctions.fLoadIdentity ||
+ NULL == fFunctions.fLoadMatrixf ||
+ NULL == fFunctions.fMatrixMode ||
+ NULL == fFunctions.fTexGenf ||
+ NULL == fFunctions.fTexGenfv ||
+ NULL == fFunctions.fTexGeni ||
+ NULL == fFunctions.fVertexPointer) {
return false;
}
}
if (false && fExtensions.has("GL_NV_path_rendering")) {
- 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) {
+ if (NULL == fFunctions.fPathCommands ||
+ NULL == fFunctions.fPathCoords ||
+ NULL == fFunctions.fPathSubCommands ||
+ NULL == fFunctions.fPathSubCoords ||
+ NULL == fFunctions.fPathString ||
+ NULL == fFunctions.fPathGlyphs ||
+ NULL == fFunctions.fPathGlyphRange ||
+ NULL == fFunctions.fWeightPaths ||
+ NULL == fFunctions.fCopyPath ||
+ NULL == fFunctions.fInterpolatePaths ||
+ NULL == fFunctions.fTransformPath ||
+ NULL == fFunctions.fPathParameteriv ||
+ NULL == fFunctions.fPathParameteri ||
+ NULL == fFunctions.fPathParameterfv ||
+ NULL == fFunctions.fPathParameterf ||
+ NULL == fFunctions.fPathDashArray ||
+ NULL == fFunctions.fGenPaths ||
+ NULL == fFunctions.fDeletePaths ||
+ NULL == fFunctions.fIsPath ||
+ NULL == fFunctions.fPathStencilFunc ||
+ NULL == fFunctions.fPathStencilDepthOffset ||
+ NULL == fFunctions.fStencilFillPath ||
+ NULL == fFunctions.fStencilStrokePath ||
+ NULL == fFunctions.fStencilFillPathInstanced ||
+ NULL == fFunctions.fStencilStrokePathInstanced ||
+ NULL == fFunctions.fPathCoverDepthFunc ||
+ NULL == fFunctions.fPathColorGen ||
+ NULL == fFunctions.fPathTexGen ||
+ NULL == fFunctions.fPathFogGen ||
+ NULL == fFunctions.fCoverFillPath ||
+ NULL == fFunctions.fCoverStrokePath ||
+ NULL == fFunctions.fCoverFillPathInstanced ||
+ NULL == fFunctions.fCoverStrokePathInstanced ||
+ NULL == fFunctions.fGetPathParameteriv ||
+ NULL == fFunctions.fGetPathParameterfv ||
+ NULL == fFunctions.fGetPathCommands ||
+ NULL == fFunctions.fGetPathCoords ||
+ NULL == fFunctions.fGetPathDashArray ||
+ NULL == fFunctions.fGetPathMetrics ||
+ NULL == fFunctions.fGetPathMetricRange ||
+ NULL == fFunctions.fGetPathSpacing ||
+ NULL == fFunctions.fGetPathColorGeniv ||
+ NULL == fFunctions.fGetPathColorGenfv ||
+ NULL == fFunctions.fGetPathTexGeniv ||
+ NULL == fFunctions.fGetPathTexGenfv ||
+ NULL == fFunctions.fIsPointInFillPath ||
+ NULL == fFunctions.fIsPointInStrokePath ||
+ NULL == fFunctions.fGetPathLength ||
+ NULL == fFunctions.fPointAlongPath) {
return false;
}
}
if (kGL_GrGLStandard != fStandard ||
(glVer >= GR_GL_VER(1,3)) ||
fExtensions.has("GL_ARB_texture_compression")) {
- if (NULL == fCompressedTexImage2D) {
+ if (NULL == fFunctions.fCompressedTexImage2D) {
return false;
}
}
// part of desktop GL, but not ES
if (kGL_GrGLStandard == fStandard &&
- (NULL == fGetTexLevelParameteriv ||
- NULL == fDrawBuffer ||
- NULL == fReadBuffer)) {
+ (NULL == fFunctions.fGetTexLevelParameteriv ||
+ NULL == fFunctions.fDrawBuffer ||
+ NULL == fFunctions.fReadBuffer)) {
return false;
}
if (glVer >= GR_GL_VER(4,2) ||
fExtensions.has("GL_ARB_texture_storage") ||
fExtensions.has("GL_EXT_texture_storage")) {
- if (NULL == fTexStorage2D) {
+ if (NULL == fFunctions.fTexStorage2D) {
return false;
}
}
} else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storage")) {
- if (NULL == fTexStorage2D) {
+ if (NULL == fFunctions.fTexStorage2D) {
return false;
}
}
if (fExtensions.has("GL_EXT_discard_framebuffer")) {
// FIXME: Remove this once Chromium is updated to provide this function
#if 0
- if (NULL == fDiscardFramebuffer) {
+ if (NULL == fFunctions.fDiscardFramebuffer) {
return false;
}
#endif
if (kGL_GrGLStandard == fStandard) {
// GL 3.0 and the ARB extension have multisample + blit
if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_object")) {
- if (NULL == fRenderbufferStorageMultisample ||
- NULL == fBlitFramebuffer) {
+ if (NULL == fFunctions.fRenderbufferStorageMultisample ||
+ NULL == fFunctions.fBlitFramebuffer) {
return false;
}
} else {
if (fExtensions.has("GL_EXT_framebuffer_blit") &&
- NULL == fBlitFramebuffer) {
+ NULL == fFunctions.fBlitFramebuffer) {
return false;
}
if (fExtensions.has("GL_EXT_framebuffer_multisample") &&
- NULL == fRenderbufferStorageMultisample) {
+ NULL == fFunctions.fRenderbufferStorageMultisample) {
return false;
}
}
} else {
if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_multisample")) {
- if (NULL == fRenderbufferStorageMultisample ||
- NULL == fBlitFramebuffer) {
+ if (NULL == fFunctions.fRenderbufferStorageMultisample ||
+ NULL == fFunctions.fBlitFramebuffer) {
return false;
}
}
if (fExtensions.has("GL_APPLE_framebuffer_multisample")) {
- if (NULL == fRenderbufferStorageMultisampleES2APPLE ||
- NULL == fResolveMultisampleFramebuffer) {
+ if (NULL == fFunctions.fRenderbufferStorageMultisampleES2APPLE ||
+ NULL == fFunctions.fResolveMultisampleFramebuffer) {
return false;
}
}
if (fExtensions.has("GL_IMG_multisampled_render_to_texture") ||
fExtensions.has("GL_EXT_multisampled_render_to_texture")) {
- if (NULL == fRenderbufferStorageMultisampleES2EXT ||
- NULL == fFramebufferTexture2DMultisample) {
+ if (NULL == fFunctions.fRenderbufferStorageMultisampleES2EXT ||
+ NULL == fFunctions.fFramebufferTexture2DMultisample) {
return false;
}
}
// buffer mapping was part of original VBO extension
// which we require.
if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) {
- if (NULL == fMapBuffer ||
- NULL == fUnmapBuffer) {
+ if (NULL == fFunctions.fMapBuffer ||
+ NULL == fFunctions.fUnmapBuffer) {
return false;
}
}
// Dual source blending
if (kGL_GrGLStandard == fStandard &&
(glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extended"))) {
- if (NULL == fBindFragDataLocationIndexed) {
+ if (NULL == fFunctions.fBindFragDataLocationIndexed) {
return false;
}
}
// glGetStringi was added in version 3.0 of both desktop and ES.
if (glVer >= GR_GL_VER(3, 0)) {
- if (NULL == fGetStringi) {
+ if (NULL == fFunctions.fGetStringi) {
return false;
}
}
if (kGL_GrGLStandard == fStandard) {
if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_object")) {
- if (NULL == fBindVertexArray ||
- NULL == fDeleteVertexArrays ||
- NULL == fGenVertexArrays) {
+ if (NULL == fFunctions.fBindVertexArray ||
+ NULL == fFunctions.fDeleteVertexArrays ||
+ NULL == fFunctions.fGenVertexArrays) {
return false;
}
}
} else {
if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_object")) {
- if (NULL == fBindVertexArray ||
- NULL == fDeleteVertexArrays ||
- NULL == fGenVertexArrays) {
+ if (NULL == fFunctions.fBindVertexArray ||
+ NULL == fFunctions.fDeleteVertexArrays ||
+ NULL == fFunctions.fGenVertexArrays) {
return false;
}
}
}
-
return true;
}
(1 == arrayCount && GrGLShaderVar::kNonArray == uni.fArrayCount))
GrGLUniformManager::GrGLUniformManager(GrGpuGL* gpu) : fGpu(gpu) {
- fUsingBindUniform = fGpu->glInterface()->fBindUniformLocation != NULL;
+ // skbug.com/2056
+ fUsingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != NULL;
}
GrGLUniformManager::UniformHandle GrGLUniformManager::appendUniform(GrSLType type, int arrayCount) {
#include <stdio.h>
void GrGLClearErr(const GrGLInterface* gl) {
- while (GR_GL_NO_ERROR != gl->fGetError()) {}
+ while (GR_GL_NO_ERROR != gl->fFunctions.fGetError()) {}
}
namespace {
#define GR_GL_CALL_NOERRCHECK(IFACE, X) \
do { \
GR_GL_CALLBACK_IMPL(IFACE); \
- (IFACE)->f##X; \
+ (IFACE)->fFunctions.f##X; \
GR_GL_LOG_CALLS_IMPL(X); \
} while (false)
#define GR_GL_CALL_RET_NOERRCHECK(IFACE, RET, X) \
do { \
GR_GL_CALLBACK_IMPL(IFACE); \
- (RET) = (IFACE)->f##X; \
+ (RET) = (IFACE)->fFunctions.f##X; \
GR_GL_LOG_CALLS_IMPL(X); \
} while (false)
// call glGetError without doing a redundant error check or logging.
-#define GR_GL_GET_ERROR(IFACE) (IFACE)->fGetError()
+#define GR_GL_GET_ERROR(IFACE) (IFACE)->fFunctions.fGetError()
#endif
GrGLInterface* interface = SkNEW(GrGLInterface);
interface->fStandard = kGLES_GrGLStandard;
+ GrGLInterface::Functions* functions = &interface->fFunctions;
- interface->fActiveTexture = glActiveTexture;
- interface->fAttachShader = glAttachShader;
- interface->fBindAttribLocation = glBindAttribLocation;
- interface->fBindBuffer = glBindBuffer;
- interface->fBindTexture = glBindTexture;
- interface->fBindVertexArray = glBindVertexArrayOES;
- interface->fBlendColor = glBlendColor;
- interface->fBlendFunc = glBlendFunc;
- interface->fBufferData = glBufferData;
- interface->fBufferSubData = glBufferSubData;
- interface->fClear = glClear;
- interface->fClearColor = glClearColor;
- interface->fClearStencil = glClearStencil;
- interface->fColorMask = glColorMask;
- interface->fCompileShader = glCompileShader;
- interface->fCompressedTexImage2D = glCompressedTexImage2D;
- interface->fCopyTexSubImage2D = glCopyTexSubImage2D;
- interface->fCreateProgram = glCreateProgram;
- interface->fCreateShader = glCreateShader;
- interface->fCullFace = glCullFace;
- interface->fDeleteBuffers = glDeleteBuffers;
- interface->fDeleteProgram = glDeleteProgram;
- interface->fDeleteShader = glDeleteShader;
- interface->fDeleteTextures = glDeleteTextures;
- interface->fDeleteVertexArrays = glDeleteVertexArraysOES;
- interface->fDepthMask = glDepthMask;
- interface->fDisable = glDisable;
- interface->fDisableVertexAttribArray = glDisableVertexAttribArray;
- interface->fDrawArrays = glDrawArrays;
- interface->fDrawElements = glDrawElements;
- interface->fEnable = glEnable;
- interface->fEnableVertexAttribArray = glEnableVertexAttribArray;
- interface->fFinish = glFinish;
- interface->fFlush = glFlush;
- interface->fFrontFace = glFrontFace;
- interface->fGenBuffers = glGenBuffers;
- interface->fGenerateMipmap = glGenerateMipmap;
- interface->fGenTextures = glGenTextures;
- interface->fGenVertexArrays = glGenVertexArraysOES;
- interface->fGetBufferParameteriv = glGetBufferParameteriv;
- interface->fGetError = glGetError;
- interface->fGetIntegerv = glGetIntegerv;
- interface->fGetProgramInfoLog = glGetProgramInfoLog;
- interface->fGetProgramiv = glGetProgramiv;
- interface->fGetShaderInfoLog = glGetShaderInfoLog;
- interface->fGetShaderiv = glGetShaderiv;
- interface->fGetString = glGetString;
+ functions->fActiveTexture = glActiveTexture;
+ functions->fAttachShader = glAttachShader;
+ functions->fBindAttribLocation = glBindAttribLocation;
+ functions->fBindBuffer = glBindBuffer;
+ functions->fBindTexture = glBindTexture;
+ functions->fBindVertexArray = glBindVertexArrayOES;
+ functions->fBlendColor = glBlendColor;
+ functions->fBlendFunc = glBlendFunc;
+ functions->fBufferData = glBufferData;
+ functions->fBufferSubData = glBufferSubData;
+ functions->fClear = glClear;
+ functions->fClearColor = glClearColor;
+ functions->fClearStencil = glClearStencil;
+ functions->fColorMask = glColorMask;
+ functions->fCompileShader = glCompileShader;
+ functions->fCompressedTexImage2D = glCompressedTexImage2D;
+ functions->fCopyTexSubImage2D = glCopyTexSubImage2D;
+ functions->fCreateProgram = glCreateProgram;
+ functions->fCreateShader = glCreateShader;
+ functions->fCullFace = glCullFace;
+ functions->fDeleteBuffers = glDeleteBuffers;
+ functions->fDeleteProgram = glDeleteProgram;
+ functions->fDeleteShader = glDeleteShader;
+ functions->fDeleteTextures = glDeleteTextures;
+ functions->fDeleteVertexArrays = glDeleteVertexArraysOES;
+ functions->fDepthMask = glDepthMask;
+ functions->fDisable = glDisable;
+ functions->fDisableVertexAttribArray = glDisableVertexAttribArray;
+ functions->fDrawArrays = glDrawArrays;
+ functions->fDrawElements = glDrawElements;
+ functions->fEnable = glEnable;
+ functions->fEnableVertexAttribArray = glEnableVertexAttribArray;
+ functions->fFinish = glFinish;
+ functions->fFlush = glFlush;
+ functions->fFrontFace = glFrontFace;
+ functions->fGenBuffers = glGenBuffers;
+ functions->fGenerateMipmap = glGenerateMipmap;
+ functions->fGenTextures = glGenTextures;
+ functions->fGenVertexArrays = glGenVertexArraysOES;
+ functions->fGetBufferParameteriv = glGetBufferParameteriv;
+ functions->fGetError = glGetError;
+ functions->fGetIntegerv = glGetIntegerv;
+ functions->fGetProgramInfoLog = glGetProgramInfoLog;
+ functions->fGetProgramiv = glGetProgramiv;
+ functions->fGetShaderInfoLog = glGetShaderInfoLog;
+ functions->fGetShaderiv = glGetShaderiv;
+ functions->fGetString = glGetString;
#if GL_ES_VERSION_30
- interface->fGetStringi = glGetStringi;
+ functions->fGetStringi = glGetStringi;
#else
- interface->fGetStringi = (GrGLGetStringiProc) eglGetProcAddress("glGetStringi");
+ functions->fGetStringi = (GrGLGetStringiProc) eglGetProcAddress("glGetStringi");
#endif
- interface->fGetUniformLocation = glGetUniformLocation;
- interface->fLineWidth = glLineWidth;
- interface->fLinkProgram = glLinkProgram;
- interface->fPixelStorei = glPixelStorei;
- interface->fReadPixels = glReadPixels;
- interface->fScissor = glScissor;
+ functions->fGetUniformLocation = glGetUniformLocation;
+ functions->fLineWidth = glLineWidth;
+ functions->fLinkProgram = glLinkProgram;
+ functions->fPixelStorei = glPixelStorei;
+ functions->fReadPixels = glReadPixels;
+ functions->fScissor = glScissor;
#if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE
- interface->fShaderSource = (GrGLShaderSourceProc) glShaderSource;
+ functions->fShaderSource = (GrGLShaderSourceProc) glShaderSource;
#else
- interface->fShaderSource = glShaderSource;
+ functions->fShaderSource = glShaderSource;
#endif
- interface->fStencilFunc = glStencilFunc;
- interface->fStencilFuncSeparate = glStencilFuncSeparate;
- interface->fStencilMask = glStencilMask;
- interface->fStencilMaskSeparate = glStencilMaskSeparate;
- interface->fStencilOp = glStencilOp;
- interface->fStencilOpSeparate = glStencilOpSeparate;
- interface->fTexImage2D = glTexImage2D;
- interface->fTexParameteri = glTexParameteri;
- interface->fTexParameteriv = glTexParameteriv;
- interface->fTexSubImage2D = glTexSubImage2D;
+ functions->fStencilFunc = glStencilFunc;
+ functions->fStencilFuncSeparate = glStencilFuncSeparate;
+ functions->fStencilMask = glStencilMask;
+ functions->fStencilMaskSeparate = glStencilMaskSeparate;
+ functions->fStencilOp = glStencilOp;
+ functions->fStencilOpSeparate = glStencilOpSeparate;
+ functions->fTexImage2D = glTexImage2D;
+ functions->fTexParameteri = glTexParameteri;
+ functions->fTexParameteriv = glTexParameteriv;
+ functions->fTexSubImage2D = glTexSubImage2D;
if (version >= GR_GL_VER(3,0)) {
#if GL_ES_VERSION_3_0
- interface->fTexStorage2D = glTexStorage2D;
+ functions->fTexStorage2D = glTexStorage2D;
#else
- interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2D");
+ functions->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2D");
#endif
} else {
#if GL_EXT_texture_storage
- interface->fTexStorage2D = glTexStorage2DEXT;
+ functions->fTexStorage2D = glTexStorage2DEXT;
#else
- interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT");
+ functions->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT");
#endif
}
#if GL_EXT_discard_framebuffer
- interface->fDiscardFramebuffer = glDiscardFramebufferEXT;
+ functions->fDiscardFramebuffer = glDiscardFramebufferEXT;
#endif
- interface->fUniform1f = glUniform1f;
- interface->fUniform1i = glUniform1i;
- interface->fUniform1fv = glUniform1fv;
- interface->fUniform1iv = glUniform1iv;
- interface->fUniform2f = glUniform2f;
- interface->fUniform2i = glUniform2i;
- interface->fUniform2fv = glUniform2fv;
- interface->fUniform2iv = glUniform2iv;
- interface->fUniform3f = glUniform3f;
- interface->fUniform3i = glUniform3i;
- interface->fUniform3fv = glUniform3fv;
- interface->fUniform3iv = glUniform3iv;
- interface->fUniform4f = glUniform4f;
- interface->fUniform4i = glUniform4i;
- interface->fUniform4fv = glUniform4fv;
- interface->fUniform4iv = glUniform4iv;
- interface->fUniformMatrix2fv = glUniformMatrix2fv;
- interface->fUniformMatrix3fv = glUniformMatrix3fv;
- interface->fUniformMatrix4fv = glUniformMatrix4fv;
- interface->fUseProgram = glUseProgram;
- interface->fVertexAttrib4fv = glVertexAttrib4fv;
- interface->fVertexAttribPointer = glVertexAttribPointer;
- interface->fViewport = glViewport;
- interface->fBindFramebuffer = glBindFramebuffer;
- interface->fBindRenderbuffer = glBindRenderbuffer;
- interface->fCheckFramebufferStatus = glCheckFramebufferStatus;
- interface->fDeleteFramebuffers = glDeleteFramebuffers;
- interface->fDeleteRenderbuffers = glDeleteRenderbuffers;
- interface->fFramebufferRenderbuffer = glFramebufferRenderbuffer;
- interface->fFramebufferTexture2D = glFramebufferTexture2D;
+ functions->fUniform1f = glUniform1f;
+ functions->fUniform1i = glUniform1i;
+ functions->fUniform1fv = glUniform1fv;
+ functions->fUniform1iv = glUniform1iv;
+ functions->fUniform2f = glUniform2f;
+ functions->fUniform2i = glUniform2i;
+ functions->fUniform2fv = glUniform2fv;
+ functions->fUniform2iv = glUniform2iv;
+ functions->fUniform3f = glUniform3f;
+ functions->fUniform3i = glUniform3i;
+ functions->fUniform3fv = glUniform3fv;
+ functions->fUniform3iv = glUniform3iv;
+ functions->fUniform4f = glUniform4f;
+ functions->fUniform4i = glUniform4i;
+ functions->fUniform4fv = glUniform4fv;
+ functions->fUniform4iv = glUniform4iv;
+ functions->fUniformMatrix2fv = glUniformMatrix2fv;
+ functions->fUniformMatrix3fv = glUniformMatrix3fv;
+ functions->fUniformMatrix4fv = glUniformMatrix4fv;
+ functions->fUseProgram = glUseProgram;
+ functions->fVertexAttrib4fv = glVertexAttrib4fv;
+ functions->fVertexAttribPointer = glVertexAttribPointer;
+ functions->fViewport = glViewport;
+ functions->fBindFramebuffer = glBindFramebuffer;
+ functions->fBindRenderbuffer = glBindRenderbuffer;
+ functions->fCheckFramebufferStatus = glCheckFramebufferStatus;
+ functions->fDeleteFramebuffers = glDeleteFramebuffers;
+ functions->fDeleteRenderbuffers = glDeleteRenderbuffers;
+ functions->fFramebufferRenderbuffer = glFramebufferRenderbuffer;
+ functions->fFramebufferTexture2D = glFramebufferTexture2D;
if (version >= GR_GL_VER(3,0)) {
#if GL_ES_VERSION_3_0
- interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisample;
- interface->fBlitFramebuffer = glBlitFramebuffer;
+ functions->fRenderbufferStorageMultisample = glRenderbufferStorageMultisample;
+ functions->fBlitFramebuffer = glBlitFramebuffer;
#else
- interface->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisample");
- interface->fBlitFramebuffer = (GrGLBlitFramebufferProc) eglGetProcAddress("glBlitFramebuffer");
+ functions->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisample");
+ functions->fBlitFramebuffer = (GrGLBlitFramebufferProc) eglGetProcAddress("glBlitFramebuffer");
#endif
}
if (extensions.has("GL_EXT_multisampled_render_to_texture")) {
#if GL_EXT_multisampled_render_to_texture
- interface->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleEXT;
- interface->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorageMultisampleEXT;
+ functions->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleEXT;
+ functions->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorageMultisampleEXT;
#else
- interface->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleEXT");
- interface->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleEXT");
+ functions->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleEXT");
+ functions->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleEXT");
#endif
} else if (extensions.has("GL_IMG_multisampled_render_to_texture")) {
#if GL_IMG_multisampled_render_to_texture
- interface->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleIMG;
- interface->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorageMultisampleIMG;
+ functions->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleIMG;
+ functions->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorageMultisampleIMG;
#else
- interface->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleIMG");
- interface->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleIMG");
+ functions->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleIMG");
+ functions->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleIMG");
#endif
}
- interface->fGenFramebuffers = glGenFramebuffers;
- interface->fGenRenderbuffers = glGenRenderbuffers;
- interface->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameteriv;
- interface->fGetRenderbufferParameteriv = glGetRenderbufferParameteriv;
- interface->fRenderbufferStorage = glRenderbufferStorage;
+ functions->fGenFramebuffers = glGenFramebuffers;
+ functions->fGenRenderbuffers = glGenRenderbuffers;
+ functions->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameteriv;
+ functions->fGetRenderbufferParameteriv = glGetRenderbufferParameteriv;
+ functions->fRenderbufferStorage = glRenderbufferStorage;
#if GL_OES_mapbuffer
- interface->fMapBuffer = glMapBufferOES;
- interface->fUnmapBuffer = glUnmapBufferOES;
+ functions->fMapBuffer = glMapBufferOES;
+ functions->fUnmapBuffer = glUnmapBufferOES;
#else
- interface->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES");
- interface->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES");
+ functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES");
+ functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES");
#endif
return interface;
GrGLInterface* interface = SkNEW(GrGLInterface);
interface->fStandard = kGL_GrGLStandard;
+ GrGLInterface::Functions* functions = &interface->fFunctions;
- interface->fActiveTexture = (GrGLActiveTextureProc) eglGetProcAddress("glActiveTexture");
- interface->fAttachShader = (GrGLAttachShaderProc) eglGetProcAddress("glAttachShader");
- interface->fBeginQuery = (GrGLBeginQueryProc) eglGetProcAddress("glBeginQuery");
- interface->fBindAttribLocation = (GrGLBindAttribLocationProc) eglGetProcAddress("glBindAttribLocation");
- interface->fBindBuffer = (GrGLBindBufferProc) eglGetProcAddress("glBindBuffer");
- interface->fBindFragDataLocation = (GrGLBindFragDataLocationProc) eglGetProcAddress("glBindFragDataLocation");
- interface->fBindFragDataLocationIndexed = (GrGLBindFragDataLocationIndexedProc) eglGetProcAddress("glBindFragDataLocationIndexed");
- interface->fBindFramebuffer = (GrGLBindFramebufferProc) eglGetProcAddress("glBindFramebuffer");
- interface->fBindRenderbuffer = (GrGLBindRenderbufferProc) eglGetProcAddress("glBindRenderbuffer");
- interface->fBindTexture = (GrGLBindTextureProc) eglGetProcAddress("glBindTexture");
- interface->fBindVertexArray = (GrGLBindVertexArrayProc) eglGetProcAddress("glBindVertexArray");
- interface->fBlendColor = (GrGLBlendColorProc) eglGetProcAddress("glBlendColor");
- interface->fBlendFunc = (GrGLBlendFuncProc) eglGetProcAddress("glBlendFunc");
- interface->fBlitFramebuffer = (GrGLBlitFramebufferProc) eglGetProcAddress("glBlitFramebuffer");
- interface->fBufferData = (GrGLBufferDataProc) eglGetProcAddress("glBufferData");
- interface->fBufferSubData = (GrGLBufferSubDataProc) eglGetProcAddress("glBufferSubData");
- interface->fCheckFramebufferStatus = (GrGLCheckFramebufferStatusProc) eglGetProcAddress("glCheckFramebufferStatus");
- interface->fClear = (GrGLClearProc) eglGetProcAddress("glClear");
- interface->fClearColor = (GrGLClearColorProc) eglGetProcAddress("glClearColor");
- interface->fClearStencil = (GrGLClearStencilProc) eglGetProcAddress("glClearStencil");
- interface->fClientActiveTexture = (GrGLClientActiveTextureProc) eglGetProcAddress("glClientActiveTexture");
- interface->fColorMask = (GrGLColorMaskProc) eglGetProcAddress("glColorMask");
- interface->fCompileShader = (GrGLCompileShaderProc) eglGetProcAddress("glCompileShader");
- interface->fCompressedTexImage2D = (GrGLCompressedTexImage2DProc) eglGetProcAddress("glCompressedTexImage2D");
- interface->fCopyTexSubImage2D = (GrGLCopyTexSubImage2DProc) eglGetProcAddress("glCopyTexSubImage2D");
- interface->fCreateProgram = (GrGLCreateProgramProc) eglGetProcAddress("glCreateProgram");
- interface->fCreateShader = (GrGLCreateShaderProc) eglGetProcAddress("glCreateShader");
- interface->fCullFace = (GrGLCullFaceProc) eglGetProcAddress("glCullFace");
- interface->fDeleteBuffers = (GrGLDeleteBuffersProc) eglGetProcAddress("glDeleteBuffers");
- interface->fDeleteFramebuffers = (GrGLDeleteFramebuffersProc) eglGetProcAddress("glDeleteFramebuffers");
- interface->fDeleteProgram = (GrGLDeleteProgramProc) eglGetProcAddress("glDeleteProgram");
- interface->fDeleteQueries = (GrGLDeleteQueriesProc) eglGetProcAddress("glDeleteQueries");
- interface->fDeleteRenderbuffers = (GrGLDeleteRenderbuffersProc) eglGetProcAddress("glDeleteRenderbuffers");
- interface->fDeleteShader = (GrGLDeleteShaderProc) eglGetProcAddress("glDeleteShader");
- interface->fDeleteTextures = (GrGLDeleteTexturesProc) eglGetProcAddress("glDeleteTextures");
- interface->fDeleteVertexArrays = (GrGLDeleteVertexArraysProc) eglGetProcAddress("glDeleteVertexArrays");
- interface->fDepthMask = (GrGLDepthMaskProc) eglGetProcAddress("glDepthMask");
- interface->fDisable = (GrGLDisableProc) eglGetProcAddress("glDisable");
- interface->fDisableClientState = (GrGLDisableClientStateProc) eglGetProcAddress("glDisableClientState");
- interface->fDisableVertexAttribArray = (GrGLDisableVertexAttribArrayProc) eglGetProcAddress("glDisableVertexAttribArray");
- interface->fDrawArrays = (GrGLDrawArraysProc) eglGetProcAddress("glDrawArrays");
- interface->fDrawBuffer = (GrGLDrawBufferProc) eglGetProcAddress("glDrawBuffer");
- interface->fDrawBuffers = (GrGLDrawBuffersProc) eglGetProcAddress("glDrawBuffers");
- interface->fDrawElements = (GrGLDrawElementsProc) eglGetProcAddress("glDrawElements");
- interface->fEnable = (GrGLEnableProc) eglGetProcAddress("glEnable");
- interface->fEnableClientState = (GrGLEnableClientStateProc) eglGetProcAddress("glEnableClientState");
- interface->fEnableVertexAttribArray = (GrGLEnableVertexAttribArrayProc) eglGetProcAddress("glEnableVertexAttribArray");
- interface->fEndQuery = (GrGLEndQueryProc) eglGetProcAddress("glEndQuery");
- interface->fFinish = (GrGLFinishProc) eglGetProcAddress("glFinish");
- interface->fFlush = (GrGLFlushProc) eglGetProcAddress("glFlush");
- interface->fFramebufferRenderbuffer = (GrGLFramebufferRenderbufferProc) eglGetProcAddress("glFramebufferRenderbuffer");
- interface->fFramebufferTexture2D = (GrGLFramebufferTexture2DProc) eglGetProcAddress("glFramebufferTexture2D");
- interface->fFrontFace = (GrGLFrontFaceProc) eglGetProcAddress("glFrontFace");
- interface->fGenBuffers = (GrGLGenBuffersProc) eglGetProcAddress("glGenBuffers");
- interface->fGenFramebuffers = (GrGLGenFramebuffersProc) eglGetProcAddress("glGenFramebuffers");
- interface->fGenerateMipmap = (GrGLGenerateMipmapProc) eglGetProcAddress("glGenerateMipmap");
- interface->fGenQueries = (GrGLGenQueriesProc) eglGetProcAddress("glGenQueries");
- interface->fGenRenderbuffers = (GrGLGenRenderbuffersProc) eglGetProcAddress("glGenRenderbuffers");
- interface->fGenTextures = (GrGLGenTexturesProc) eglGetProcAddress("glGenTextures");
- interface->fGenVertexArrays = (GrGLGenVertexArraysProc) eglGetProcAddress("glGenVertexArrays");
- interface->fGetBufferParameteriv = (GrGLGetBufferParameterivProc) eglGetProcAddress("glGetBufferParameteriv");
- interface->fGetError = (GrGLGetErrorProc) eglGetProcAddress("glGetError");
- interface->fGetFramebufferAttachmentParameteriv = (GrGLGetFramebufferAttachmentParameterivProc) eglGetProcAddress("glGetFramebufferAttachmentParameteriv");
- interface->fGetIntegerv = (GrGLGetIntegervProc) eglGetProcAddress("glGetIntegerv");
- interface->fGetQueryObjecti64v = (GrGLGetQueryObjecti64vProc) eglGetProcAddress("glGetQueryObjecti64v");
- interface->fGetQueryObjectiv = (GrGLGetQueryObjectivProc) eglGetProcAddress("glGetQueryObjectiv");
- interface->fGetQueryObjectui64v = (GrGLGetQueryObjectui64vProc) eglGetProcAddress("glGetQueryObjectui64v");
- interface->fGetQueryObjectuiv = (GrGLGetQueryObjectuivProc) eglGetProcAddress("glGetQueryObjectuiv");
- interface->fGetQueryiv = (GrGLGetQueryivProc) eglGetProcAddress("glGetQueryiv");
- interface->fGetProgramInfoLog = (GrGLGetProgramInfoLogProc) eglGetProcAddress("glGetProgramInfoLog");
- interface->fGetProgramiv = (GrGLGetProgramivProc) eglGetProcAddress("glGetProgramiv");
- interface->fGetRenderbufferParameteriv = (GrGLGetRenderbufferParameterivProc) eglGetProcAddress("glGetRenderbufferParameteriv");
- interface->fGetShaderInfoLog = (GrGLGetShaderInfoLogProc) eglGetProcAddress("glGetShaderInfoLog");
- interface->fGetShaderiv = (GrGLGetShaderivProc) eglGetProcAddress("glGetShaderiv");
- interface->fGetString = (GrGLGetStringProc) eglGetProcAddress("glGetString");
- interface->fGetStringi = (GrGLGetStringiProc) eglGetProcAddress("glGetStringi");
- interface->fGetTexLevelParameteriv = (GrGLGetTexLevelParameterivProc) eglGetProcAddress("glGetTexLevelParameteriv");
- interface->fGetUniformLocation = (GrGLGetUniformLocationProc) eglGetProcAddress("glGetUniformLocation");
- interface->fLineWidth = (GrGLLineWidthProc) eglGetProcAddress("glLineWidth");
- interface->fLinkProgram = (GrGLLinkProgramProc) eglGetProcAddress("glLinkProgram");
- interface->fLoadIdentity = (GrGLLoadIdentityProc) eglGetProcAddress("glLoadIdentity");
- interface->fLoadMatrixf = (GrGLLoadMatrixfProc) eglGetProcAddress("glLoadMatrixf");
- interface->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBuffer");
- interface->fMatrixMode = (GrGLMatrixModeProc) eglGetProcAddress("glMatrixMode");
- interface->fPixelStorei = (GrGLPixelStoreiProc) eglGetProcAddress("glPixelStorei");
- interface->fQueryCounter = (GrGLQueryCounterProc) eglGetProcAddress("glQueryCounter");
- interface->fReadBuffer = (GrGLReadBufferProc) eglGetProcAddress("glReadBuffer");
- interface->fReadPixels = (GrGLReadPixelsProc) eglGetProcAddress("glReadPixels");
- interface->fRenderbufferStorage = (GrGLRenderbufferStorageProc) eglGetProcAddress("glRenderbufferStorage");
- interface->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisample");
- interface->fScissor = (GrGLScissorProc) eglGetProcAddress("glScissor");
- interface->fShaderSource = (GrGLShaderSourceProc) eglGetProcAddress("glShaderSource");
- interface->fStencilFunc = (GrGLStencilFuncProc) eglGetProcAddress("glStencilFunc");
- interface->fStencilFuncSeparate = (GrGLStencilFuncSeparateProc) eglGetProcAddress("glStencilFuncSeparate");
- interface->fStencilMask = (GrGLStencilMaskProc) eglGetProcAddress("glStencilMask");
- interface->fStencilMaskSeparate = (GrGLStencilMaskSeparateProc) eglGetProcAddress("glStencilMaskSeparate");
- interface->fStencilOp = (GrGLStencilOpProc) eglGetProcAddress("glStencilOp");
- interface->fStencilOpSeparate = (GrGLStencilOpSeparateProc) eglGetProcAddress("glStencilOpSeparate");
- interface->fTexGenf = (GrGLTexGenfProc) eglGetProcAddress("glTexGenf");
- interface->fTexGenfv = (GrGLTexGenfvProc) eglGetProcAddress("glTexGenfv");
- interface->fTexGeni = (GrGLTexGeniProc) eglGetProcAddress("glTexGeni");
- interface->fTexImage2D = (GrGLTexImage2DProc) eglGetProcAddress("glTexImage2D");
- interface->fTexParameteri = (GrGLTexParameteriProc) eglGetProcAddress("glTexParameteri");
- interface->fTexParameteriv = (GrGLTexParameterivProc) eglGetProcAddress("glTexParameteriv");
- interface->fTexSubImage2D = (GrGLTexSubImage2DProc) eglGetProcAddress("glTexSubImage2D");
- interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2D");
- interface->fUniform1f = (GrGLUniform1fProc) eglGetProcAddress("glUniform1f");
- interface->fUniform1i = (GrGLUniform1iProc) eglGetProcAddress("glUniform1i");
- interface->fUniform1fv = (GrGLUniform1fvProc) eglGetProcAddress("glUniform1fv");
- interface->fUniform1iv = (GrGLUniform1ivProc) eglGetProcAddress("glUniform1iv");
- interface->fUniform2f = (GrGLUniform2fProc) eglGetProcAddress("glUniform2f");
- interface->fUniform2i = (GrGLUniform2iProc) eglGetProcAddress("glUniform2i");
- interface->fUniform2fv = (GrGLUniform2fvProc) eglGetProcAddress("glUniform2fv");
- interface->fUniform2iv = (GrGLUniform2ivProc) eglGetProcAddress("glUniform2iv");
- interface->fUniform3f = (GrGLUniform3fProc) eglGetProcAddress("glUniform3f");
- interface->fUniform3i = (GrGLUniform3iProc) eglGetProcAddress("glUniform3i");
- interface->fUniform3fv = (GrGLUniform3fvProc) eglGetProcAddress("glUniform3fv");
- interface->fUniform3iv = (GrGLUniform3ivProc) eglGetProcAddress("glUniform3iv");
- interface->fUniform4f = (GrGLUniform4fProc) eglGetProcAddress("glUniform4f");
- interface->fUniform4i = (GrGLUniform4iProc) eglGetProcAddress("glUniform4i");
- interface->fUniform4fv = (GrGLUniform4fvProc) eglGetProcAddress("glUniform4fv");
- interface->fUniform4iv = (GrGLUniform4ivProc) eglGetProcAddress("glUniform4iv");
- interface->fUniformMatrix2fv = (GrGLUniformMatrix2fvProc) eglGetProcAddress("glUniformMatrix2fv");
- interface->fUniformMatrix3fv = (GrGLUniformMatrix3fvProc) eglGetProcAddress("glUniformMatrix3fv");
- interface->fUniformMatrix4fv = (GrGLUniformMatrix4fvProc) eglGetProcAddress("glUniformMatrix4fv");
- interface->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBuffer");
- interface->fUseProgram = (GrGLUseProgramProc) eglGetProcAddress("glUseProgram");
- interface->fVertexAttrib4fv = (GrGLVertexAttrib4fvProc) eglGetProcAddress("glVertexAttrib4fv");
- interface->fVertexAttribPointer = (GrGLVertexAttribPointerProc) eglGetProcAddress("glVertexAttribPointer");
- interface->fVertexPointer = (GrGLVertexPointerProc) eglGetProcAddress("glVertexPointer");
- interface->fViewport = (GrGLViewportProc) eglGetProcAddress("glViewport");
+ functions->fActiveTexture = (GrGLActiveTextureProc) eglGetProcAddress("glActiveTexture");
+ functions->fAttachShader = (GrGLAttachShaderProc) eglGetProcAddress("glAttachShader");
+ functions->fBeginQuery = (GrGLBeginQueryProc) eglGetProcAddress("glBeginQuery");
+ functions->fBindAttribLocation = (GrGLBindAttribLocationProc) eglGetProcAddress("glBindAttribLocation");
+ functions->fBindBuffer = (GrGLBindBufferProc) eglGetProcAddress("glBindBuffer");
+ functions->fBindFragDataLocation = (GrGLBindFragDataLocationProc) eglGetProcAddress("glBindFragDataLocation");
+ functions->fBindFragDataLocationIndexed = (GrGLBindFragDataLocationIndexedProc) eglGetProcAddress("glBindFragDataLocationIndexed");
+ functions->fBindFramebuffer = (GrGLBindFramebufferProc) eglGetProcAddress("glBindFramebuffer");
+ functions->fBindRenderbuffer = (GrGLBindRenderbufferProc) eglGetProcAddress("glBindRenderbuffer");
+ functions->fBindTexture = (GrGLBindTextureProc) eglGetProcAddress("glBindTexture");
+ functions->fBindVertexArray = (GrGLBindVertexArrayProc) eglGetProcAddress("glBindVertexArray");
+ functions->fBlendColor = (GrGLBlendColorProc) eglGetProcAddress("glBlendColor");
+ functions->fBlendFunc = (GrGLBlendFuncProc) eglGetProcAddress("glBlendFunc");
+ functions->fBlitFramebuffer = (GrGLBlitFramebufferProc) eglGetProcAddress("glBlitFramebuffer");
+ functions->fBufferData = (GrGLBufferDataProc) eglGetProcAddress("glBufferData");
+ functions->fBufferSubData = (GrGLBufferSubDataProc) eglGetProcAddress("glBufferSubData");
+ functions->fCheckFramebufferStatus = (GrGLCheckFramebufferStatusProc) eglGetProcAddress("glCheckFramebufferStatus");
+ functions->fClear = (GrGLClearProc) eglGetProcAddress("glClear");
+ functions->fClearColor = (GrGLClearColorProc) eglGetProcAddress("glClearColor");
+ functions->fClearStencil = (GrGLClearStencilProc) eglGetProcAddress("glClearStencil");
+ functions->fClientActiveTexture = (GrGLClientActiveTextureProc) eglGetProcAddress("glClientActiveTexture");
+ functions->fColorMask = (GrGLColorMaskProc) eglGetProcAddress("glColorMask");
+ functions->fCompileShader = (GrGLCompileShaderProc) eglGetProcAddress("glCompileShader");
+ functions->fCompressedTexImage2D = (GrGLCompressedTexImage2DProc) eglGetProcAddress("glCompressedTexImage2D");
+ functions->fCopyTexSubImage2D = (GrGLCopyTexSubImage2DProc) eglGetProcAddress("glCopyTexSubImage2D");
+ functions->fCreateProgram = (GrGLCreateProgramProc) eglGetProcAddress("glCreateProgram");
+ functions->fCreateShader = (GrGLCreateShaderProc) eglGetProcAddress("glCreateShader");
+ functions->fCullFace = (GrGLCullFaceProc) eglGetProcAddress("glCullFace");
+ functions->fDeleteBuffers = (GrGLDeleteBuffersProc) eglGetProcAddress("glDeleteBuffers");
+ functions->fDeleteFramebuffers = (GrGLDeleteFramebuffersProc) eglGetProcAddress("glDeleteFramebuffers");
+ functions->fDeleteProgram = (GrGLDeleteProgramProc) eglGetProcAddress("glDeleteProgram");
+ functions->fDeleteQueries = (GrGLDeleteQueriesProc) eglGetProcAddress("glDeleteQueries");
+ functions->fDeleteRenderbuffers = (GrGLDeleteRenderbuffersProc) eglGetProcAddress("glDeleteRenderbuffers");
+ functions->fDeleteShader = (GrGLDeleteShaderProc) eglGetProcAddress("glDeleteShader");
+ functions->fDeleteTextures = (GrGLDeleteTexturesProc) eglGetProcAddress("glDeleteTextures");
+ functions->fDeleteVertexArrays = (GrGLDeleteVertexArraysProc) eglGetProcAddress("glDeleteVertexArrays");
+ functions->fDepthMask = (GrGLDepthMaskProc) eglGetProcAddress("glDepthMask");
+ functions->fDisable = (GrGLDisableProc) eglGetProcAddress("glDisable");
+ functions->fDisableClientState = (GrGLDisableClientStateProc) eglGetProcAddress("glDisableClientState");
+ functions->fDisableVertexAttribArray = (GrGLDisableVertexAttribArrayProc) eglGetProcAddress("glDisableVertexAttribArray");
+ functions->fDrawArrays = (GrGLDrawArraysProc) eglGetProcAddress("glDrawArrays");
+ functions->fDrawBuffer = (GrGLDrawBufferProc) eglGetProcAddress("glDrawBuffer");
+ functions->fDrawBuffers = (GrGLDrawBuffersProc) eglGetProcAddress("glDrawBuffers");
+ functions->fDrawElements = (GrGLDrawElementsProc) eglGetProcAddress("glDrawElements");
+ functions->fEnable = (GrGLEnableProc) eglGetProcAddress("glEnable");
+ functions->fEnableClientState = (GrGLEnableClientStateProc) eglGetProcAddress("glEnableClientState");
+ functions->fEnableVertexAttribArray = (GrGLEnableVertexAttribArrayProc) eglGetProcAddress("glEnableVertexAttribArray");
+ functions->fEndQuery = (GrGLEndQueryProc) eglGetProcAddress("glEndQuery");
+ functions->fFinish = (GrGLFinishProc) eglGetProcAddress("glFinish");
+ functions->fFlush = (GrGLFlushProc) eglGetProcAddress("glFlush");
+ functions->fFramebufferRenderbuffer = (GrGLFramebufferRenderbufferProc) eglGetProcAddress("glFramebufferRenderbuffer");
+ functions->fFramebufferTexture2D = (GrGLFramebufferTexture2DProc) eglGetProcAddress("glFramebufferTexture2D");
+ functions->fFrontFace = (GrGLFrontFaceProc) eglGetProcAddress("glFrontFace");
+ functions->fGenBuffers = (GrGLGenBuffersProc) eglGetProcAddress("glGenBuffers");
+ functions->fGenFramebuffers = (GrGLGenFramebuffersProc) eglGetProcAddress("glGenFramebuffers");
+ functions->fGenerateMipmap = (GrGLGenerateMipmapProc) eglGetProcAddress("glGenerateMipmap");
+ functions->fGenQueries = (GrGLGenQueriesProc) eglGetProcAddress("glGenQueries");
+ functions->fGenRenderbuffers = (GrGLGenRenderbuffersProc) eglGetProcAddress("glGenRenderbuffers");
+ functions->fGenTextures = (GrGLGenTexturesProc) eglGetProcAddress("glGenTextures");
+ functions->fGenVertexArrays = (GrGLGenVertexArraysProc) eglGetProcAddress("glGenVertexArrays");
+ functions->fGetBufferParameteriv = (GrGLGetBufferParameterivProc) eglGetProcAddress("glGetBufferParameteriv");
+ functions->fGetError = (GrGLGetErrorProc) eglGetProcAddress("glGetError");
+ functions->fGetFramebufferAttachmentParameteriv = (GrGLGetFramebufferAttachmentParameterivProc) eglGetProcAddress("glGetFramebufferAttachmentParameteriv");
+ functions->fGetIntegerv = (GrGLGetIntegervProc) eglGetProcAddress("glGetIntegerv");
+ functions->fGetQueryObjecti64v = (GrGLGetQueryObjecti64vProc) eglGetProcAddress("glGetQueryObjecti64v");
+ functions->fGetQueryObjectiv = (GrGLGetQueryObjectivProc) eglGetProcAddress("glGetQueryObjectiv");
+ functions->fGetQueryObjectui64v = (GrGLGetQueryObjectui64vProc) eglGetProcAddress("glGetQueryObjectui64v");
+ functions->fGetQueryObjectuiv = (GrGLGetQueryObjectuivProc) eglGetProcAddress("glGetQueryObjectuiv");
+ functions->fGetQueryiv = (GrGLGetQueryivProc) eglGetProcAddress("glGetQueryiv");
+ functions->fGetProgramInfoLog = (GrGLGetProgramInfoLogProc) eglGetProcAddress("glGetProgramInfoLog");
+ functions->fGetProgramiv = (GrGLGetProgramivProc) eglGetProcAddress("glGetProgramiv");
+ functions->fGetRenderbufferParameteriv = (GrGLGetRenderbufferParameterivProc) eglGetProcAddress("glGetRenderbufferParameteriv");
+ functions->fGetShaderInfoLog = (GrGLGetShaderInfoLogProc) eglGetProcAddress("glGetShaderInfoLog");
+ functions->fGetShaderiv = (GrGLGetShaderivProc) eglGetProcAddress("glGetShaderiv");
+ functions->fGetString = (GrGLGetStringProc) eglGetProcAddress("glGetString");
+ functions->fGetStringi = (GrGLGetStringiProc) eglGetProcAddress("glGetStringi");
+ functions->fGetTexLevelParameteriv = (GrGLGetTexLevelParameterivProc) eglGetProcAddress("glGetTexLevelParameteriv");
+ functions->fGetUniformLocation = (GrGLGetUniformLocationProc) eglGetProcAddress("glGetUniformLocation");
+ functions->fLineWidth = (GrGLLineWidthProc) eglGetProcAddress("glLineWidth");
+ functions->fLinkProgram = (GrGLLinkProgramProc) eglGetProcAddress("glLinkProgram");
+ functions->fLoadIdentity = (GrGLLoadIdentityProc) eglGetProcAddress("glLoadIdentity");
+ functions->fLoadMatrixf = (GrGLLoadMatrixfProc) eglGetProcAddress("glLoadMatrixf");
+ functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBuffer");
+ functions->fMatrixMode = (GrGLMatrixModeProc) eglGetProcAddress("glMatrixMode");
+ functions->fPixelStorei = (GrGLPixelStoreiProc) eglGetProcAddress("glPixelStorei");
+ functions->fQueryCounter = (GrGLQueryCounterProc) eglGetProcAddress("glQueryCounter");
+ functions->fReadBuffer = (GrGLReadBufferProc) eglGetProcAddress("glReadBuffer");
+ functions->fReadPixels = (GrGLReadPixelsProc) eglGetProcAddress("glReadPixels");
+ functions->fRenderbufferStorage = (GrGLRenderbufferStorageProc) eglGetProcAddress("glRenderbufferStorage");
+ functions->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisample");
+ functions->fScissor = (GrGLScissorProc) eglGetProcAddress("glScissor");
+ functions->fShaderSource = (GrGLShaderSourceProc) eglGetProcAddress("glShaderSource");
+ functions->fStencilFunc = (GrGLStencilFuncProc) eglGetProcAddress("glStencilFunc");
+ functions->fStencilFuncSeparate = (GrGLStencilFuncSeparateProc) eglGetProcAddress("glStencilFuncSeparate");
+ functions->fStencilMask = (GrGLStencilMaskProc) eglGetProcAddress("glStencilMask");
+ functions->fStencilMaskSeparate = (GrGLStencilMaskSeparateProc) eglGetProcAddress("glStencilMaskSeparate");
+ functions->fStencilOp = (GrGLStencilOpProc) eglGetProcAddress("glStencilOp");
+ functions->fStencilOpSeparate = (GrGLStencilOpSeparateProc) eglGetProcAddress("glStencilOpSeparate");
+ functions->fTexGenf = (GrGLTexGenfProc) eglGetProcAddress("glTexGenf");
+ functions->fTexGenfv = (GrGLTexGenfvProc) eglGetProcAddress("glTexGenfv");
+ functions->fTexGeni = (GrGLTexGeniProc) eglGetProcAddress("glTexGeni");
+ functions->fTexImage2D = (GrGLTexImage2DProc) eglGetProcAddress("glTexImage2D");
+ functions->fTexParameteri = (GrGLTexParameteriProc) eglGetProcAddress("glTexParameteri");
+ functions->fTexParameteriv = (GrGLTexParameterivProc) eglGetProcAddress("glTexParameteriv");
+ functions->fTexSubImage2D = (GrGLTexSubImage2DProc) eglGetProcAddress("glTexSubImage2D");
+ functions->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2D");
+ functions->fUniform1f = (GrGLUniform1fProc) eglGetProcAddress("glUniform1f");
+ functions->fUniform1i = (GrGLUniform1iProc) eglGetProcAddress("glUniform1i");
+ functions->fUniform1fv = (GrGLUniform1fvProc) eglGetProcAddress("glUniform1fv");
+ functions->fUniform1iv = (GrGLUniform1ivProc) eglGetProcAddress("glUniform1iv");
+ functions->fUniform2f = (GrGLUniform2fProc) eglGetProcAddress("glUniform2f");
+ functions->fUniform2i = (GrGLUniform2iProc) eglGetProcAddress("glUniform2i");
+ functions->fUniform2fv = (GrGLUniform2fvProc) eglGetProcAddress("glUniform2fv");
+ functions->fUniform2iv = (GrGLUniform2ivProc) eglGetProcAddress("glUniform2iv");
+ functions->fUniform3f = (GrGLUniform3fProc) eglGetProcAddress("glUniform3f");
+ functions->fUniform3i = (GrGLUniform3iProc) eglGetProcAddress("glUniform3i");
+ functions->fUniform3fv = (GrGLUniform3fvProc) eglGetProcAddress("glUniform3fv");
+ functions->fUniform3iv = (GrGLUniform3ivProc) eglGetProcAddress("glUniform3iv");
+ functions->fUniform4f = (GrGLUniform4fProc) eglGetProcAddress("glUniform4f");
+ functions->fUniform4i = (GrGLUniform4iProc) eglGetProcAddress("glUniform4i");
+ functions->fUniform4fv = (GrGLUniform4fvProc) eglGetProcAddress("glUniform4fv");
+ functions->fUniform4iv = (GrGLUniform4ivProc) eglGetProcAddress("glUniform4iv");
+ functions->fUniformMatrix2fv = (GrGLUniformMatrix2fvProc) eglGetProcAddress("glUniformMatrix2fv");
+ functions->fUniformMatrix3fv = (GrGLUniformMatrix3fvProc) eglGetProcAddress("glUniformMatrix3fv");
+ functions->fUniformMatrix4fv = (GrGLUniformMatrix4fvProc) eglGetProcAddress("glUniformMatrix4fv");
+ functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBuffer");
+ functions->fUseProgram = (GrGLUseProgramProc) eglGetProcAddress("glUseProgram");
+ functions->fVertexAttrib4fv = (GrGLVertexAttrib4fvProc) eglGetProcAddress("glVertexAttrib4fv");
+ functions->fVertexAttribPointer = (GrGLVertexAttribPointerProc) eglGetProcAddress("glVertexAttribPointer");
+ functions->fVertexPointer = (GrGLVertexPointerProc) eglGetProcAddress("glVertexPointer");
+ functions->fViewport = (GrGLViewportProc) eglGetProcAddress("glViewport");
if (extensions.has("GL_NV_path_rendering")) {
- interface->fPathCommands = (GrGLPathCommandsProc) eglGetProcAddress("glPathCommandsNV");
- interface->fPathCoords = (GrGLPathCoordsProc) eglGetProcAddress("glPathCoordsNV");
- interface->fPathSubCommands = (GrGLPathSubCommandsProc) eglGetProcAddress("glPathSubCommandsNV");
- interface->fPathSubCoords = (GrGLPathSubCoordsProc) eglGetProcAddress("glPathSubCoordsNV");
- interface->fPathString = (GrGLPathStringProc) eglGetProcAddress("glPathStringNV");
- interface->fPathGlyphs = (GrGLPathGlyphsProc) eglGetProcAddress("glPathGlyphsNV");
- interface->fPathGlyphRange = (GrGLPathGlyphRangeProc) eglGetProcAddress("glPathGlyphRangeNV");
- interface->fWeightPaths = (GrGLWeightPathsProc) eglGetProcAddress("glWeightPathsNV");
- interface->fCopyPath = (GrGLCopyPathProc) eglGetProcAddress("glCopyPathNV");
- interface->fInterpolatePaths = (GrGLInterpolatePathsProc) eglGetProcAddress("glInterpolatePathsNV");
- interface->fTransformPath = (GrGLTransformPathProc) eglGetProcAddress("glTransformPathNV");
- interface->fPathParameteriv = (GrGLPathParameterivProc) eglGetProcAddress("glPathParameterivNV");
- interface->fPathParameteri = (GrGLPathParameteriProc) eglGetProcAddress("glPathParameteriNV");
- interface->fPathParameterfv = (GrGLPathParameterfvProc) eglGetProcAddress("glPathParameterfvNV");
- interface->fPathParameterf = (GrGLPathParameterfProc) eglGetProcAddress("glPathParameterfNV");
- interface->fPathDashArray = (GrGLPathDashArrayProc) eglGetProcAddress("glPathDashArrayNV");
- interface->fGenPaths = (GrGLGenPathsProc) eglGetProcAddress("glGenPathsNV");
- interface->fDeletePaths = (GrGLDeletePathsProc) eglGetProcAddress("glDeletePathsNV");
- interface->fIsPath = (GrGLIsPathProc) eglGetProcAddress("glIsPathNV");
- interface->fPathStencilFunc = (GrGLPathStencilFuncProc) eglGetProcAddress("glPathStencilFuncNV");
- interface->fPathStencilDepthOffset = (GrGLPathStencilDepthOffsetProc) eglGetProcAddress("glPathStencilDepthOffsetNV");
- interface->fStencilFillPath = (GrGLStencilFillPathProc) eglGetProcAddress("glStencilFillPathNV");
- interface->fStencilStrokePath = (GrGLStencilStrokePathProc) eglGetProcAddress("glStencilStrokePathNV");
- interface->fStencilFillPathInstanced = (GrGLStencilFillPathInstancedProc) eglGetProcAddress("glStencilFillPathInstancedNV");
- interface->fStencilStrokePathInstanced = (GrGLStencilStrokePathInstancedProc) eglGetProcAddress("glStencilStrokePathInstancedNV");
- interface->fPathCoverDepthFunc = (GrGLPathCoverDepthFuncProc) eglGetProcAddress("glPathCoverDepthFuncNV");
- interface->fPathColorGen = (GrGLPathColorGenProc) eglGetProcAddress("glPathColorGenNV");
- interface->fPathTexGen = (GrGLPathTexGenProc) eglGetProcAddress("glPathTexGenNV");
- interface->fPathFogGen = (GrGLPathFogGenProc) eglGetProcAddress("glPathFogGenNV");
- interface->fCoverFillPath = (GrGLCoverFillPathProc) eglGetProcAddress("glCoverFillPathNV");
- interface->fCoverStrokePath = (GrGLCoverStrokePathProc) eglGetProcAddress("glCoverStrokePathNV");
- interface->fCoverFillPathInstanced = (GrGLCoverFillPathInstancedProc) eglGetProcAddress("glCoverFillPathInstancedNV");
- interface->fCoverStrokePathInstanced = (GrGLCoverStrokePathInstancedProc) eglGetProcAddress("glCoverStrokePathInstancedNV");
- interface->fGetPathParameteriv = (GrGLGetPathParameterivProc) eglGetProcAddress("glGetPathParameterivNV");
- interface->fGetPathParameterfv = (GrGLGetPathParameterfvProc) eglGetProcAddress("glGetPathParameterfvNV");
- interface->fGetPathCommands = (GrGLGetPathCommandsProc) eglGetProcAddress("glGetPathCommandsNV");
- interface->fGetPathCoords = (GrGLGetPathCoordsProc) eglGetProcAddress("glGetPathCoordsNV");
- interface->fGetPathDashArray = (GrGLGetPathDashArrayProc) eglGetProcAddress("glGetPathDashArrayNV");
- interface->fGetPathMetrics = (GrGLGetPathMetricsProc) eglGetProcAddress("glGetPathMetricsNV");
- interface->fGetPathMetricRange = (GrGLGetPathMetricRangeProc) eglGetProcAddress("glGetPathMetricRangeNV");
- interface->fGetPathSpacing = (GrGLGetPathSpacingProc) eglGetProcAddress("glGetPathSpacingNV");
- interface->fGetPathColorGeniv = (GrGLGetPathColorGenivProc) eglGetProcAddress("glGetPathColorGenivNV");
- interface->fGetPathColorGenfv = (GrGLGetPathColorGenfvProc) eglGetProcAddress("glGetPathColorGenfvNV");
- interface->fGetPathTexGeniv = (GrGLGetPathTexGenivProc) eglGetProcAddress("glGetPathTexGenivNV");
- interface->fGetPathTexGenfv = (GrGLGetPathTexGenfvProc) eglGetProcAddress("glGetPathTexGenfvNV");
- interface->fIsPointInFillPath = (GrGLIsPointInFillPathProc) eglGetProcAddress("glIsPointInFillPathNV");
- interface->fIsPointInStrokePath = (GrGLIsPointInStrokePathProc) eglGetProcAddress("glIsPointInStrokePathNV");
- interface->fGetPathLength = (GrGLGetPathLengthProc) eglGetProcAddress("glGetPathLengthNV");
- interface->fPointAlongPath = (GrGLPointAlongPathProc) eglGetProcAddress("glPointAlongPathNV");
+ functions->fPathCommands = (GrGLPathCommandsProc) eglGetProcAddress("glPathCommandsNV");
+ functions->fPathCoords = (GrGLPathCoordsProc) eglGetProcAddress("glPathCoordsNV");
+ functions->fPathSubCommands = (GrGLPathSubCommandsProc) eglGetProcAddress("glPathSubCommandsNV");
+ functions->fPathSubCoords = (GrGLPathSubCoordsProc) eglGetProcAddress("glPathSubCoordsNV");
+ functions->fPathString = (GrGLPathStringProc) eglGetProcAddress("glPathStringNV");
+ functions->fPathGlyphs = (GrGLPathGlyphsProc) eglGetProcAddress("glPathGlyphsNV");
+ functions->fPathGlyphRange = (GrGLPathGlyphRangeProc) eglGetProcAddress("glPathGlyphRangeNV");
+ functions->fWeightPaths = (GrGLWeightPathsProc) eglGetProcAddress("glWeightPathsNV");
+ functions->fCopyPath = (GrGLCopyPathProc) eglGetProcAddress("glCopyPathNV");
+ functions->fInterpolatePaths = (GrGLInterpolatePathsProc) eglGetProcAddress("glInterpolatePathsNV");
+ functions->fTransformPath = (GrGLTransformPathProc) eglGetProcAddress("glTransformPathNV");
+ functions->fPathParameteriv = (GrGLPathParameterivProc) eglGetProcAddress("glPathParameterivNV");
+ functions->fPathParameteri = (GrGLPathParameteriProc) eglGetProcAddress("glPathParameteriNV");
+ functions->fPathParameterfv = (GrGLPathParameterfvProc) eglGetProcAddress("glPathParameterfvNV");
+ functions->fPathParameterf = (GrGLPathParameterfProc) eglGetProcAddress("glPathParameterfNV");
+ functions->fPathDashArray = (GrGLPathDashArrayProc) eglGetProcAddress("glPathDashArrayNV");
+ functions->fGenPaths = (GrGLGenPathsProc) eglGetProcAddress("glGenPathsNV");
+ functions->fDeletePaths = (GrGLDeletePathsProc) eglGetProcAddress("glDeletePathsNV");
+ functions->fIsPath = (GrGLIsPathProc) eglGetProcAddress("glIsPathNV");
+ functions->fPathStencilFunc = (GrGLPathStencilFuncProc) eglGetProcAddress("glPathStencilFuncNV");
+ functions->fPathStencilDepthOffset = (GrGLPathStencilDepthOffsetProc) eglGetProcAddress("glPathStencilDepthOffsetNV");
+ functions->fStencilFillPath = (GrGLStencilFillPathProc) eglGetProcAddress("glStencilFillPathNV");
+ functions->fStencilStrokePath = (GrGLStencilStrokePathProc) eglGetProcAddress("glStencilStrokePathNV");
+ functions->fStencilFillPathInstanced = (GrGLStencilFillPathInstancedProc) eglGetProcAddress("glStencilFillPathInstancedNV");
+ functions->fStencilStrokePathInstanced = (GrGLStencilStrokePathInstancedProc) eglGetProcAddress("glStencilStrokePathInstancedNV");
+ functions->fPathCoverDepthFunc = (GrGLPathCoverDepthFuncProc) eglGetProcAddress("glPathCoverDepthFuncNV");
+ functions->fPathColorGen = (GrGLPathColorGenProc) eglGetProcAddress("glPathColorGenNV");
+ functions->fPathTexGen = (GrGLPathTexGenProc) eglGetProcAddress("glPathTexGenNV");
+ functions->fPathFogGen = (GrGLPathFogGenProc) eglGetProcAddress("glPathFogGenNV");
+ functions->fCoverFillPath = (GrGLCoverFillPathProc) eglGetProcAddress("glCoverFillPathNV");
+ functions->fCoverStrokePath = (GrGLCoverStrokePathProc) eglGetProcAddress("glCoverStrokePathNV");
+ functions->fCoverFillPathInstanced = (GrGLCoverFillPathInstancedProc) eglGetProcAddress("glCoverFillPathInstancedNV");
+ functions->fCoverStrokePathInstanced = (GrGLCoverStrokePathInstancedProc) eglGetProcAddress("glCoverStrokePathInstancedNV");
+ functions->fGetPathParameteriv = (GrGLGetPathParameterivProc) eglGetProcAddress("glGetPathParameterivNV");
+ functions->fGetPathParameterfv = (GrGLGetPathParameterfvProc) eglGetProcAddress("glGetPathParameterfvNV");
+ functions->fGetPathCommands = (GrGLGetPathCommandsProc) eglGetProcAddress("glGetPathCommandsNV");
+ functions->fGetPathCoords = (GrGLGetPathCoordsProc) eglGetProcAddress("glGetPathCoordsNV");
+ functions->fGetPathDashArray = (GrGLGetPathDashArrayProc) eglGetProcAddress("glGetPathDashArrayNV");
+ functions->fGetPathMetrics = (GrGLGetPathMetricsProc) eglGetProcAddress("glGetPathMetricsNV");
+ functions->fGetPathMetricRange = (GrGLGetPathMetricRangeProc) eglGetProcAddress("glGetPathMetricRangeNV");
+ functions->fGetPathSpacing = (GrGLGetPathSpacingProc) eglGetProcAddress("glGetPathSpacingNV");
+ functions->fGetPathColorGeniv = (GrGLGetPathColorGenivProc) eglGetProcAddress("glGetPathColorGenivNV");
+ functions->fGetPathColorGenfv = (GrGLGetPathColorGenfvProc) eglGetProcAddress("glGetPathColorGenfvNV");
+ functions->fGetPathTexGeniv = (GrGLGetPathTexGenivProc) eglGetProcAddress("glGetPathTexGenivNV");
+ functions->fGetPathTexGenfv = (GrGLGetPathTexGenfvProc) eglGetProcAddress("glGetPathTexGenfvNV");
+ functions->fIsPointInFillPath = (GrGLIsPointInFillPathProc) eglGetProcAddress("glIsPointInFillPathNV");
+ functions->fIsPointInStrokePath = (GrGLIsPointInStrokePathProc) eglGetProcAddress("glIsPointInStrokePathNV");
+ functions->fGetPathLength = (GrGLGetPathLengthProc) eglGetProcAddress("glGetPathLengthNV");
+ functions->fPointAlongPath = (GrGLPointAlongPathProc) eglGetProcAddress("glPointAlongPathNV");
}
return interface;
#include "EGL/egl.h"
#define GET_PROC(name) \
- interface->f ## name = (GrGL ## name ## Proc) GetProcAddress(ghANGLELib, "gl" #name);
+ interface->fFunctions.f ## name = (GrGL ## name ## Proc) GetProcAddress(ghANGLELib, "gl" #name);
const GrGLInterface* GrGLCreateANGLEInterface() {
GrGLInterface* interface = SkNEW(GrGLInterface);
interface->fStandard = kGLES_GrGLStandard;
+ GrGLInterface::Functions* functions = &interface->fFunctions;
+
GET_PROC(ActiveTexture);
GET_PROC(AttachShader);
GET_PROC(BindAttribLocation);
GET_PROC(BindBuffer);
GET_PROC(BindTexture);
- interface->fBindVertexArray =
+ functions->fBindVertexArray =
(GrGLBindVertexArrayProc) eglGetProcAddress("glBindVertexArrayOES");
GET_PROC(BlendColor);
GET_PROC(BlendFunc);
GET_PROC(DeleteProgram);
GET_PROC(DeleteShader);
GET_PROC(DeleteTextures);
- interface->fDeleteVertexArrays =
+ functions->fDeleteVertexArrays =
(GrGLDeleteVertexArraysProc) eglGetProcAddress("glDeleteVertexArraysOES");
GET_PROC(DepthMask);
GET_PROC(Disable);
GET_PROC(GenBuffers);
GET_PROC(GenerateMipmap);
GET_PROC(GenTextures);
- interface->fGenVertexArrays =
+ functions->fGenVertexArrays =
(GrGLGenVertexArraysProc) eglGetProcAddress("glGenVertexArraysOES");
GET_PROC(GetBufferParameteriv);
GET_PROC(GetError);
#if GL_ARB_texture_storage
GET_PROC(TexStorage2D);
#elif GL_EXT_texture_storage
- interface->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT");
+ functions->fTexStorage2D = (GrGLTexStorage2DProc) eglGetProcAddress("glTexStorage2DEXT");
#endif
GET_PROC(Uniform1f);
GET_PROC(Uniform1i);
GET_PROC(GetRenderbufferParameteriv);
GET_PROC(RenderbufferStorage);
- interface->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES");
- interface->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES");
+ functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES");
+ functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES");
return interface;
}
GrGLInterface* interface = SkNEW(GrDebugGLInterface);
interface->fStandard = kGL_GrGLStandard;
- interface->fActiveTexture = debugGLActiveTexture;
- interface->fAttachShader = debugGLAttachShader;
- interface->fBeginQuery = debugGLBeginQuery;
- interface->fBindAttribLocation = debugGLBindAttribLocation;
- interface->fBindBuffer = debugGLBindBuffer;
- interface->fBindFragDataLocation = noOpGLBindFragDataLocation;
- interface->fBindTexture = debugGLBindTexture;
- interface->fBindVertexArray = debugGLBindVertexArray;
- interface->fBlendColor = noOpGLBlendColor;
- interface->fBlendFunc = noOpGLBlendFunc;
- interface->fBufferData = debugGLBufferData;
- interface->fBufferSubData = noOpGLBufferSubData;
- interface->fClear = noOpGLClear;
- interface->fClearColor = noOpGLClearColor;
- interface->fClearStencil = noOpGLClearStencil;
- interface->fClientActiveTexture = debugGLClientActiveTexture;
- interface->fColorMask = noOpGLColorMask;
- interface->fCompileShader = noOpGLCompileShader;
- interface->fCompressedTexImage2D = noOpGLCompressedTexImage2D;
- interface->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D;
- interface->fCreateProgram = debugGLCreateProgram;
- interface->fCreateShader = debugGLCreateShader;
- interface->fCullFace = noOpGLCullFace;
- interface->fDeleteBuffers = debugGLDeleteBuffers;
- interface->fDeleteProgram = debugGLDeleteProgram;
- interface->fDeleteQueries = noOpGLDeleteIds;
- interface->fDeleteShader = debugGLDeleteShader;
- interface->fDeleteTextures = debugGLDeleteTextures;
- interface->fDeleteVertexArrays = debugGLDeleteVertexArrays;
- interface->fDepthMask = noOpGLDepthMask;
- interface->fDisable = noOpGLDisable;
- interface->fDisableClientState = noOpGLDisableClientState;
- interface->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray;
- interface->fDrawArrays = noOpGLDrawArrays;
- interface->fDrawBuffer = noOpGLDrawBuffer;
- interface->fDrawBuffers = noOpGLDrawBuffers;
- interface->fDrawElements = noOpGLDrawElements;
- interface->fEnable = noOpGLEnable;
- interface->fEnableClientState = noOpGLEnableClientState;
- interface->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray;
- interface->fEndQuery = noOpGLEndQuery;
- interface->fFinish = noOpGLFinish;
- interface->fFlush = noOpGLFlush;
- interface->fFrontFace = noOpGLFrontFace;
- interface->fGenerateMipmap = debugGLGenerateMipmap;
- interface->fGenBuffers = debugGLGenBuffers;
- interface->fGenQueries = noOpGLGenIds;
- interface->fGenTextures = debugGLGenTextures;
- interface->fGetBufferParameteriv = debugGLGetBufferParameteriv;
- interface->fGetError = noOpGLGetError;
- interface->fGetIntegerv = noOpGLGetIntegerv;
- interface->fGetQueryObjecti64v = noOpGLGetQueryObjecti64v;
- interface->fGetQueryObjectiv = noOpGLGetQueryObjectiv;
- interface->fGetQueryObjectui64v = noOpGLGetQueryObjectui64v;
- interface->fGetQueryObjectuiv = noOpGLGetQueryObjectuiv;
- interface->fGetQueryiv = noOpGLGetQueryiv;
- interface->fGetProgramInfoLog = noOpGLGetInfoLog;
- interface->fGetProgramiv = noOpGLGetShaderOrProgramiv;
- interface->fGetShaderInfoLog = noOpGLGetInfoLog;
- interface->fGetShaderiv = noOpGLGetShaderOrProgramiv;
- interface->fGetString = noOpGLGetString;
- interface->fGetStringi = noOpGLGetStringi;
- interface->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv;
- interface->fGetUniformLocation = noOpGLGetUniformLocation;
- interface->fGenVertexArrays = debugGLGenVertexArrays;
- interface->fLoadIdentity = noOpGLLoadIdentity;
- interface->fLoadMatrixf = noOpGLLoadMatrixf;
- interface->fLineWidth = noOpGLLineWidth;
- interface->fLinkProgram = noOpGLLinkProgram;
- interface->fMatrixMode = noOpGLMatrixMode;
- interface->fPixelStorei = debugGLPixelStorei;
- interface->fQueryCounter = noOpGLQueryCounter;
- interface->fReadBuffer = noOpGLReadBuffer;
- interface->fReadPixels = debugGLReadPixels;
- interface->fScissor = noOpGLScissor;
- interface->fShaderSource = noOpGLShaderSource;
- interface->fStencilFunc = noOpGLStencilFunc;
- interface->fStencilFuncSeparate = noOpGLStencilFuncSeparate;
- interface->fStencilMask = noOpGLStencilMask;
- interface->fStencilMaskSeparate = noOpGLStencilMaskSeparate;
- interface->fStencilOp = noOpGLStencilOp;
- interface->fStencilOpSeparate = noOpGLStencilOpSeparate;
- interface->fTexGenf = noOpGLTexGenf;
- interface->fTexGenfv = noOpGLTexGenfv;
- interface->fTexGeni = noOpGLTexGeni;
- interface->fTexImage2D = noOpGLTexImage2D;
- interface->fTexParameteri = noOpGLTexParameteri;
- interface->fTexParameteriv = noOpGLTexParameteriv;
- interface->fTexSubImage2D = noOpGLTexSubImage2D;
- interface->fTexStorage2D = noOpGLTexStorage2D;
- interface->fDiscardFramebuffer = noOpGLDiscardFramebuffer;
- interface->fUniform1f = noOpGLUniform1f;
- interface->fUniform1i = noOpGLUniform1i;
- interface->fUniform1fv = noOpGLUniform1fv;
- interface->fUniform1iv = noOpGLUniform1iv;
- interface->fUniform2f = noOpGLUniform2f;
- interface->fUniform2i = noOpGLUniform2i;
- interface->fUniform2fv = noOpGLUniform2fv;
- interface->fUniform2iv = noOpGLUniform2iv;
- interface->fUniform3f = noOpGLUniform3f;
- interface->fUniform3i = noOpGLUniform3i;
- interface->fUniform3fv = noOpGLUniform3fv;
- interface->fUniform3iv = noOpGLUniform3iv;
- interface->fUniform4f = noOpGLUniform4f;
- interface->fUniform4i = noOpGLUniform4i;
- interface->fUniform4fv = noOpGLUniform4fv;
- interface->fUniform4iv = noOpGLUniform4iv;
- interface->fUniformMatrix2fv = noOpGLUniformMatrix2fv;
- interface->fUniformMatrix3fv = noOpGLUniformMatrix3fv;
- interface->fUniformMatrix4fv = noOpGLUniformMatrix4fv;
- interface->fUseProgram = debugGLUseProgram;
- interface->fVertexAttrib4fv = noOpGLVertexAttrib4fv;
- interface->fVertexAttribPointer = noOpGLVertexAttribPointer;
- interface->fVertexPointer = noOpGLVertexPointer;
- interface->fViewport = noOpGLViewport;
- interface->fBindFramebuffer = debugGLBindFramebuffer;
- interface->fBindRenderbuffer = debugGLBindRenderbuffer;
- interface->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus;
- interface->fDeleteFramebuffers = debugGLDeleteFramebuffers;
- interface->fDeleteRenderbuffers = debugGLDeleteRenderbuffers;
- interface->fFramebufferRenderbuffer = debugGLFramebufferRenderbuffer;
- interface->fFramebufferTexture2D = debugGLFramebufferTexture2D;
- interface->fGenFramebuffers = debugGLGenFramebuffers;
- interface->fGenRenderbuffers = debugGLGenRenderbuffers;
- interface->fGetFramebufferAttachmentParameteriv =
+
+ GrGLInterface::Functions* functions = &interface->fFunctions;
+ functions->fActiveTexture = debugGLActiveTexture;
+ functions->fAttachShader = debugGLAttachShader;
+ functions->fBeginQuery = debugGLBeginQuery;
+ functions->fBindAttribLocation = debugGLBindAttribLocation;
+ functions->fBindBuffer = debugGLBindBuffer;
+ functions->fBindFragDataLocation = noOpGLBindFragDataLocation;
+ functions->fBindTexture = debugGLBindTexture;
+ functions->fBindVertexArray = debugGLBindVertexArray;
+ functions->fBlendColor = noOpGLBlendColor;
+ functions->fBlendFunc = noOpGLBlendFunc;
+ functions->fBufferData = debugGLBufferData;
+ functions->fBufferSubData = noOpGLBufferSubData;
+ functions->fClear = noOpGLClear;
+ functions->fClearColor = noOpGLClearColor;
+ functions->fClearStencil = noOpGLClearStencil;
+ functions->fClientActiveTexture = debugGLClientActiveTexture;
+ functions->fColorMask = noOpGLColorMask;
+ functions->fCompileShader = noOpGLCompileShader;
+ functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D;
+ functions->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D;
+ functions->fCreateProgram = debugGLCreateProgram;
+ functions->fCreateShader = debugGLCreateShader;
+ functions->fCullFace = noOpGLCullFace;
+ functions->fDeleteBuffers = debugGLDeleteBuffers;
+ functions->fDeleteProgram = debugGLDeleteProgram;
+ functions->fDeleteQueries = noOpGLDeleteIds;
+ functions->fDeleteShader = debugGLDeleteShader;
+ functions->fDeleteTextures = debugGLDeleteTextures;
+ functions->fDeleteVertexArrays = debugGLDeleteVertexArrays;
+ functions->fDepthMask = noOpGLDepthMask;
+ functions->fDisable = noOpGLDisable;
+ functions->fDisableClientState = noOpGLDisableClientState;
+ functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray;
+ functions->fDrawArrays = noOpGLDrawArrays;
+ functions->fDrawBuffer = noOpGLDrawBuffer;
+ functions->fDrawBuffers = noOpGLDrawBuffers;
+ functions->fDrawElements = noOpGLDrawElements;
+ functions->fEnable = noOpGLEnable;
+ functions->fEnableClientState = noOpGLEnableClientState;
+ functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray;
+ functions->fEndQuery = noOpGLEndQuery;
+ functions->fFinish = noOpGLFinish;
+ functions->fFlush = noOpGLFlush;
+ functions->fFrontFace = noOpGLFrontFace;
+ functions->fGenerateMipmap = debugGLGenerateMipmap;
+ functions->fGenBuffers = debugGLGenBuffers;
+ functions->fGenQueries = noOpGLGenIds;
+ functions->fGenTextures = debugGLGenTextures;
+ functions->fGetBufferParameteriv = debugGLGetBufferParameteriv;
+ functions->fGetError = noOpGLGetError;
+ functions->fGetIntegerv = noOpGLGetIntegerv;
+ functions->fGetQueryObjecti64v = noOpGLGetQueryObjecti64v;
+ functions->fGetQueryObjectiv = noOpGLGetQueryObjectiv;
+ functions->fGetQueryObjectui64v = noOpGLGetQueryObjectui64v;
+ functions->fGetQueryObjectuiv = noOpGLGetQueryObjectuiv;
+ functions->fGetQueryiv = noOpGLGetQueryiv;
+ functions->fGetProgramInfoLog = noOpGLGetInfoLog;
+ functions->fGetProgramiv = noOpGLGetShaderOrProgramiv;
+ functions->fGetShaderInfoLog = noOpGLGetInfoLog;
+ functions->fGetShaderiv = noOpGLGetShaderOrProgramiv;
+ functions->fGetString = noOpGLGetString;
+ functions->fGetStringi = noOpGLGetStringi;
+ functions->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv;
+ functions->fGetUniformLocation = noOpGLGetUniformLocation;
+ functions->fGenVertexArrays = debugGLGenVertexArrays;
+ functions->fLoadIdentity = noOpGLLoadIdentity;
+ functions->fLoadMatrixf = noOpGLLoadMatrixf;
+ functions->fLineWidth = noOpGLLineWidth;
+ functions->fLinkProgram = noOpGLLinkProgram;
+ functions->fMatrixMode = noOpGLMatrixMode;
+ functions->fPixelStorei = debugGLPixelStorei;
+ functions->fQueryCounter = noOpGLQueryCounter;
+ functions->fReadBuffer = noOpGLReadBuffer;
+ functions->fReadPixels = debugGLReadPixels;
+ functions->fScissor = noOpGLScissor;
+ functions->fShaderSource = noOpGLShaderSource;
+ functions->fStencilFunc = noOpGLStencilFunc;
+ functions->fStencilFuncSeparate = noOpGLStencilFuncSeparate;
+ functions->fStencilMask = noOpGLStencilMask;
+ functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate;
+ functions->fStencilOp = noOpGLStencilOp;
+ functions->fStencilOpSeparate = noOpGLStencilOpSeparate;
+ functions->fTexGenf = noOpGLTexGenf;
+ functions->fTexGenfv = noOpGLTexGenfv;
+ functions->fTexGeni = noOpGLTexGeni;
+ functions->fTexImage2D = noOpGLTexImage2D;
+ functions->fTexParameteri = noOpGLTexParameteri;
+ functions->fTexParameteriv = noOpGLTexParameteriv;
+ functions->fTexSubImage2D = noOpGLTexSubImage2D;
+ functions->fTexStorage2D = noOpGLTexStorage2D;
+ functions->fDiscardFramebuffer = noOpGLDiscardFramebuffer;
+ functions->fUniform1f = noOpGLUniform1f;
+ functions->fUniform1i = noOpGLUniform1i;
+ functions->fUniform1fv = noOpGLUniform1fv;
+ functions->fUniform1iv = noOpGLUniform1iv;
+ functions->fUniform2f = noOpGLUniform2f;
+ functions->fUniform2i = noOpGLUniform2i;
+ functions->fUniform2fv = noOpGLUniform2fv;
+ functions->fUniform2iv = noOpGLUniform2iv;
+ functions->fUniform3f = noOpGLUniform3f;
+ functions->fUniform3i = noOpGLUniform3i;
+ functions->fUniform3fv = noOpGLUniform3fv;
+ functions->fUniform3iv = noOpGLUniform3iv;
+ functions->fUniform4f = noOpGLUniform4f;
+ functions->fUniform4i = noOpGLUniform4i;
+ functions->fUniform4fv = noOpGLUniform4fv;
+ functions->fUniform4iv = noOpGLUniform4iv;
+ functions->fUniformMatrix2fv = noOpGLUniformMatrix2fv;
+ functions->fUniformMatrix3fv = noOpGLUniformMatrix3fv;
+ functions->fUniformMatrix4fv = noOpGLUniformMatrix4fv;
+ functions->fUseProgram = debugGLUseProgram;
+ functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv;
+ functions->fVertexAttribPointer = noOpGLVertexAttribPointer;
+ functions->fVertexPointer = noOpGLVertexPointer;
+ functions->fViewport = noOpGLViewport;
+ functions->fBindFramebuffer = debugGLBindFramebuffer;
+ functions->fBindRenderbuffer = debugGLBindRenderbuffer;
+ functions->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus;
+ functions->fDeleteFramebuffers = debugGLDeleteFramebuffers;
+ functions->fDeleteRenderbuffers = debugGLDeleteRenderbuffers;
+ functions->fFramebufferRenderbuffer = debugGLFramebufferRenderbuffer;
+ functions->fFramebufferTexture2D = debugGLFramebufferTexture2D;
+ functions->fGenFramebuffers = debugGLGenFramebuffers;
+ functions->fGenRenderbuffers = debugGLGenRenderbuffers;
+ functions->fGetFramebufferAttachmentParameteriv =
noOpGLGetFramebufferAttachmentParameteriv;
- interface->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteriv;
- interface->fRenderbufferStorage = noOpGLRenderbufferStorage;
- interface->fRenderbufferStorageMultisample =
+ functions->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteriv;
+ functions->fRenderbufferStorage = noOpGLRenderbufferStorage;
+ functions->fRenderbufferStorageMultisample =
noOpGLRenderbufferStorageMultisample;
- interface->fBlitFramebuffer = noOpGLBlitFramebuffer;
- interface->fResolveMultisampleFramebuffer =
+ functions->fBlitFramebuffer = noOpGLBlitFramebuffer;
+ functions->fResolveMultisampleFramebuffer =
noOpGLResolveMultisampleFramebuffer;
- interface->fMapBuffer = debugGLMapBuffer;
- interface->fUnmapBuffer = debugGLUnmapBuffer;
- interface->fBindFragDataLocationIndexed =
+ functions->fMapBuffer = debugGLMapBuffer;
+ functions->fUnmapBuffer = debugGLUnmapBuffer;
+ functions->fBindFragDataLocationIndexed =
noOpGLBindFragDataLocationIndexed;
return interface;
const GrGLInterface* GrGLCreateNativeInterface() {
GrGLInterface* interface = SkNEW(GrGLInterface);
- interface->fActiveTexture = glActiveTexture;
- interface->fAttachShader = glAttachShader;
- interface->fBindAttribLocation = glBindAttribLocation;
- interface->fBindBuffer = glBindBuffer;
- interface->fBindTexture = glBindTexture;
- interface->fBlendColor = glBlendColor;
- interface->fBlendFunc = glBlendFunc;
- interface->fBufferData = (GrGLBufferDataProc)glBufferData;
- interface->fBufferSubData = (GrGLBufferSubDataProc)glBufferSubData;
- interface->fClear = glClear;
- interface->fClearColor = glClearColor;
- interface->fClearStencil = glClearStencil;
- interface->fColorMask = glColorMask;
- interface->fCompileShader = glCompileShader;
- interface->fCompressedTexImage2D = glCompressedTexImage2D;
- interface->fCopyTexSubImage2D = glCopyTexSubImage2D;
- interface->fCreateProgram = glCreateProgram;
- interface->fCreateShader = glCreateShader;
- interface->fCullFace = glCullFace;
- interface->fDeleteBuffers = glDeleteBuffers;
- interface->fDeleteProgram = glDeleteProgram;
- interface->fDeleteShader = glDeleteShader;
- interface->fDeleteTextures = glDeleteTextures;
- interface->fDepthMask = glDepthMask;
- interface->fDisable = glDisable;
- interface->fDisableVertexAttribArray = glDisableVertexAttribArray;
- interface->fDrawArrays = glDrawArrays;
- interface->fDrawBuffer = NULL;
- interface->fDrawBuffers = NULL;
- interface->fDrawElements = glDrawElements;
- interface->fEnable = glEnable;
- interface->fEnableVertexAttribArray = glEnableVertexAttribArray;
- interface->fFinish = glFinish;
- interface->fFlush = glFlush;
- interface->fFrontFace = glFrontFace;
- interface->fGenBuffers = glGenBuffers;
- interface->fGenerateMipmap = glGenerateMipmap;
- interface->fGetBufferParameteriv = glGetBufferParameteriv;
- interface->fGetError = glGetError;
- interface->fGetIntegerv = glGetIntegerv;
- interface->fGetProgramInfoLog = glGetProgramInfoLog;
- interface->fGetProgramiv = glGetProgramiv;
- interface->fGetShaderInfoLog = glGetShaderInfoLog;
- interface->fGetShaderiv = glGetShaderiv;
- interface->fGetString = glGetString;
- interface->fGenTextures = glGenTextures;
- interface->fGetUniformLocation = glGetUniformLocation;
- interface->fLineWidth = glLineWidth;
- interface->fLinkProgram = glLinkProgram;
- interface->fPixelStorei = glPixelStorei;
- interface->fReadBuffer = NULL;
- interface->fReadPixels = glReadPixels;
- interface->fScissor = glScissor;
- interface->fShaderSource = glShaderSource;
- interface->fStencilFunc = glStencilFunc;
- interface->fStencilFuncSeparate = glStencilFuncSeparate;
- interface->fStencilMask = glStencilMask;
- interface->fStencilMaskSeparate = glStencilMaskSeparate;
- interface->fStencilOp = glStencilOp;
- interface->fStencilOpSeparate = glStencilOpSeparate;
+ functions->fActiveTexture = glActiveTexture;
+ functions->fAttachShader = glAttachShader;
+ functions->fBindAttribLocation = glBindAttribLocation;
+ functions->fBindBuffer = glBindBuffer;
+ functions->fBindTexture = glBindTexture;
+ functions->fBlendColor = glBlendColor;
+ functions->fBlendFunc = glBlendFunc;
+ functions->fBufferData = (GrGLBufferDataProc)glBufferData;
+ functions->fBufferSubData = (GrGLBufferSubDataProc)glBufferSubData;
+ functions->fClear = glClear;
+ functions->fClearColor = glClearColor;
+ functions->fClearStencil = glClearStencil;
+ functions->fColorMask = glColorMask;
+ functions->fCompileShader = glCompileShader;
+ functions->fCompressedTexImage2D = glCompressedTexImage2D;
+ functions->fCopyTexSubImage2D = glCopyTexSubImage2D;
+ functions->fCreateProgram = glCreateProgram;
+ functions->fCreateShader = glCreateShader;
+ functions->fCullFace = glCullFace;
+ functions->fDeleteBuffers = glDeleteBuffers;
+ functions->fDeleteProgram = glDeleteProgram;
+ functions->fDeleteShader = glDeleteShader;
+ functions->fDeleteTextures = glDeleteTextures;
+ functions->fDepthMask = glDepthMask;
+ functions->fDisable = glDisable;
+ functions->fDisableVertexAttribArray = glDisableVertexAttribArray;
+ functions->fDrawArrays = glDrawArrays;
+ functions->fDrawBuffer = NULL;
+ functions->fDrawBuffers = NULL;
+ functions->fDrawElements = glDrawElements;
+ functions->fEnable = glEnable;
+ functions->fEnableVertexAttribArray = glEnableVertexAttribArray;
+ functions->fFinish = glFinish;
+ functions->fFlush = glFlush;
+ functions->fFrontFace = glFrontFace;
+ functions->fGenBuffers = glGenBuffers;
+ functions->fGenerateMipmap = glGenerateMipmap;
+ functions->fGetBufferParameteriv = glGetBufferParameteriv;
+ functions->fGetError = glGetError;
+ functions->fGetIntegerv = glGetIntegerv;
+ functions->fGetProgramInfoLog = glGetProgramInfoLog;
+ functions->fGetProgramiv = glGetProgramiv;
+ functions->fGetShaderInfoLog = glGetShaderInfoLog;
+ functions->fGetShaderiv = glGetShaderiv;
+ functions->fGetString = glGetString;
+ functions->fGenTextures = glGenTextures;
+ functions->fGetUniformLocation = glGetUniformLocation;
+ functions->fLineWidth = glLineWidth;
+ functions->fLinkProgram = glLinkProgram;
+ functions->fPixelStorei = glPixelStorei;
+ functions->fReadBuffer = NULL;
+ functions->fReadPixels = glReadPixels;
+ functions->fScissor = glScissor;
+ functions->fShaderSource = glShaderSource;
+ functions->fStencilFunc = glStencilFunc;
+ functions->fStencilFuncSeparate = glStencilFuncSeparate;
+ functions->fStencilMask = glStencilMask;
+ functions->fStencilMaskSeparate = glStencilMaskSeparate;
+ functions->fStencilOp = glStencilOp;
+ functions->fStencilOpSeparate = glStencilOpSeparate;
// mac uses GLenum for internalFormat param (non-standard)
// amounts to int vs. uint.
- interface->fTexImage2D = (GrGLTexImage2DProc)glTexImage2D;
+ functions->fTexImage2D = (GrGLTexImage2DProc)glTexImage2D;
#if GL_ARB_texture_storage
- interface->fTexStorage2D = glTexStorage2D;
+ functions->fTexStorage2D = glTexStorage2D;
#elif GL_EXT_texture_storage
- interface->fTexStorage2D = glTexStorage2DEXT;
+ functions->fTexStorage2D = glTexStorage2DEXT;
#endif
#if GL_EXT_discard_framebuffer
- interface->fDiscardFramebuffer = glDiscardFramebufferEXT;
+ functions->fDiscardFramebuffer = glDiscardFramebufferEXT;
#endif
- interface->fTexParameteri = glTexParameteri;
- interface->fTexParameteriv = glTexParameteriv;
- interface->fTexSubImage2D = glTexSubImage2D;
- interface->fUniform1f = glUniform1f;
- interface->fUniform1i = glUniform1i;
- interface->fUniform1fv = glUniform1fv;
- interface->fUniform1iv = glUniform1iv;
- interface->fUniform2f = glUniform2f;
- interface->fUniform2i = glUniform2i;
- interface->fUniform2fv = glUniform2fv;
- interface->fUniform2iv = glUniform2iv;
- interface->fUniform3f = glUniform3f;
- interface->fUniform3i = glUniform3i;
- interface->fUniform3fv = glUniform3fv;
- interface->fUniform3iv = glUniform3iv;
- interface->fUniform4f = glUniform4f;
- interface->fUniform4i = glUniform4i;
- interface->fUniform4fv = glUniform4fv;
- interface->fUniform4iv = glUniform4iv;
- interface->fUniform4fv = glUniform4fv;
- interface->fUniformMatrix2fv = glUniformMatrix2fv;
- interface->fUniformMatrix3fv = glUniformMatrix3fv;
- interface->fUniformMatrix4fv = glUniformMatrix4fv;
- interface->fUseProgram = glUseProgram;
- interface->fVertexAttrib4fv = glVertexAttrib4fv;
- interface->fVertexAttribPointer = glVertexAttribPointer;
- interface->fViewport = glViewport;
- interface->fGenFramebuffers = glGenFramebuffers;
- interface->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameteriv;
- interface->fGetRenderbufferParameteriv = glGetRenderbufferParameteriv;
- interface->fBindFramebuffer = glBindFramebuffer;
- interface->fFramebufferTexture2D = glFramebufferTexture2D;
- interface->fCheckFramebufferStatus = glCheckFramebufferStatus;
- interface->fDeleteFramebuffers = glDeleteFramebuffers;
- interface->fRenderbufferStorage = glRenderbufferStorage;
- interface->fGenRenderbuffers = glGenRenderbuffers;
- interface->fDeleteRenderbuffers = glDeleteRenderbuffers;
- interface->fFramebufferRenderbuffer = glFramebufferRenderbuffer;
- interface->fBindRenderbuffer = glBindRenderbuffer;
+ functions->fTexParameteri = glTexParameteri;
+ functions->fTexParameteriv = glTexParameteriv;
+ functions->fTexSubImage2D = glTexSubImage2D;
+ functions->fUniform1f = glUniform1f;
+ functions->fUniform1i = glUniform1i;
+ functions->fUniform1fv = glUniform1fv;
+ functions->fUniform1iv = glUniform1iv;
+ functions->fUniform2f = glUniform2f;
+ functions->fUniform2i = glUniform2i;
+ functions->fUniform2fv = glUniform2fv;
+ functions->fUniform2iv = glUniform2iv;
+ functions->fUniform3f = glUniform3f;
+ functions->fUniform3i = glUniform3i;
+ functions->fUniform3fv = glUniform3fv;
+ functions->fUniform3iv = glUniform3iv;
+ functions->fUniform4f = glUniform4f;
+ functions->fUniform4i = glUniform4i;
+ functions->fUniform4fv = glUniform4fv;
+ functions->fUniform4iv = glUniform4iv;
+ functions->fUniform4fv = glUniform4fv;
+ functions->fUniformMatrix2fv = glUniformMatrix2fv;
+ functions->fUniformMatrix3fv = glUniformMatrix3fv;
+ functions->fUniformMatrix4fv = glUniformMatrix4fv;
+ functions->fUseProgram = glUseProgram;
+ functions->fVertexAttrib4fv = glVertexAttrib4fv;
+ functions->fVertexAttribPointer = glVertexAttribPointer;
+ functions->fViewport = glViewport;
+ functions->fGenFramebuffers = glGenFramebuffers;
+ functions->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameteriv;
+ functions->fGetRenderbufferParameteriv = glGetRenderbufferParameteriv;
+ functions->fBindFramebuffer = glBindFramebuffer;
+ functions->fFramebufferTexture2D = glFramebufferTexture2D;
+ functions->fCheckFramebufferStatus = glCheckFramebufferStatus;
+ functions->fDeleteFramebuffers = glDeleteFramebuffers;
+ functions->fRenderbufferStorage = glRenderbufferStorage;
+ functions->fGenRenderbuffers = glGenRenderbuffers;
+ functions->fDeleteRenderbuffers = glDeleteRenderbuffers;
+ functions->fFramebufferRenderbuffer = glFramebufferRenderbuffer;
+ functions->fBindRenderbuffer = glBindRenderbuffer;
#if GL_OES_mapbuffer
- interface->fMapBuffer = glMapBufferOES;
- interface->fUnmapBuffer = glUnmapBufferOES;
+ functions->fMapBuffer = glMapBufferOES;
+ functions->fUnmapBuffer = glUnmapBufferOES;
#endif
#if GL_APPLE_framebuffer_multisample
- interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleAPPLE;
- interface->fResolveMultisampleFramebuffer = glResolveMultisampleFramebufferAPPLE;
+ functions->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleAPPLE;
+ functions->fResolveMultisampleFramebuffer = glResolveMultisampleFramebufferAPPLE;
#endif
#if GL_OES_vertex_array_object
- interface->fBindVertexArray = glBindVertexArrayOES;
- interface->fDeleteVertexArrays = glDeleteVertexArraysOES;
- interface->fGenVertexArrays = glGenVertexArraysOES;
+ functions->fBindVertexArray = glBindVertexArrayOES;
+ functions->fDeleteVertexArrays = glDeleteVertexArraysOES;
+ functions->fGenVertexArrays = glGenVertexArraysOES;
#endif
interface->fStandard = kGLES_GrGLStandard;
return dlsym(gLoader.handle(), name);
}
-#define GET_PROC(name) (interface->f ## name = ((GrGL ## name ## Proc) GetProcAddress("gl" #name)))
-#define GET_PROC_SUFFIX(name, suffix) (interface->f ## name = ((GrGL ## name ## Proc) GetProcAddress("gl" #name #suffix)))
+#define GET_PROC(name) (interface->fFunctions.f ## name = ((GrGL ## name ## Proc) GetProcAddress("gl" #name)))
+#define GET_PROC_SUFFIX(name, suffix) (interface->fFunctions.f ## name = ((GrGL ## name ## Proc) GetProcAddress("gl" #name #suffix)))
const GrGLInterface* GrGLCreateNativeInterface() {
#define GL_GLEXT_PROTOTYPES
#include "osmesa_wrapper.h"
-#define GR_GL_GET_PROC(F) interface->f ## F = (GrGL ## F ## Proc) \
+#define GR_GL_GET_PROC(F) interface->fFunctions.f ## F = (GrGL ## F ## Proc) \
OSMesaGetProcAddress("gl" #F);
-#define GR_GL_GET_PROC_SUFFIX(F, S) interface->f ## F = (GrGL ## F ## Proc) \
+#define GR_GL_GET_PROC_SUFFIX(F, S) interface->fFunctions.f ## F = (GrGL ## F ## Proc) \
OSMesaGetProcAddress("gl" #F #S);
// We use OSMesaGetProcAddress for every gl function to avoid accidentally using
GR_GL_GET_PROC(TexParameteri);
GR_GL_GET_PROC(TexParameteriv);
GR_GL_GET_PROC(TexStorage2D);
- if (NULL == interface->fTexStorage2D) {
+ if (NULL == interface->fFunctions.fTexStorage2D) {
GR_GL_GET_PROC_SUFFIX(TexStorage2D, EXT);
}
GR_GL_GET_PROC(TexSubImage2D);
#include <GL/glext.h>
#include <GL/glu.h>
-#define GR_GL_GET_PROC(F) interface->f ## F = (GrGL ## F ## Proc) \
+#define GR_GL_GET_PROC(F) interface->fFunctions.f ## F = (GrGL ## F ## Proc) \
glXGetProcAddress(reinterpret_cast<const GLubyte*>("gl" #F));
-#define GR_GL_GET_PROC_SUFFIX(F, S) interface->f ## F = (GrGL ## F ## Proc) \
+#define GR_GL_GET_PROC_SUFFIX(F, S) interface->fFunctions.f ## F = (GrGL ## F ## Proc) \
glXGetProcAddress(reinterpret_cast<const GLubyte*>("gl" #F #S));
const GrGLInterface* GrGLCreateNativeInterface() {
}
GrGLInterface* interface = SkNEW(GrGLInterface());
+ GrGLInterface::Functions* functions = &interface->fFunctions;
- interface->fActiveTexture = glActiveTexture;
+ functions->fActiveTexture = glActiveTexture;
GR_GL_GET_PROC(AttachShader);
GR_GL_GET_PROC(BindAttribLocation);
GR_GL_GET_PROC(BindBuffer);
GR_GL_GET_PROC(BindFragDataLocation);
GR_GL_GET_PROC(BeginQuery);
- interface->fBindTexture = glBindTexture;
- interface->fBlendFunc = glBlendFunc;
+ functions->fBindTexture = glBindTexture;
+ functions->fBlendFunc = glBlendFunc;
if (glVer >= GR_GL_VER(1,4) ||
extensions.has("GL_ARB_imaging") ||
GR_GL_GET_PROC(BufferData);
GR_GL_GET_PROC(BufferSubData);
- interface->fClear = glClear;
- interface->fClearColor = glClearColor;
- interface->fClearStencil = glClearStencil;
- interface->fClientActiveTexture = glClientActiveTexture;
- interface->fColorMask = glColorMask;
+ functions->fClear = glClear;
+ functions->fClearColor = glClearColor;
+ functions->fClearStencil = glClearStencil;
+ functions->fClientActiveTexture = glClientActiveTexture;
+ functions->fColorMask = glColorMask;
GR_GL_GET_PROC(CompileShader);
- interface->fCompressedTexImage2D = glCompressedTexImage2D;
- interface->fCopyTexSubImage2D = glCopyTexSubImage2D;
+ functions->fCompressedTexImage2D = glCompressedTexImage2D;
+ functions->fCopyTexSubImage2D = glCopyTexSubImage2D;
GR_GL_GET_PROC(CreateProgram);
GR_GL_GET_PROC(CreateShader);
- interface->fCullFace = glCullFace;
+ functions->fCullFace = glCullFace;
GR_GL_GET_PROC(DeleteBuffers);
GR_GL_GET_PROC(DeleteProgram);
GR_GL_GET_PROC(DeleteQueries);
GR_GL_GET_PROC(DeleteShader);
- interface->fDeleteTextures = glDeleteTextures;
- interface->fDepthMask = glDepthMask;
- interface->fDisable = glDisable;
- interface->fDisableClientState = glDisableClientState;
+ functions->fDeleteTextures = glDeleteTextures;
+ functions->fDepthMask = glDepthMask;
+ functions->fDisable = glDisable;
+ functions->fDisableClientState = glDisableClientState;
GR_GL_GET_PROC(DisableVertexAttribArray);
- interface->fDrawArrays = glDrawArrays;
- interface->fDrawBuffer = glDrawBuffer;
+ functions->fDrawArrays = glDrawArrays;
+ functions->fDrawBuffer = glDrawBuffer;
GR_GL_GET_PROC(DrawBuffers);
- interface->fDrawElements = glDrawElements;
- interface->fEnable = glEnable;
- interface->fEnableClientState = glEnableClientState;
+ functions->fDrawElements = glDrawElements;
+ functions->fEnable = glEnable;
+ functions->fEnableClientState = glEnableClientState;
GR_GL_GET_PROC(EnableVertexAttribArray);
GR_GL_GET_PROC(EndQuery);
- interface->fFinish = glFinish;
- interface->fFlush = glFlush;
- interface->fFrontFace = glFrontFace;
+ functions->fFinish = glFinish;
+ functions->fFlush = glFlush;
+ functions->fFrontFace = glFrontFace;
GR_GL_GET_PROC(GenBuffers);
GR_GL_GET_PROC(GenerateMipmap);
GR_GL_GET_PROC(GetBufferParameteriv);
- interface->fGetError = glGetError;
- interface->fGetIntegerv = glGetIntegerv;
+ functions->fGetError = glGetError;
+ functions->fGetIntegerv = glGetIntegerv;
GR_GL_GET_PROC(GetQueryObjectiv);
GR_GL_GET_PROC(GetQueryObjectuiv);
if (glVer >= GR_GL_VER(3,3) || extensions.has("GL_ARB_timer_query")) {
GR_GL_GET_PROC(GetProgramiv);
GR_GL_GET_PROC(GetShaderInfoLog);
GR_GL_GET_PROC(GetShaderiv);
- interface->fGetString = glGetString;
+ functions->fGetString = glGetString;
GR_GL_GET_PROC(GetStringi);
- interface->fGetTexLevelParameteriv = glGetTexLevelParameteriv;
+ functions->fGetTexLevelParameteriv = glGetTexLevelParameteriv;
GR_GL_GET_PROC(GenQueries);
- interface->fGenTextures = glGenTextures;
+ functions->fGenTextures = glGenTextures;
GR_GL_GET_PROC(GetUniformLocation);
- interface->fLineWidth = glLineWidth;
+ functions->fLineWidth = glLineWidth;
GR_GL_GET_PROC(LinkProgram);
GR_GL_GET_PROC(MapBuffer);
- interface->fPixelStorei = glPixelStorei;
- interface->fReadBuffer = glReadBuffer;
- interface->fReadPixels = glReadPixels;
- interface->fScissor = glScissor;
+ functions->fPixelStorei = glPixelStorei;
+ functions->fReadBuffer = glReadBuffer;
+ functions->fReadPixels = glReadPixels;
+ functions->fScissor = glScissor;
GR_GL_GET_PROC(ShaderSource);
- interface->fStencilFunc = glStencilFunc;
+ functions->fStencilFunc = glStencilFunc;
GR_GL_GET_PROC(StencilFuncSeparate);
- interface->fStencilMask = glStencilMask;
+ functions->fStencilMask = glStencilMask;
GR_GL_GET_PROC(StencilMaskSeparate);
- interface->fStencilOp = glStencilOp;
+ functions->fStencilOp = glStencilOp;
GR_GL_GET_PROC(StencilOpSeparate);
- interface->fTexImage2D = glTexImage2D;
- interface->fTexGenf = glTexGenf;
- interface->fTexGenfv = glTexGenfv;
- interface->fTexGeni = glTexGeni;
- interface->fTexParameteri = glTexParameteri;
- interface->fTexParameteriv = glTexParameteriv;
+ functions->fTexImage2D = glTexImage2D;
+ functions->fTexGenf = glTexGenf;
+ functions->fTexGenfv = glTexGenfv;
+ functions->fTexGeni = glTexGeni;
+ functions->fTexParameteri = glTexParameteri;
+ functions->fTexParameteriv = glTexParameteriv;
if (glVer >= GR_GL_VER(4,2) || extensions.has("GL_ARB_texture_storage")) {
GR_GL_GET_PROC(TexStorage2D);
} else if (extensions.has("GL_EXT_texture_storage")) {
GR_GL_GET_PROC_SUFFIX(TexStorage2D, EXT);
}
- interface->fTexSubImage2D = glTexSubImage2D;
+ functions->fTexSubImage2D = glTexSubImage2D;
GR_GL_GET_PROC(Uniform1f);
GR_GL_GET_PROC(Uniform1i);
GR_GL_GET_PROC(Uniform1fv);
GR_GL_GET_PROC(VertexAttrib4fv);
GR_GL_GET_PROC(VertexAttribPointer);
GR_GL_GET_PROC(VertexPointer);
- interface->fViewport = glViewport;
+ functions->fViewport = glViewport;
GR_GL_GET_PROC(BindFragDataLocationIndexed);
if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_vertex_array_object")) {
* Otherwise, a springboard would be needed that hides the calling convention.
*/
-#define SET_PROC(F) interface->f ## F = (GrGL ## F ## Proc) GetProcAddress(alu.get(), "gl" #F);
-#define WGL_SET_PROC(F) interface->f ## F = (GrGL ## F ## Proc) wglGetProcAddress("gl" #F);
-#define WGL_SET_PROC_SUFFIX(F, S) interface->f ## F = \
- (GrGL ## F ## Proc) wglGetProcAddress("gl" #F #S);
+#define SET_PROC(F) interface->fFunctions.f ## F = (GrGL ## F ## Proc) GetProcAddress(alu.get(), "gl" #F);
+#define WGL_SET_PROC(F) interface->fFunctions.f ## F = (GrGL ## F ## Proc) wglGetProcAddress("gl" #F);
+#define WGL_SET_PROC_SUFFIX(F, S) interface->fFunctions.f ## F = (GrGL ## F ## Proc) wglGetProcAddress("gl" #F #S);
class AutoLibraryUnload {
public:
#define ANGLE_GL_CALL(IFACE, X) \
do { \
- (IFACE)->f##X; \
+ (IFACE)->fFunctions.f##X; \
} while (false)
#endif