bsalomon@google.com | 9c58f46 | 2013-02-26 14:45:41 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrGLNoOpInterface_DEFINED |
| 9 | #define GrGLNoOpInterface_DEFINED |
| 10 | |
| 11 | #include "gl/GrGLDefines.h" |
| 12 | #include "gl/GrGLFunctions.h" |
| 13 | |
| 14 | // These are constants/functions that are common to the Null and Debug GL interface implementations. |
| 15 | |
| 16 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendColor(GrGLclampf red, |
| 17 | GrGLclampf green, |
| 18 | GrGLclampf blue, |
| 19 | GrGLclampf alpha); |
| 20 | |
| 21 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBindFragDataLocation(GrGLuint program, |
| 22 | GrGLuint colorNumber, |
| 23 | const GrGLchar* name); |
| 24 | |
| 25 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendFunc(GrGLenum sfactor, |
| 26 | GrGLenum dfactor); |
| 27 | |
| 28 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBufferSubData(GrGLenum target, |
| 29 | GrGLintptr offset, |
| 30 | GrGLsizeiptr size, |
| 31 | const GrGLvoid* data); |
| 32 | |
| 33 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClear(GrGLbitfield mask); |
| 34 | |
| 35 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClearColor(GrGLclampf red, |
| 36 | GrGLclampf green, |
| 37 | GrGLclampf blue, |
| 38 | GrGLclampf alpha); |
| 39 | |
| 40 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClearStencil(GrGLint s); |
| 41 | |
| 42 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLColorMask(GrGLboolean red, |
| 43 | GrGLboolean green, |
| 44 | GrGLboolean blue, |
| 45 | GrGLboolean alpha); |
| 46 | |
| 47 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCompileShader(GrGLuint shader); |
| 48 | |
| 49 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCompressedTexImage2D(GrGLenum target, |
| 50 | GrGLint level, |
| 51 | GrGLenum internalformat, |
| 52 | GrGLsizei width, |
| 53 | GrGLsizei height, |
| 54 | GrGLint border, |
| 55 | GrGLsizei imageSize, |
| 56 | const GrGLvoid* data); |
| 57 | |
| 58 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCullFace(GrGLenum mode); |
| 59 | |
| 60 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDepthMask(GrGLboolean flag); |
| 61 | |
| 62 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisable(GrGLenum cap); |
| 63 | |
| 64 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisableVertexAttribArray(GrGLuint index); |
| 65 | |
| 66 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawArrays(GrGLenum mode, GrGLint first, GrGLsizei count); |
| 67 | |
| 68 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawBuffer(GrGLenum mode); |
| 69 | |
| 70 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawBuffers(GrGLsizei n, |
| 71 | const GrGLenum* bufs); |
| 72 | |
| 73 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawElements(GrGLenum mode, |
| 74 | GrGLsizei count, |
| 75 | GrGLenum type, |
| 76 | const GrGLvoid* indices); |
| 77 | |
| 78 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnable(GrGLenum cap); |
| 79 | |
| 80 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnableVertexAttribArray(GrGLuint index); |
| 81 | |
| 82 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEndQuery(GrGLenum target); |
| 83 | |
| 84 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLFinish(); |
| 85 | |
| 86 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLFlush(); |
| 87 | |
| 88 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLFrontFace(GrGLenum mode); |
| 89 | |
| 90 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLineWidth(GrGLfloat width); |
| 91 | |
| 92 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLinkProgram(GrGLuint program); |
| 93 | |
| 94 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLQueryCounter(GrGLuint id, |
| 95 | GrGLenum target); |
| 96 | |
| 97 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLReadBuffer(GrGLenum src); |
| 98 | |
| 99 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLScissor(GrGLint x, |
| 100 | GrGLint y, |
| 101 | GrGLsizei width, |
| 102 | GrGLsizei height); |
| 103 | |
| 104 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLShaderSource(GrGLuint shader, |
| 105 | GrGLsizei count, |
bsalomon@google.com | 26fb61a | 2013-02-28 19:26:04 +0000 | [diff] [blame] | 106 | #if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE |
bsalomon@google.com | 9c58f46 | 2013-02-26 14:45:41 +0000 | [diff] [blame] | 107 | const char* const * str, |
| 108 | #else |
| 109 | const char** str, |
| 110 | #endif |
| 111 | const GrGLint* length); |
| 112 | |
| 113 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilFunc(GrGLenum func, GrGLint ref, GrGLuint mask); |
| 114 | |
| 115 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilFuncSeparate(GrGLenum face, |
| 116 | GrGLenum func, |
| 117 | GrGLint ref, |
| 118 | GrGLuint mask); |
| 119 | |
| 120 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilMask(GrGLuint mask); |
| 121 | |
| 122 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilMaskSeparate(GrGLenum face, GrGLuint mask); |
| 123 | |
| 124 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilOp(GrGLenum fail, GrGLenum zfail, GrGLenum zpass); |
| 125 | |
| 126 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilOpSeparate(GrGLenum face, |
| 127 | GrGLenum fail, |
| 128 | GrGLenum zfail, |
| 129 | GrGLenum zpass); |
| 130 | |
| 131 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexImage2D(GrGLenum target, |
| 132 | GrGLint level, |
| 133 | GrGLint internalformat, |
| 134 | GrGLsizei width, |
| 135 | GrGLsizei height, |
| 136 | GrGLint border, |
| 137 | GrGLenum format, |
| 138 | GrGLenum type, |
| 139 | const GrGLvoid* pixels); |
| 140 | |
| 141 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexParameteri(GrGLenum target, GrGLenum pname, GrGLint param); |
| 142 | |
| 143 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexParameteriv(GrGLenum target, |
| 144 | GrGLenum pname, |
| 145 | const GrGLint* params); |
| 146 | |
| 147 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexStorage2D(GrGLenum target, |
| 148 | GrGLsizei levels, |
| 149 | GrGLenum internalformat, |
| 150 | GrGLsizei width, |
| 151 | GrGLsizei height); |
| 152 | |
| 153 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexSubImage2D(GrGLenum target, |
| 154 | GrGLint level, |
| 155 | GrGLint xoffset, |
| 156 | GrGLint yoffset, |
| 157 | GrGLsizei width, |
| 158 | GrGLsizei height, |
| 159 | GrGLenum format, |
| 160 | GrGLenum type, |
| 161 | const GrGLvoid* pixels); |
| 162 | |
| 163 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1f(GrGLint location, GrGLfloat v0); |
| 164 | |
| 165 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1i(GrGLint location, GrGLint v0); |
| 166 | |
| 167 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1fv(GrGLint location, |
| 168 | GrGLsizei count, |
| 169 | const GrGLfloat* v); |
| 170 | |
| 171 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1iv(GrGLint location, |
| 172 | GrGLsizei count, |
| 173 | const GrGLint* v); |
| 174 | |
| 175 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2f(GrGLint location, |
| 176 | GrGLfloat v0, |
| 177 | GrGLfloat v1); |
| 178 | |
| 179 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2i(GrGLint location, GrGLint v0, GrGLint v1); |
| 180 | |
| 181 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2fv(GrGLint location, |
| 182 | GrGLsizei count, |
| 183 | const GrGLfloat* v); |
| 184 | |
| 185 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2iv(GrGLint location, |
| 186 | GrGLsizei count, |
| 187 | const GrGLint* v); |
| 188 | |
| 189 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3f(GrGLint location, |
| 190 | GrGLfloat v0, |
| 191 | GrGLfloat v1, |
| 192 | GrGLfloat v2); |
| 193 | |
| 194 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3i(GrGLint location, |
| 195 | GrGLint v0, |
| 196 | GrGLint v1, |
| 197 | GrGLint v2); |
| 198 | |
| 199 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3fv(GrGLint location, |
| 200 | GrGLsizei count, |
| 201 | const GrGLfloat* v); |
| 202 | |
| 203 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3iv(GrGLint location, |
| 204 | GrGLsizei count, |
| 205 | const GrGLint* v); |
| 206 | |
| 207 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4f(GrGLint location, |
| 208 | GrGLfloat v0, |
| 209 | GrGLfloat v1, |
| 210 | GrGLfloat v2, |
| 211 | GrGLfloat v3); |
| 212 | |
| 213 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4i(GrGLint location, |
| 214 | GrGLint v0, |
| 215 | GrGLint v1, |
| 216 | GrGLint v2, |
| 217 | GrGLint v3); |
| 218 | |
| 219 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4fv(GrGLint location, |
| 220 | GrGLsizei count, |
| 221 | const GrGLfloat* v); |
| 222 | |
| 223 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4iv(GrGLint location, |
| 224 | GrGLsizei count, |
| 225 | const GrGLint* v); |
| 226 | |
| 227 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniformMatrix2fv(GrGLint location, |
| 228 | GrGLsizei count, |
| 229 | GrGLboolean transpose, |
| 230 | const GrGLfloat* value); |
| 231 | |
| 232 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniformMatrix3fv(GrGLint location, |
| 233 | GrGLsizei count, |
| 234 | GrGLboolean transpose, |
| 235 | const GrGLfloat* value); |
| 236 | |
| 237 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniformMatrix4fv(GrGLint location, |
| 238 | GrGLsizei count, |
| 239 | GrGLboolean transpose, |
| 240 | const GrGLfloat* value); |
| 241 | |
| 242 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLVertexAttrib4fv(GrGLuint indx, const GrGLfloat* values); |
| 243 | |
| 244 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLVertexAttribPointer(GrGLuint indx, |
| 245 | GrGLint size, |
| 246 | GrGLenum type, |
| 247 | GrGLboolean normalized, |
| 248 | GrGLsizei stride, |
| 249 | const GrGLvoid* ptr); |
| 250 | |
| 251 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLViewport(GrGLint x, |
| 252 | GrGLint y, |
| 253 | GrGLsizei width, |
| 254 | GrGLsizei height); |
| 255 | |
| 256 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetFramebufferAttachmentParameteriv(GrGLenum target, |
| 257 | GrGLenum attachment, |
| 258 | GrGLenum pname, |
| 259 | GrGLint* params); |
| 260 | |
| 261 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetRenderbufferParameteriv(GrGLenum target, |
| 262 | GrGLenum pname, |
| 263 | GrGLint* params); |
| 264 | |
| 265 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLRenderbufferStorage(GrGLenum target, |
| 266 | GrGLenum internalformat, |
| 267 | GrGLsizei width, |
| 268 | GrGLsizei height); |
| 269 | |
| 270 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLRenderbufferStorageMultisample(GrGLenum target, |
| 271 | GrGLsizei samples, |
| 272 | GrGLenum internalformat, |
| 273 | GrGLsizei width, |
| 274 | GrGLsizei height); |
| 275 | |
| 276 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlitFramebuffer(GrGLint srcX0, |
| 277 | GrGLint srcY0, |
| 278 | GrGLint srcX1, |
| 279 | GrGLint srcY1, |
| 280 | GrGLint dstX0, |
| 281 | GrGLint dstY0, |
| 282 | GrGLint dstX1, |
| 283 | GrGLint dstY1, |
| 284 | GrGLbitfield mask, |
| 285 | GrGLenum filter); |
| 286 | |
| 287 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLResolveMultisampleFramebuffer(); |
| 288 | |
| 289 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBindFragDataLocationIndexed(GrGLuint program, |
| 290 | GrGLuint colorNumber, |
| 291 | GrGLuint index, |
| 292 | const GrGLchar * name); |
| 293 | |
| 294 | GrGLenum GR_GL_FUNCTION_TYPE noOpGLCheckFramebufferStatus(GrGLenum target); |
| 295 | |
| 296 | // this function can be used for all glGen*(GLsize i, GLuint*) functions |
| 297 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGenIds(GrGLsizei n, GrGLuint* ids); |
| 298 | |
| 299 | // this function function can be used for all glDelete*(GLsize i, const GLuint*) |
| 300 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDeleteIds(GrGLsizei n, const GrGLuint* ids); |
| 301 | |
| 302 | GrGLenum GR_GL_FUNCTION_TYPE noOpGLGetError(); |
| 303 | |
| 304 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetIntegerv(GrGLenum pname, GrGLint* params); |
| 305 | |
| 306 | // can be used for both the program and shader info logs |
| 307 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetInfoLog(GrGLuint program, |
| 308 | GrGLsizei bufsize, |
| 309 | GrGLsizei* length, |
| 310 | char* infolog); |
| 311 | |
| 312 | // can be used for both the program and shader params |
| 313 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetShaderOrProgramiv(GrGLuint program, |
| 314 | GrGLenum pname, |
| 315 | GrGLint* params); |
| 316 | |
| 317 | // Queries on bogus GLs just don't do anything at all. We could potentially make the timers work. |
| 318 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryiv(GrGLenum GLtarget, |
| 319 | GrGLenum pname, |
| 320 | GrGLint *params); |
| 321 | |
| 322 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjecti64v(GrGLuint id, |
| 323 | GrGLenum pname, |
| 324 | GrGLint64 *params); |
| 325 | |
| 326 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectiv(GrGLuint id, GrGLenum pname, GrGLint *params); |
| 327 | |
| 328 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectui64v(GrGLuint id, |
| 329 | GrGLenum pname, |
| 330 | GrGLuint64 *params); |
| 331 | |
| 332 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectuiv(GrGLuint id, |
| 333 | GrGLenum pname, |
| 334 | GrGLuint *params); |
| 335 | |
| 336 | const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetString(GrGLenum name); |
| 337 | |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 338 | const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetStringi(GrGLenum name, GrGLuint i); |
| 339 | |
bsalomon@google.com | 9c58f46 | 2013-02-26 14:45:41 +0000 | [diff] [blame] | 340 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetTexLevelParameteriv(GrGLenum target, |
| 341 | GrGLint level, |
| 342 | GrGLenum pname, |
| 343 | GrGLint* params); |
| 344 | |
| 345 | GrGLint GR_GL_FUNCTION_TYPE noOpGLGetUniformLocation(GrGLuint program, const char* name); |
| 346 | |
| 347 | #endif |