epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 10 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 11 | #ifndef GrGLInterface_DEFINED |
| 12 | #define GrGLInterface_DEFINED |
| 13 | |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 14 | #include "GrGLConfig.h" |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 15 | #include "GrRefCnt.h" |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 16 | |
| 17 | #if !defined(GR_GL_FUNCTION_TYPE) |
| 18 | #define GR_GL_FUNCTION_TYPE |
| 19 | #endif |
| 20 | |
| 21 | //////////////////////////////////////////////////////////////////////////////// |
| 22 | |
| 23 | /** |
| 24 | * Helpers for glGetString() |
| 25 | */ |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 26 | |
bsalomon@google.com | 4d06214 | 2011-09-22 14:31:24 +0000 | [diff] [blame] | 27 | typedef uint32_t GrGLVersion; |
bsalomon@google.com | edfe1aa | 2011-09-29 14:40:26 +0000 | [diff] [blame] | 28 | typedef uint32_t GrGLSLVersion; |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 29 | |
bsalomon@google.com | edfe1aa | 2011-09-29 14:40:26 +0000 | [diff] [blame] | 30 | #define GR_GL_VER(major, minor) ((static_cast<int>(major) << 16) | \ |
| 31 | static_cast<int>(minor)) |
| 32 | #define GR_GLSL_VER(major, minor) ((static_cast<int>(major) << 16) | \ |
| 33 | static_cast<int>(minor)) |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 34 | |
bsalomon@google.com | 2c17fcd | 2011-07-06 17:47:02 +0000 | [diff] [blame] | 35 | // these variants assume caller already has a string from glGetString() |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 36 | GrGLVersion GrGLGetVersionFromString(const char* versionString); |
bsalomon@google.com | edfe1aa | 2011-09-29 14:40:26 +0000 | [diff] [blame] | 37 | GrGLSLVersion GrGLGetGLSLVersionFromString(const char* versionString); |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 38 | bool GrGLHasExtensionFromString(const char* ext, const char* extensionString); |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 39 | |
bsalomon@google.com | 2c17fcd | 2011-07-06 17:47:02 +0000 | [diff] [blame] | 40 | // these variants call glGetString() |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 41 | bool GrGLGetString(const GrGLInterface*, const char* ext); |
| 42 | GrGLVersion GrGLGetVersion(const GrGLInterface*); |
bsalomon@google.com | edfe1aa | 2011-09-29 14:40:26 +0000 | [diff] [blame] | 43 | GrGLSLVersion GrGLGetGLSLVersion(const GrGLInterface*); |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 44 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 45 | //////////////////////////////////////////////////////////////////////////////// |
| 46 | |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 47 | /** |
| 48 | * Rather than depend on platform-specific GL headers and libraries, we require |
| 49 | * the client to provide a struct of GL function pointers. This struct can be |
| 50 | * specified per-GrContext as a parameter to GrContext::Create. If NULL is |
| 51 | * passed to Create then the "default" GL interface is used. If the default is |
| 52 | * also NULL GrContext creation will fail. |
| 53 | * |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 54 | * The default interface is returned by GrGLDefaultInterface. This function's |
| 55 | * implementation is platform-specifc. Several have been provided, along with an |
| 56 | * implementation that simply returns NULL. It is implementation-specific |
| 57 | * whether the same GrGLInterface is returned or whether a new one is created |
| 58 | * at each call. Some platforms may not be able to use a single GrGLInterface |
| 59 | * because extension function ptrs vary across contexts. Note that GrGLInterface |
| 60 | * is ref-counted. So if the same object is returned by multiple calls to |
| 61 | * GrGLDefaultInterface, each should bump the ref count. |
bsalomon@google.com | 56bfc5a | 2011-09-01 13:28:16 +0000 | [diff] [blame] | 62 | * |
| 63 | * By defining GR_GL_PER_GL_CALL_IFACE_CALLBACK to 1 the client can specify a |
| 64 | * callback function that will be called prior to each GL function call. See |
| 65 | * comments in GrGLConfig.h |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 66 | */ |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 67 | |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 68 | struct GrGLInterface; |
| 69 | |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 70 | const GrGLInterface* GrGLDefaultInterface(); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 71 | |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 72 | typedef unsigned int GrGLenum; |
| 73 | typedef unsigned char GrGLboolean; |
| 74 | typedef unsigned int GrGLbitfield; |
| 75 | typedef signed char GrGLbyte; |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 76 | typedef char GrGLchar; |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 77 | typedef short GrGLshort; |
| 78 | typedef int GrGLint; |
| 79 | typedef int GrGLsizei; |
| 80 | typedef unsigned char GrGLubyte; |
| 81 | typedef unsigned short GrGLushort; |
| 82 | typedef unsigned int GrGLuint; |
| 83 | typedef float GrGLfloat; |
| 84 | typedef float GrGLclampf; |
| 85 | typedef double GrGLdouble; |
| 86 | typedef double GrGLclampd; |
| 87 | typedef void GrGLvoid; |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 88 | typedef long GrGLintptr; |
| 89 | typedef long GrGLsizeiptr; |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 90 | |
twiz@google.com | b65e0cb | 2011-03-18 20:41:44 +0000 | [diff] [blame] | 91 | enum GrGLBinding { |
| 92 | kDesktop_GrGLBinding = 0x01, |
| 93 | kES1_GrGLBinding = 0x02, |
| 94 | kES2_GrGLBinding = 0x04 |
| 95 | }; |
| 96 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 97 | extern "C" { |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 98 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLActiveTextureProc)(GrGLenum texture); |
| 99 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLAttachShaderProc)(GrGLuint program, GrGLuint shader); |
| 100 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindAttribLocationProc)(GrGLuint program, GrGLuint index, const char* name); |
| 101 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindBufferProc)(GrGLenum target, GrGLuint buffer); |
| 102 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindTextureProc)(GrGLenum target, GrGLuint texture); |
| 103 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha); |
bsalomon@google.com | bc5cf51 | 2011-09-21 16:21:07 +0000 | [diff] [blame] | 104 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFragDataLocationProc)(GrGLuint program, GrGLuint colorNumber, const GrGLchar* name); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 105 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendFuncProc)(GrGLenum sfactor, GrGLenum dfactor); |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 106 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBufferDataProc)(GrGLenum target, GrGLsizeiptr size, const GrGLvoid* data, GrGLenum usage); |
| 107 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBufferSubDataProc)(GrGLenum target, GrGLintptr offset, GrGLsizeiptr size, const GrGLvoid* data); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 108 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearProc)(GrGLbitfield mask); |
| 109 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha); |
| 110 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearStencilProc)(GrGLint s); |
| 111 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClientActiveTextureProc)(GrGLenum texture); |
| 112 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColor4ubProc)(GrGLubyte red, GrGLubyte green, GrGLubyte blue, GrGLubyte alpha); |
| 113 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColorMaskProc)(GrGLboolean red, GrGLboolean green, GrGLboolean blue, GrGLboolean alpha); |
| 114 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColorPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer); |
| 115 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCompileShaderProc)(GrGLuint shader); |
| 116 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCompressedTexImage2DProc)(GrGLenum target, GrGLint level, GrGLenum internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLsizei imageSize, const GrGLvoid* data); |
| 117 | typedef GrGLuint (GR_GL_FUNCTION_TYPE *GrGLCreateProgramProc)(void); |
| 118 | typedef GrGLuint (GR_GL_FUNCTION_TYPE *GrGLCreateShaderProc)(GrGLenum type); |
| 119 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCullFaceProc)(GrGLenum mode); |
| 120 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteBuffersProc)(GrGLsizei n, const GrGLuint* buffers); |
| 121 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteProgramProc)(GrGLuint program); |
| 122 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteShaderProc)(GrGLuint shader); |
| 123 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteTexturesProc)(GrGLsizei n, const GrGLuint* textures); |
| 124 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDepthMaskProc)(GrGLboolean flag); |
| 125 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableProc)(GrGLenum cap); |
| 126 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableClientStateProc)(GrGLenum array); |
| 127 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableVertexAttribArrayProc)(GrGLuint index); |
| 128 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawArraysProc)(GrGLenum mode, GrGLint first, GrGLsizei count); |
bsalomon@google.com | d32c5f5 | 2011-08-02 19:29:03 +0000 | [diff] [blame] | 129 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawBufferProc)(GrGLenum mode); |
| 130 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawBuffersProc)(GrGLsizei n, const GrGLenum* bufs); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 131 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawElementsProc)(GrGLenum mode, GrGLsizei count, GrGLenum type, const GrGLvoid* indices); |
| 132 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableProc)(GrGLenum cap); |
| 133 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableClientStateProc)(GrGLenum cap); |
| 134 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableVertexAttribArrayProc)(GrGLuint index); |
| 135 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFrontFaceProc)(GrGLenum mode); |
| 136 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenBuffersProc)(GrGLsizei n, GrGLuint* buffers); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 137 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenTexturesProc)(GrGLsizei n, GrGLuint* textures); |
| 138 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetBufferParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params); |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 139 | typedef GrGLenum (GR_GL_FUNCTION_TYPE *GrGLGetErrorProc)(void); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 140 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetIntegervProc)(GrGLenum pname, GrGLint* params); |
| 141 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetProgramInfoLogProc)(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, char* infolog); |
| 142 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetProgramivProc)(GrGLuint program, GrGLenum pname, GrGLint* params); |
| 143 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderInfoLogProc)(GrGLuint shader, GrGLsizei bufsize, GrGLsizei* length, char* infolog); |
| 144 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderivProc)(GrGLuint shader, GrGLenum pname, GrGLint* params); |
| 145 | typedef const GrGLubyte* (GR_GL_FUNCTION_TYPE *GrGLGetStringProc)(GrGLenum name); |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 146 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetTexLevelParameteriv)(GrGLenum target, GrGLint level, GrGLenum pname, GrGLint* params); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 147 | typedef GrGLint (GR_GL_FUNCTION_TYPE *GrGLGetUniformLocationProc)(GrGLuint program, const char* name); |
| 148 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLineWidthProc)(GrGLfloat width); |
| 149 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLinkProgramProc)(GrGLuint program); |
| 150 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLoadMatrixfProc)(const GrGLfloat* m); |
| 151 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLMatrixModeProc)(GrGLenum mode); |
| 152 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLPixelStoreiProc)(GrGLenum pname, GrGLint param); |
| 153 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLPointSizeProc)(GrGLfloat size); |
bsalomon@google.com | c49d66b | 2011-08-03 14:22:30 +0000 | [diff] [blame] | 154 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLReadBufferProc)(GrGLenum src); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 155 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLReadPixelsProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels); |
| 156 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLScissorProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height); |
| 157 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLShadeModelProc)(GrGLenum mode); |
| 158 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLShaderSourceProc)(GrGLuint shader, GrGLsizei count, const char** str, const GrGLint* length); |
| 159 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilFuncProc)(GrGLenum func, GrGLint ref, GrGLuint mask); |
| 160 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilFuncSeparateProc)(GrGLenum face, GrGLenum func, GrGLint ref, GrGLuint mask); |
| 161 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilMaskProc)(GrGLuint mask); |
| 162 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilMaskSeparateProc)(GrGLenum face, GrGLuint mask); |
| 163 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilOpProc)(GrGLenum fail, GrGLenum zfail, GrGLenum zpass); |
| 164 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilOpSeparateProc)(GrGLenum face, GrGLenum fail, GrGLenum zfail, GrGLenum zpass); |
| 165 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexCoordPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer); |
| 166 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexEnviProc)(GrGLenum target, GrGLenum pname, GrGLint param); |
| 167 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexImage2DProc)(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels); |
| 168 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexParameteriProc)(GrGLenum target, GrGLenum pname, GrGLint param); |
| 169 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 170 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fProc)(GrGLint location, GrGLfloat v0); |
| 171 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1iProc)(GrGLint location, GrGLint v0); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 172 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 173 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v); |
| 174 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1); |
| 175 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2iProc)(GrGLint location, GrGLint v0, GrGLint v1); |
| 176 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v); |
| 177 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v); |
| 178 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2); |
| 179 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2); |
| 180 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v); |
| 181 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v); |
| 182 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2, GrGLfloat v3); |
| 183 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2, GrGLint v3); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 184 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 185 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v); |
| 186 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix2fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 187 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix3fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 188 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix4fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 189 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUseProgramProc)(GrGLuint program); |
| 190 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib4fvProc)(GrGLuint indx, const GrGLfloat* values); |
| 191 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttribPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const GrGLvoid* ptr); |
| 192 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer); |
| 193 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLViewportProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 194 | |
| 195 | // FBO Extension Functions |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 196 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFramebufferProc)(GrGLenum target, GrGLuint framebuffer); |
| 197 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindRenderbufferProc)(GrGLenum target, GrGLuint renderbuffer); |
| 198 | typedef GrGLenum (GR_GL_FUNCTION_TYPE *GrGLCheckFramebufferStatusProc)(GrGLenum target); |
| 199 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteFramebuffersProc)(GrGLsizei n, const GrGLuint *framebuffers); |
| 200 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteRenderbuffersProc)(GrGLsizei n, const GrGLuint *renderbuffers); |
| 201 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferRenderbufferProc)(GrGLenum target, GrGLenum attachment, GrGLenum renderbuffertarget, GrGLuint renderbuffer); |
| 202 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferTexture2DProc)(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level); |
| 203 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenFramebuffersProc)(GrGLsizei n, GrGLuint *framebuffers); |
| 204 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenRenderbuffersProc)(GrGLsizei n, GrGLuint *renderbuffers); |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 205 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetFramebufferAttachmentParameterivProc)(GrGLenum target, GrGLenum attachment, GrGLenum pname, GrGLint* params); |
| 206 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetRenderbufferParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 207 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLRenderbufferStorageProc)(GrGLenum target, GrGLenum internalformat, GrGLsizei width, GrGLsizei height); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 208 | |
| 209 | // Multisampling Extension Functions |
| 210 | // same prototype for ARB_FBO, EXT_FBO, GL 3.0, & Apple ES extension |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 211 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLRenderbufferStorageMultisampleProc)(GrGLenum target, GrGLsizei samples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 212 | // desktop: ext_fbo_blit, arb_fbo, gl 3.0 |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 213 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlitFramebufferProc)(GrGLint srcX0, GrGLint srcY0, GrGLint srcX1, GrGLint srcY1, GrGLint dstX0, GrGLint dstY0, GrGLint dstX1, GrGLint dstY1, GrGLbitfield mask, GrGLenum filter); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 214 | // apple's es extension |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 215 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLResolveMultisampleFramebufferProc)(); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 216 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 217 | // Buffer mapping (extension in ES). |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 218 | typedef GrGLvoid* (GR_GL_FUNCTION_TYPE *GrGLMapBufferProc)(GrGLenum target, GrGLenum access); |
| 219 | typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLUnmapBufferProc)(GrGLenum target); |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 220 | |
| 221 | // Dual source blending |
| 222 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFragDataLocationIndexedProc)(GrGLuint program, GrGLuint colorNumber, GrGLuint index, const GrGLchar * name); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 223 | } // extern "C" |
| 224 | |
bsalomon@google.com | 56bfc5a | 2011-09-01 13:28:16 +0000 | [diff] [blame] | 225 | #if GR_GL_PER_GL_FUNC_CALLBACK |
| 226 | typedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*); |
| 227 | typedef intptr_t GrGLInterfaceCallbackData; |
| 228 | #endif |
| 229 | |
| 230 | |
tomhudson@google.com | e67bd3f | 2011-06-16 14:08:04 +0000 | [diff] [blame] | 231 | enum GrGLCapability { |
| 232 | kProbe_GrGLCapability = -1 |
tomhudson@google.com | 30e4bb6 | 2011-06-15 19:41:46 +0000 | [diff] [blame] | 233 | }; |
| 234 | |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 235 | /* |
| 236 | * The following interface exports the OpenGL entry points used by the system. |
| 237 | * Use of OpenGL calls is disallowed. All calls should be invoked through |
| 238 | * the global instance of this struct, defined above. |
| 239 | * |
| 240 | * IMPORTANT NOTE: The OpenGL entry points exposed here include both core GL |
| 241 | * functions, and extensions. The system assumes that the address of the |
| 242 | * extension pointer will be valid across contexts. |
| 243 | */ |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 244 | struct GR_API GrGLInterface : public GrRefCnt { |
| 245 | |
| 246 | GrGLInterface(); |
| 247 | |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 248 | bool validate(GrEngine engine) const; |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 249 | bool supportsDesktop() const { |
| 250 | return 0 != (kDesktop_GrGLBinding & fBindingsExported); |
| 251 | } |
| 252 | bool supportsES1() const { |
| 253 | return 0 != (kES1_GrGLBinding & fBindingsExported); |
| 254 | } |
| 255 | bool supportsES2() const { |
| 256 | return 0 != (kES2_GrGLBinding & fBindingsExported); |
| 257 | } |
| 258 | bool supportsES() const { |
| 259 | return 0 != ((kES1_GrGLBinding | kES2_GrGLBinding) & |
| 260 | fBindingsExported); |
| 261 | } |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 262 | |
twiz@google.com | b65e0cb | 2011-03-18 20:41:44 +0000 | [diff] [blame] | 263 | // Indicator variable specifying the type of GL implementation |
| 264 | // exported: GLES{1|2} or Desktop. |
| 265 | GrGLBinding fBindingsExported; |
| 266 | |
tomhudson@google.com | 747bf29 | 2011-06-14 18:16:52 +0000 | [diff] [blame] | 267 | /// Does this GL support NPOT textures on FBOs? |
tomhudson@google.com | e67bd3f | 2011-06-16 14:08:04 +0000 | [diff] [blame] | 268 | /// boolean value, or kProbe_GrGLCapability to probe (slowly) at context creation. |
tomhudson@google.com | 747bf29 | 2011-06-14 18:16:52 +0000 | [diff] [blame] | 269 | int fNPOTRenderTargetSupport; |
| 270 | |
| 271 | /// Some GL implementations (PowerVR SGX devices like the iPhone 4) |
| 272 | /// have restrictions on the size of small render targets. |
tomhudson@google.com | e67bd3f | 2011-06-16 14:08:04 +0000 | [diff] [blame] | 273 | /// kProbe_GrGLCapability to probe (slowly) at context creation. |
tomhudson@google.com | 747bf29 | 2011-06-14 18:16:52 +0000 | [diff] [blame] | 274 | int fMinRenderTargetHeight; |
| 275 | int fMinRenderTargetWidth; |
| 276 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 277 | GrGLActiveTextureProc fActiveTexture; |
| 278 | GrGLAttachShaderProc fAttachShader; |
| 279 | GrGLBindAttribLocationProc fBindAttribLocation; |
| 280 | GrGLBindBufferProc fBindBuffer; |
bsalomon@google.com | bc5cf51 | 2011-09-21 16:21:07 +0000 | [diff] [blame] | 281 | GrGLBindFragDataLocationProc fBindFragDataLocation; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 282 | GrGLBindTextureProc fBindTexture; |
bsalomon@google.com | 080773c | 2011-03-15 19:09:25 +0000 | [diff] [blame] | 283 | GrGLBlendColorProc fBlendColor; |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 284 | GrGLBlendFuncProc fBlendFunc; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 285 | GrGLBufferDataProc fBufferData; |
| 286 | GrGLBufferSubDataProc fBufferSubData; |
| 287 | GrGLClearProc fClear; |
| 288 | GrGLClearColorProc fClearColor; |
| 289 | GrGLClearStencilProc fClearStencil; |
| 290 | GrGLClientActiveTextureProc fClientActiveTexture; |
| 291 | GrGLColor4ubProc fColor4ub; |
| 292 | GrGLColorMaskProc fColorMask; |
| 293 | GrGLColorPointerProc fColorPointer; |
| 294 | GrGLCompileShaderProc fCompileShader; |
| 295 | GrGLCompressedTexImage2DProc fCompressedTexImage2D; |
| 296 | GrGLCreateProgramProc fCreateProgram; |
| 297 | GrGLCreateShaderProc fCreateShader; |
| 298 | GrGLCullFaceProc fCullFace; |
| 299 | GrGLDeleteBuffersProc fDeleteBuffers; |
| 300 | GrGLDeleteProgramProc fDeleteProgram; |
| 301 | GrGLDeleteShaderProc fDeleteShader; |
| 302 | GrGLDeleteTexturesProc fDeleteTextures; |
| 303 | GrGLDepthMaskProc fDepthMask; |
| 304 | GrGLDisableProc fDisable; |
| 305 | GrGLDisableClientStateProc fDisableClientState; |
| 306 | GrGLDisableVertexAttribArrayProc fDisableVertexAttribArray; |
| 307 | GrGLDrawArraysProc fDrawArrays; |
bsalomon@google.com | d32c5f5 | 2011-08-02 19:29:03 +0000 | [diff] [blame] | 308 | GrGLDrawBufferProc fDrawBuffer; |
| 309 | GrGLDrawBuffersProc fDrawBuffers; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 310 | GrGLDrawElementsProc fDrawElements; |
| 311 | GrGLEnableProc fEnable; |
| 312 | GrGLEnableClientStateProc fEnableClientState; |
| 313 | GrGLEnableVertexAttribArrayProc fEnableVertexAttribArray; |
| 314 | GrGLFrontFaceProc fFrontFace; |
| 315 | GrGLGenBuffersProc fGenBuffers; |
| 316 | GrGLGenTexturesProc fGenTextures; |
| 317 | GrGLGetBufferParameterivProc fGetBufferParameteriv; |
| 318 | GrGLGetErrorProc fGetError; |
| 319 | GrGLGetIntegervProc fGetIntegerv; |
| 320 | GrGLGetProgramInfoLogProc fGetProgramInfoLog; |
| 321 | GrGLGetProgramivProc fGetProgramiv; |
| 322 | GrGLGetShaderInfoLogProc fGetShaderInfoLog; |
| 323 | GrGLGetShaderivProc fGetShaderiv; |
| 324 | GrGLGetStringProc fGetString; |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 325 | GrGLGetTexLevelParameteriv fGetTexLevelParameteriv; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 326 | GrGLGetUniformLocationProc fGetUniformLocation; |
| 327 | GrGLLineWidthProc fLineWidth; |
| 328 | GrGLLinkProgramProc fLinkProgram; |
| 329 | GrGLLoadMatrixfProc fLoadMatrixf; |
| 330 | GrGLMatrixModeProc fMatrixMode; |
| 331 | GrGLPixelStoreiProc fPixelStorei; |
| 332 | GrGLPointSizeProc fPointSize; |
bsalomon@google.com | c49d66b | 2011-08-03 14:22:30 +0000 | [diff] [blame] | 333 | GrGLReadBufferProc fReadBuffer; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 334 | GrGLReadPixelsProc fReadPixels; |
| 335 | GrGLScissorProc fScissor; |
| 336 | GrGLShadeModelProc fShadeModel; |
| 337 | GrGLShaderSourceProc fShaderSource; |
| 338 | GrGLStencilFuncProc fStencilFunc; |
| 339 | GrGLStencilFuncSeparateProc fStencilFuncSeparate; |
| 340 | GrGLStencilMaskProc fStencilMask; |
| 341 | GrGLStencilMaskSeparateProc fStencilMaskSeparate; |
| 342 | GrGLStencilOpProc fStencilOp; |
| 343 | GrGLStencilOpSeparateProc fStencilOpSeparate; |
| 344 | GrGLTexCoordPointerProc fTexCoordPointer; |
| 345 | GrGLTexEnviProc fTexEnvi; |
| 346 | GrGLTexImage2DProc fTexImage2D; |
| 347 | GrGLTexParameteriProc fTexParameteri; |
| 348 | GrGLTexSubImage2DProc fTexSubImage2D; |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 349 | GrGLUniform1fProc fUniform1f; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 350 | GrGLUniform1iProc fUniform1i; |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 351 | GrGLUniform1fvProc fUniform1fv; |
| 352 | GrGLUniform1ivProc fUniform1iv; |
| 353 | GrGLUniform2fProc fUniform2f; |
| 354 | GrGLUniform2iProc fUniform2i; |
| 355 | GrGLUniform2fvProc fUniform2fv; |
| 356 | GrGLUniform2ivProc fUniform2iv; |
| 357 | GrGLUniform3fProc fUniform3f; |
| 358 | GrGLUniform3iProc fUniform3i; |
| 359 | GrGLUniform3fvProc fUniform3fv; |
| 360 | GrGLUniform3ivProc fUniform3iv; |
| 361 | GrGLUniform4fProc fUniform4f; |
| 362 | GrGLUniform4iProc fUniform4i; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 363 | GrGLUniform4fvProc fUniform4fv; |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 364 | GrGLUniform4ivProc fUniform4iv; |
| 365 | GrGLUniformMatrix2fvProc fUniformMatrix2fv; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 366 | GrGLUniformMatrix3fvProc fUniformMatrix3fv; |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 367 | GrGLUniformMatrix4fvProc fUniformMatrix4fv; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 368 | GrGLUseProgramProc fUseProgram; |
| 369 | GrGLVertexAttrib4fvProc fVertexAttrib4fv; |
| 370 | GrGLVertexAttribPointerProc fVertexAttribPointer; |
| 371 | GrGLVertexPointerProc fVertexPointer; |
| 372 | GrGLViewportProc fViewport; |
| 373 | |
| 374 | // FBO Extension Functions |
| 375 | GrGLBindFramebufferProc fBindFramebuffer; |
| 376 | GrGLBindRenderbufferProc fBindRenderbuffer; |
| 377 | GrGLCheckFramebufferStatusProc fCheckFramebufferStatus; |
| 378 | GrGLDeleteFramebuffersProc fDeleteFramebuffers; |
| 379 | GrGLDeleteRenderbuffersProc fDeleteRenderbuffers; |
| 380 | GrGLFramebufferRenderbufferProc fFramebufferRenderbuffer; |
| 381 | GrGLFramebufferTexture2DProc fFramebufferTexture2D; |
| 382 | GrGLGenFramebuffersProc fGenFramebuffers; |
| 383 | GrGLGenRenderbuffersProc fGenRenderbuffers; |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 384 | GrGLGetFramebufferAttachmentParameterivProc fGetFramebufferAttachmentParameteriv; |
| 385 | GrGLGetRenderbufferParameterivProc fGetRenderbufferParameteriv; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 386 | GrGLRenderbufferStorageProc fRenderbufferStorage; |
| 387 | |
| 388 | // Multisampling Extension Functions |
| 389 | // same prototype for ARB_FBO, EXT_FBO, GL 3.0, & Apple ES extension |
| 390 | GrGLRenderbufferStorageMultisampleProc fRenderbufferStorageMultisample; |
| 391 | // desktop: ext_fbo_blit, arb_fbo, gl 3.0 |
| 392 | GrGLBlitFramebufferProc fBlitFramebuffer; |
| 393 | // apple's es extension |
| 394 | GrGLResolveMultisampleFramebufferProc fResolveMultisampleFramebuffer; |
| 395 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 396 | // Buffer mapping (extension in ES). |
| 397 | GrGLMapBufferProc fMapBuffer; |
| 398 | GrGLUnmapBufferProc fUnmapBuffer; |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 399 | |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 400 | // Dual Source Blending |
| 401 | GrGLBindFragDataLocationIndexedProc fBindFragDataLocationIndexed; |
| 402 | |
bsalomon@google.com | 56bfc5a | 2011-09-01 13:28:16 +0000 | [diff] [blame] | 403 | // Per-GL func callback |
| 404 | #if GR_GL_PER_GL_FUNC_CALLBACK |
| 405 | GrGLInterfaceCallbackProc fCallback; |
| 406 | GrGLInterfaceCallbackData fCallbackData; |
| 407 | #endif |
| 408 | |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 409 | private: |
| 410 | bool validateShaderFunctions() const; |
| 411 | bool validateFixedFunctions() const; |
| 412 | }; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 413 | |
| 414 | #endif |