GrGLInterface.h revision 46fbfe0cd1bbe60fd15ce52e784f5d51450ff5fd
159a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com
2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com/*
3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Copyright 2011 Google Inc.
4ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com *
5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Use of this source code is governed by a BSD-style license that can be
6ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * found in the LICENSE file.
759a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com */
859a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com
959a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com
1059a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com#ifndef GrGLInterface_DEFINED
1159a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com#define GrGLInterface_DEFINED
1259a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com
13637d5e929708db8eace06b81fa3049141f9a07efbsalomon@google.com#include "GrGLFunctions.h"
140b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com#include "GrRefCnt.h"
1559a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com
1659a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com////////////////////////////////////////////////////////////////////////////////
1759a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com
1859a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com/**
1989ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com * Classifies GL contexts (currently as Desktop vs. ES2). This is a bitfield.
2089ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com * A GrGLInterface (defined below) may support multiple bindings.
2189ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com */
2289ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.comenum GrGLBinding {
2389ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com    kNone_GrGLBinding = 0x0,
2489ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com
2589ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com    kDesktop_GrGLBinding = 0x01,
26eb170703fcd46bba729f2fdf7cd32460baaaaf06bsalomon@google.com    kES_GrGLBinding = 0x02,  // ES2+ only
2789ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com
2889ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com    // for iteration of GrGLBindings
29b447d215772a5984dc776a8dc058e0711d566c04bsalomon@google.com    kFirstGrGLBinding = kDesktop_GrGLBinding,
30eb170703fcd46bba729f2fdf7cd32460baaaaf06bsalomon@google.com    kLastGrGLBinding = kES_GrGLBinding
3189ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com};
3289ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com
3346b450a04973a0869c3e4c5fce1dc5bdb77042aabsalomon@google.com// Temporary alias until Chromium can be updated.
3446b450a04973a0869c3e4c5fce1dc5bdb77042aabsalomon@google.comstatic const GrGLBinding kES2_GrGLBinding = kES_GrGLBinding;
3546b450a04973a0869c3e4c5fce1dc5bdb77042aabsalomon@google.com
3689ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com////////////////////////////////////////////////////////////////////////////////
3789ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com
3889ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com/**
390b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com * Rather than depend on platform-specific GL headers and libraries, we require
400b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com * the client to provide a struct of GL function pointers. This struct can be
410b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com * specified per-GrContext as a parameter to GrContext::Create. If NULL is
420b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com * passed to Create then the "default" GL interface is used. If the default is
430b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com * also NULL GrContext creation will fail.
440b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com *
456fb736fc2ea5f3f7ac44494211cc6755180ca192bsalomon@google.com * The default interface is returned by GrGLDefaultInterface. This function's
460da3719050473344b6013fd7b614611984f20effrobertphillips@google.com * implementation is platform-specific. Several have been provided, along with
470da3719050473344b6013fd7b614611984f20effrobertphillips@google.com * an implementation that simply returns NULL. It is implementation-specific
486fb736fc2ea5f3f7ac44494211cc6755180ca192bsalomon@google.com * whether the same GrGLInterface is returned or whether a new one is created
496fb736fc2ea5f3f7ac44494211cc6755180ca192bsalomon@google.com * at each call. Some platforms may not be able to use a single GrGLInterface
506fb736fc2ea5f3f7ac44494211cc6755180ca192bsalomon@google.com * because extension function ptrs vary across contexts. Note that GrGLInterface
51fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com * is ref-counted. So if the same object is returned by multiple calls to
526fb736fc2ea5f3f7ac44494211cc6755180ca192bsalomon@google.com * GrGLDefaultInterface, each should bump the ref count.
5356bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com *
5456bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com * By defining GR_GL_PER_GL_CALL_IFACE_CALLBACK to 1 the client can specify a
5556bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com * callback function that will be called prior to each GL function call. See
5656bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com * comments in GrGLConfig.h
5759a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com */
580b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com
5959a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.comstruct GrGLInterface;
6059a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com
616fb736fc2ea5f3f7ac44494211cc6755180ca192bsalomon@google.comconst GrGLInterface* GrGLDefaultInterface();
6259a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com
6357f5d9854bfc78c347cb587e044fb3950f9ad298bsalomon@google.com/**
6457f5d9854bfc78c347cb587e044fb3950f9ad298bsalomon@google.com * Creates a GrGLInterface for a "native" GL context (e.g. WGL on windows,
6557f5d9854bfc78c347cb587e044fb3950f9ad298bsalomon@google.com * GLX on linux, AGL on Mac). On platforms that have context-specific function
66fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com * pointers for GL extensions (e.g. windows) the returned interface is only
6757f5d9854bfc78c347cb587e044fb3950f9ad298bsalomon@google.com * valid for the context that was current at creation.
6857f5d9854bfc78c347cb587e044fb3950f9ad298bsalomon@google.com */
69373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.comconst GrGLInterface* GrGLCreateNativeInterface();
70373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.com
71d3b9fbbc48c13a1b2a664cf7e01374a44c201f51robertphillips@google.com#if SK_MESA
7257f5d9854bfc78c347cb587e044fb3950f9ad298bsalomon@google.com/**
7357f5d9854bfc78c347cb587e044fb3950f9ad298bsalomon@google.com * Creates a GrGLInterface for an OSMesa context.
7457f5d9854bfc78c347cb587e044fb3950f9ad298bsalomon@google.com */
75373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.comconst GrGLInterface* GrGLCreateMesaInterface();
76d3b9fbbc48c13a1b2a664cf7e01374a44c201f51robertphillips@google.com#endif
77d3b9fbbc48c13a1b2a664cf7e01374a44c201f51robertphillips@google.com
78d3b9fbbc48c13a1b2a664cf7e01374a44c201f51robertphillips@google.com#if SK_ANGLE
79d3b9fbbc48c13a1b2a664cf7e01374a44c201f51robertphillips@google.com/**
80d3b9fbbc48c13a1b2a664cf7e01374a44c201f51robertphillips@google.com * Creates a GrGLInterface for an ANGLE context.
81d3b9fbbc48c13a1b2a664cf7e01374a44c201f51robertphillips@google.com */
82d3b9fbbc48c13a1b2a664cf7e01374a44c201f51robertphillips@google.comconst GrGLInterface* GrGLCreateANGLEInterface();
83d3b9fbbc48c13a1b2a664cf7e01374a44c201f51robertphillips@google.com#endif
84373a6635b7190b4af4d265fdd4b70f102ec3a6fdbsalomon@google.com
8574913722bfe5e4b6810545891958e3d8e9c63791bsalomon@google.com/**
8674913722bfe5e4b6810545891958e3d8e9c63791bsalomon@google.com * Creates a null GrGLInterface that doesn't draw anything. Used for measuring
8774913722bfe5e4b6810545891958e3d8e9c63791bsalomon@google.com * CPU overhead.
8874913722bfe5e4b6810545891958e3d8e9c63791bsalomon@google.com */
8974913722bfe5e4b6810545891958e3d8e9c63791bsalomon@google.comconst GrGLInterface* GrGLCreateNullInterface();
9074913722bfe5e4b6810545891958e3d8e9c63791bsalomon@google.com
910da3719050473344b6013fd7b614611984f20effrobertphillips@google.com/**
92fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com * Creates a debugging GrGLInterface that doesn't draw anything. Used for
930da3719050473344b6013fd7b614611984f20effrobertphillips@google.com * finding memory leaks and invalid memory accesses.
940da3719050473344b6013fd7b614611984f20effrobertphillips@google.com */
950da3719050473344b6013fd7b614611984f20effrobertphillips@google.comconst GrGLInterface* GrGLCreateDebugInterface();
960da3719050473344b6013fd7b614611984f20effrobertphillips@google.com
9756bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com#if GR_GL_PER_GL_FUNC_CALLBACK
9856bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.comtypedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*);
9956bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.comtypedef intptr_t GrGLInterfaceCallbackData;
10056bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com#endif
10156bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com
102bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com/*
103cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com * GrContext uses the following interface to make all calls into OpenGL. When a
104cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com * GrContext is created it is given a GrGLInterface. The interface's function
105cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com * pointers must be valid for the OpenGL context associated with the GrContext.
106cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com * On some platforms, such as Windows, function pointers for OpenGL extensions
107cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com * may vary between OpenGL contexts. So the caller must be careful to use a
108cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com * GrGLInterface initialized for the correct context. All functions that should
109cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com * be available based on the OpenGL's version and extension string must be
110cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com * non-NULL or GrContext creation will fail. This can be tested with the
111cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com * validate() method when the OpenGL context has been made current.
112bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com */
113d28063e4916b489f572eb8358efcb7305f88c2fdcommit-bot@chromium.orgstruct SK_API GrGLInterface : public GrRefCnt {
114ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.comprivate:
1159c1f1ac5d399c73f5f331bdf7b392ea7f0c44dafbsalomon@google.com    // simple wrapper class that exists only to initialize a pointer to NULL
116ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    template <typename FNPTR_TYPE> class GLPtr {
117ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    public:
118ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com        GLPtr() : fPtr(NULL) {}
119ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com        GLPtr operator =(FNPTR_TYPE ptr) { fPtr = ptr; return *this; }
120ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com        operator FNPTR_TYPE() const { return fPtr; }
121ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    private:
122ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com        FNPTR_TYPE fPtr;
123ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    };
124ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com
12515e9d3e66e161ce23df30bc13f8a0c87d196b463robertphillips@google.com    typedef GrRefCnt INHERITED;
12615e9d3e66e161ce23df30bc13f8a0c87d196b463robertphillips@google.com
127ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.compublic:
12815e9d3e66e161ce23df30bc13f8a0c87d196b463robertphillips@google.com    SK_DECLARE_INST_COUNT(GrGLInterface)
12915e9d3e66e161ce23df30bc13f8a0c87d196b463robertphillips@google.com
1300b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com    GrGLInterface();
1310b77d6892b067ad402c9678b0226bff70599fbe2bsalomon@google.com
13289ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com    // Validates that the GrGLInterface supports a binding. This means that
13389ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com    // the GrGLinterface advertises the binding in fBindingsExported and all
134cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com    // the necessary function pointers have been initialized. The interface is
135cc61b1762814ada94970ac071aa2d0a96f897363bsalomon@google.com    // validated for the current OpenGL context.
13689ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com    bool validate(GrGLBinding binding) const;
13789ec61e33daa9cbac200d38f7c5bb8b88046999absalomon@google.com
138b65e0cb8ad8a690498142d2b0097be250b0c7dfbtwiz@google.com    // Indicator variable specifying the type of GL implementation
139ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    // exported:  GLES2 and/or Desktop.
140b65e0cb8ad8a690498142d2b0097be250b0c7dfbtwiz@google.com    GrGLBinding fBindingsExported;
141b65e0cb8ad8a690498142d2b0097be250b0c7dfbtwiz@google.com
142ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLActiveTextureProc> fActiveTexture;
143ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLAttachShaderProc> fAttachShader;
144ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBeginQueryProc> fBeginQuery;
145ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBindAttribLocationProc> fBindAttribLocation;
146ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBindBufferProc> fBindBuffer;
147ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBindFragDataLocationProc> fBindFragDataLocation;
148ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed;
149ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBindFramebufferProc> fBindFramebuffer;
150ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBindRenderbufferProc> fBindRenderbuffer;
151ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBindTextureProc> fBindTexture;
152ecd84842b3f65918eb040c53391172b6413fd7adbsalomon@google.com    GLPtr<GrGLBindVertexArrayProc> fBindVertexArray;
153ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBlendColorProc> fBlendColor;
154ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBlendFuncProc> fBlendFunc;
155ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBlitFramebufferProc> fBlitFramebuffer;
156ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBufferDataProc> fBufferData;
157ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLBufferSubDataProc> fBufferSubData;
158ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLCheckFramebufferStatusProc> fCheckFramebufferStatus;
159ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLClearProc> fClear;
160ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLClearColorProc> fClearColor;
161ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLClearStencilProc> fClearStencil;
16246fbfe0cd1bbe60fd15ce52e784f5d51450ff5fdcommit-bot@chromium.org    GLPtr<GrGLClientActiveTextureProc> fClientActiveTexture;
163ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLColorMaskProc> fColorMask;
164ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLCompileShaderProc> fCompileShader;
165ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLCompressedTexImage2DProc> fCompressedTexImage2D;
16698168bb394bbb10cd7d3468828e7dc4376a70e12commit-bot@chromium.org    GLPtr<GrGLCopyTexSubImage2DProc> fCopyTexSubImage2D;
167ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLCreateProgramProc> fCreateProgram;
168ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLCreateShaderProc> fCreateShader;
169ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLCullFaceProc> fCullFace;
170ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDeleteBuffersProc> fDeleteBuffers;
171ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDeleteFramebuffersProc> fDeleteFramebuffers;
172ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDeleteProgramProc> fDeleteProgram;
173ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDeleteQueriesProc> fDeleteQueries;
174ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDeleteRenderbuffersProc> fDeleteRenderbuffers;
175ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDeleteShaderProc> fDeleteShader;
176ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDeleteTexturesProc> fDeleteTextures;
177ecd84842b3f65918eb040c53391172b6413fd7adbsalomon@google.com    GLPtr<GrGLDeleteVertexArraysProc> fDeleteVertexArrays;
178ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDepthMaskProc> fDepthMask;
179ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDisableProc> fDisable;
18046fbfe0cd1bbe60fd15ce52e784f5d51450ff5fdcommit-bot@chromium.org    GLPtr<GrGLDisableClientStateProc> fDisableClientState;
181ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDisableVertexAttribArrayProc> fDisableVertexAttribArray;
182ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDrawArraysProc> fDrawArrays;
183ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDrawBufferProc> fDrawBuffer;
184ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDrawBuffersProc> fDrawBuffers;
185ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLDrawElementsProc> fDrawElements;
186ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLEnableProc> fEnable;
18746fbfe0cd1bbe60fd15ce52e784f5d51450ff5fdcommit-bot@chromium.org    GLPtr<GrGLEnableClientStateProc> fEnableClientState;
188ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLEnableVertexAttribArrayProc> fEnableVertexAttribArray;
189ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLEndQueryProc> fEndQuery;
190ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLFinishProc> fFinish;
191ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLFlushProc> fFlush;
192ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLFramebufferRenderbufferProc> fFramebufferRenderbuffer;
193ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLFramebufferTexture2DProc> fFramebufferTexture2D;
194f3a60c09b975f50bbd14215df10effffd2fd46e8bsalomon@google.com    GLPtr<GrGLFramebufferTexture2DMultisampleProc> fFramebufferTexture2DMultisample;
195ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLFrontFaceProc> fFrontFace;
196ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGenBuffersProc> fGenBuffers;
197ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGenFramebuffersProc> fGenFramebuffers;
198cffff79a40bd7672e13b31b9801a3f3cda64875ecommit-bot@chromium.org    GLPtr<GrGLGenerateMipmapProc> fGenerateMipmap;
199ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGenQueriesProc> fGenQueries;
200ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGenRenderbuffersProc> fGenRenderbuffers;
201ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGenTexturesProc> fGenTextures;
202ecd84842b3f65918eb040c53391172b6413fd7adbsalomon@google.com    GLPtr<GrGLGenVertexArraysProc> fGenVertexArrays;
203ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetBufferParameterivProc> fGetBufferParameteriv;
204ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetErrorProc> fGetError;
205ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetFramebufferAttachmentParameterivProc> fGetFramebufferAttachmentParameteriv;
206ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetIntegervProc> fGetIntegerv;
207ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetQueryObjecti64vProc> fGetQueryObjecti64v;
208ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetQueryObjectivProc> fGetQueryObjectiv;
209ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetQueryObjectui64vProc> fGetQueryObjectui64v;
210ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetQueryObjectuivProc> fGetQueryObjectuiv;
211ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetQueryivProc> fGetQueryiv;
212ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetProgramInfoLogProc> fGetProgramInfoLog;
213ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetProgramivProc> fGetProgramiv;
214ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv;
215ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetShaderInfoLogProc> fGetShaderInfoLog;
216ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetShaderivProc> fGetShaderiv;
217ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetStringProc> fGetString;
2181744f97ea73384b9f75b0ccee0a36a213c681d3absalomon@google.com    GLPtr<GrGLGetStringiProc> fGetStringi;
219ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
220ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation;
221ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLLineWidthProc> fLineWidth;
222ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLLinkProgramProc> fLinkProgram;
223ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLMapBufferProc> fMapBuffer;
224ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLPixelStoreiProc> fPixelStorei;
225ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLQueryCounterProc> fQueryCounter;
226ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLReadBufferProc> fReadBuffer;
227ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLReadPixelsProc> fReadPixels;
228ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLRenderbufferStorageProc> fRenderbufferStorage;
229ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample;
230c9668ecdb7188a90b050771727da899c54dc7013bsalomon@google.com    GLPtr<GrGLRenderbufferStorageMultisampleCoverageProc> fRenderbufferStorageMultisampleCoverage;
231ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer;
232ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLScissorProc> fScissor;
233ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLShaderSourceProc> fShaderSource;
234ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLStencilFuncProc> fStencilFunc;
235ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLStencilFuncSeparateProc> fStencilFuncSeparate;
236ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLStencilMaskProc> fStencilMask;
237ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLStencilMaskSeparateProc> fStencilMaskSeparate;
238ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLStencilOpProc> fStencilOp;
239ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLStencilOpSeparateProc> fStencilOpSeparate;
24046fbfe0cd1bbe60fd15ce52e784f5d51450ff5fdcommit-bot@chromium.org    GLPtr<GrGLTexGenfProc> fTexGenf;
24146fbfe0cd1bbe60fd15ce52e784f5d51450ff5fdcommit-bot@chromium.org    GLPtr<GrGLTexGenfvProc> fTexGenfv;
24246fbfe0cd1bbe60fd15ce52e784f5d51450ff5fdcommit-bot@chromium.org    GLPtr<GrGLTexGeniProc> fTexGeni;
243ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLTexImage2DProc> fTexImage2D;
244ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLTexParameteriProc> fTexParameteri;
2454d063dea5ee9d5a62e3566a07cb8386cb1a59585bsalomon@google.com    GLPtr<GrGLTexParameterivProc> fTexParameteriv;
246ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLTexSubImage2DProc> fTexSubImage2D;
247ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLTexStorage2DProc> fTexStorage2D;
248a6ffb58b109f71512bde4e14d06a655914578c8drobertphillips@google.com    GLPtr<GrGLDiscardFramebufferProc> fDiscardFramebuffer;
249ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform1fProc> fUniform1f;
250ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform1iProc> fUniform1i;
251ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform1fvProc> fUniform1fv;
252ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform1ivProc> fUniform1iv;
253ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform2fProc> fUniform2f;
254ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform2iProc> fUniform2i;
255ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform2fvProc> fUniform2fv;
256ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform2ivProc> fUniform2iv;
257ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform3fProc> fUniform3f;
258ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform3iProc> fUniform3i;
259ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform3fvProc> fUniform3fv;
260ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform3ivProc> fUniform3iv;
261ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform4fProc> fUniform4f;
262ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform4iProc> fUniform4i;
263ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform4fvProc> fUniform4fv;
264ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniform4ivProc> fUniform4iv;
265ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniformMatrix2fvProc> fUniformMatrix2fv;
266ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniformMatrix3fvProc> fUniformMatrix3fv;
267ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUniformMatrix4fvProc> fUniformMatrix4fv;
268ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUnmapBufferProc> fUnmapBuffer;
269ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLUseProgramProc> fUseProgram;
270ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLVertexAttrib4fvProc> fVertexAttrib4fv;
271ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLVertexAttribPointerProc> fVertexAttribPointer;
27246fbfe0cd1bbe60fd15ce52e784f5d51450ff5fdcommit-bot@chromium.org    GLPtr<GrGLVertexPointerProc> fVertexPointer;
273ba800e22253d96a7ba6aab09e969e1581f2b487dbsalomon@google.com    GLPtr<GrGLViewportProc> fViewport;
274271cffc77bd2fcb3458559e509634442517ca1e9bsalomon@google.com
275fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    // Experimental: Functions for GL_NV_path_rendering. These will be
276fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com    // alphabetized with the above functions once this is fully supported
277fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    // (and functions we are unlikely to use will possibly be omitted).
278fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLMatrixModeProc> fMatrixMode;
279fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLLoadIdentityProc> fLoadIdentity;
280fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLLoadMatrixfProc> fLoadMatrixf;
281fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathCommandsProc> fPathCommands;
282fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathCoordsProc> fPathCoords;
283fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathSubCommandsProc> fPathSubCommands;
284fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathSubCoordsProc> fPathSubCoords;
285fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathStringProc> fPathString;
286fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathGlyphsProc> fPathGlyphs;
287fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathGlyphRangeProc> fPathGlyphRange;
288fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLWeightPathsProc> fWeightPaths;
289fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLCopyPathProc> fCopyPath;
290fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLInterpolatePathsProc> fInterpolatePaths;
291fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLTransformPathProc> fTransformPath;
292fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathParameterivProc> fPathParameteriv;
293fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathParameteriProc> fPathParameteri;
294fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathParameterfvProc> fPathParameterfv;
295fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathParameterfProc> fPathParameterf;
296fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathDashArrayProc> fPathDashArray;
297fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGenPathsProc> fGenPaths;
298fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLDeletePathsProc> fDeletePaths;
299fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLIsPathProc> fIsPath;
300fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathStencilFuncProc> fPathStencilFunc;
301fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathStencilDepthOffsetProc> fPathStencilDepthOffset;
302fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLStencilFillPathProc> fStencilFillPath;
303fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLStencilStrokePathProc> fStencilStrokePath;
304fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLStencilFillPathInstancedProc> fStencilFillPathInstanced;
305fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLStencilStrokePathInstancedProc> fStencilStrokePathInstanced;
306fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathCoverDepthFuncProc> fPathCoverDepthFunc;
307fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathColorGenProc> fPathColorGen;
308fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathTexGenProc> fPathTexGen;
309fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPathFogGenProc> fPathFogGen;
310fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLCoverFillPathProc> fCoverFillPath;
311fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLCoverStrokePathProc> fCoverStrokePath;
312fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLCoverFillPathInstancedProc> fCoverFillPathInstanced;
313fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLCoverStrokePathInstancedProc> fCoverStrokePathInstanced;
314fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathParameterivProc> fGetPathParameteriv;
315fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathParameterfvProc> fGetPathParameterfv;
316fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathCommandsProc> fGetPathCommands;
317fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathCoordsProc> fGetPathCoords;
318fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathDashArrayProc> fGetPathDashArray;
319fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathMetricsProc> fGetPathMetrics;
320fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathMetricRangeProc> fGetPathMetricRange;
321fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathSpacingProc> fGetPathSpacing;
322fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathColorGenivProc> fGetPathColorGeniv;
323fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathColorGenfvProc> fGetPathColorGenfv;
324fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathTexGenivProc> fGetPathTexGeniv;
325fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathTexGenfvProc> fGetPathTexGenfv;
326fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLIsPointInFillPathProc> fIsPointInFillPath;
327fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLIsPointInStrokePathProc> fIsPointInStrokePath;
328fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLGetPathLengthProc> fGetPathLength;
329fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com    GLPtr<GrGLPointAlongPathProc> fPointAlongPath;
330fe11cb6486adfccc1a9ca9658ae25907192a8642bsalomon@google.com
33156bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com    // Per-GL func callback
33256bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com#if GR_GL_PER_GL_FUNC_CALLBACK
33356bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com    GrGLInterfaceCallbackProc fCallback;
33456bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com    GrGLInterfaceCallbackData fCallbackData;
33556bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com#endif
33656bfc5acc210987838744eece7383bc2f6b34915bsalomon@google.com
337bf2a46941e8fdebfcd24ea8f7184779021898225bsalomon@google.com};
33859a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com
33959a190bcab5d4b2bf03f8f10cb6a581d19fed403twiz@google.com#endif
340