diff options
author | Timothy Arceri <[email protected]> | 2017-05-03 13:34:42 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-05-04 11:35:37 +1000 |
commit | e2f30076651246fc8444894cabd8f22a0fb32f25 (patch) | |
tree | 17c92157b81398663425d510036dd730505a20c1 /src/mesa/main | |
parent | b549f054a629555e241b0769f7aadfa1f90171fb (diff) |
mesa: make _mesa_accum() static
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/accum.c | 108 | ||||
-rw-r--r-- | src/mesa/main/accum.h | 3 |
2 files changed, 54 insertions, 57 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index ef74468f426..d81e1ba583c 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -53,57 +53,6 @@ _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) } -void GLAPIENTRY -_mesa_Accum( GLenum op, GLfloat value ) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - - switch (op) { - case GL_ADD: - case GL_MULT: - case GL_ACCUM: - case GL_LOAD: - case GL_RETURN: - /* OK */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glAccum(op)"); - return; - } - - if (ctx->DrawBuffer->Visual.haveAccumBuffer == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glAccum(no accum buffer)"); - return; - } - - if (ctx->DrawBuffer != ctx->ReadBuffer) { - /* See GLX_SGI_make_current_read or WGL_ARB_make_current_read, - * or GL_EXT_framebuffer_blit. - */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glAccum(different read/draw buffers)"); - return; - } - - if (ctx->NewState) - _mesa_update_state(ctx); - - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glAccum(incomplete framebuffer)"); - return; - } - - if (ctx->RasterDiscard) - return; - - if (ctx->RenderMode == GL_RENDER) { - _mesa_accum(ctx, op, value); - } -} - - /** * Clear the accumulation buffer by mapping the renderbuffer and * writing the clear color to it. Called by the driver's implementation @@ -436,8 +385,8 @@ accum_return(struct gl_context *ctx, GLfloat value, * signed 16-bit color channels could implement hardware accumulation * operations, but no driver does so at this time. */ -void -_mesa_accum(struct gl_context *ctx, GLenum op, GLfloat value) +static void +accum(struct gl_context *ctx, GLenum op, GLfloat value) { GLint xpos, ypos, width, height; @@ -477,7 +426,7 @@ _mesa_accum(struct gl_context *ctx, GLenum op, GLfloat value) accum_return(ctx, value, xpos, ypos, width, height); break; default: - _mesa_problem(ctx, "invalid mode in _mesa_accum()"); + _mesa_problem(ctx, "invalid mode in _mesa_Accum()"); break; } } @@ -489,3 +438,54 @@ _mesa_init_accum( struct gl_context *ctx ) /* Accumulate buffer group */ ASSIGN_4V( ctx->Accum.ClearColor, 0.0, 0.0, 0.0, 0.0 ); } + + +void GLAPIENTRY +_mesa_Accum( GLenum op, GLfloat value ) +{ + GET_CURRENT_CONTEXT(ctx); + FLUSH_VERTICES(ctx, 0); + + switch (op) { + case GL_ADD: + case GL_MULT: + case GL_ACCUM: + case GL_LOAD: + case GL_RETURN: + /* OK */ + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glAccum(op)"); + return; + } + + if (ctx->DrawBuffer->Visual.haveAccumBuffer == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glAccum(no accum buffer)"); + return; + } + + if (ctx->DrawBuffer != ctx->ReadBuffer) { + /* See GLX_SGI_make_current_read or WGL_ARB_make_current_read, + * or GL_EXT_framebuffer_blit. + */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glAccum(different read/draw buffers)"); + return; + } + + if (ctx->NewState) + _mesa_update_state(ctx); + + if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, + "glAccum(incomplete framebuffer)"); + return; + } + + if (ctx->RasterDiscard) + return; + + if (ctx->RenderMode == GL_RENDER) { + accum(ctx, op, value); + } +} diff --git a/src/mesa/main/accum.h b/src/mesa/main/accum.h index ede2ecca86a..fe253a20db6 100644 --- a/src/mesa/main/accum.h +++ b/src/mesa/main/accum.h @@ -47,9 +47,6 @@ void GLAPIENTRY _mesa_Accum( GLenum op, GLfloat value ); extern void -_mesa_accum(struct gl_context *ctx, GLenum op, GLfloat value); - -extern void _mesa_clear_accum_buffer(struct gl_context *ctx); extern void |