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