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