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