summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-10-18 18:35:09 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-10-18 18:35:09 +0000
commitccb64bbb2a32761efa076ebafa7ccdaf2d412b0e (patch)
tree8106d379716805f2eca690bb3e4d5e8a04c00a23 /src
parent4e4c0bbef7a795d73685794e3329ea81654924b5 (diff)
Don't pass x/y/width/height to ctx->Driver.Accum().
Compute the region after we've locked (and possibly updated the buffer's size). Same thing is needed for ctx->Driver.Clear().
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/accum.c6
-rw-r--r--src/mesa/main/dd.h5
-rw-r--r--src/mesa/swrast/s_accum.c14
-rw-r--r--src/mesa/swrast/swrast.h4
4 files changed, 14 insertions, 15 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index a6e422640c..2345695f3c 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -94,11 +94,7 @@ _mesa_Accum( GLenum op, GLfloat value )
}
if (ctx->RenderMode == GL_RENDER) {
- GLint x = ctx->DrawBuffer->_Xmin;
- GLint y = ctx->DrawBuffer->_Ymin;
- GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
- ctx->Driver.Accum(ctx, op, value, x, y, width, height);
+ ctx->Driver.Accum(ctx, op, value);
}
}
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 716c13ca28..a1999ac76d 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -118,10 +118,9 @@ struct dd_function_table {
*/
/*@{*/
/**
- * Execute glAccum command within the given scissor region.
+ * Execute glAccum command.
*/
- void (*Accum)( GLcontext *ctx, GLenum op, GLfloat value,
- GLint xpos, GLint ypos, GLint width, GLint height );
+ void (*Accum)( GLcontext *ctx, GLenum op, GLfloat value );
/*@}*/
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index 0b8ad00762..69e9404c55 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -541,12 +541,10 @@ accum_return(GLcontext *ctx, GLfloat value,
* Software fallback for glAccum.
*/
void
-_swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
- GLint xpos, GLint ypos,
- GLint width, GLint height )
-
+_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ GLint xpos, ypos, width, height;
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
@@ -558,6 +556,14 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
RENDER_START(swrast, ctx);
+ /* Compute region after calling RENDER_START so that we know the
+ * drawbuffer's size/bounds are up to date.
+ */
+ xpos = ctx->DrawBuffer->_Xmin;
+ ypos = ctx->DrawBuffer->_Ymin;
+ width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+
switch (op) {
case GL_ADD:
if (value != 0.0F) {
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index 6d384fbec2..04bd01a0cd 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -134,9 +134,7 @@ _swrast_Clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height );
extern void
-_swrast_Accum( GLcontext *ctx, GLenum op,
- GLfloat value, GLint xpos, GLint ypos,
- GLint width, GLint height );
+_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value);