summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_accum.c14
-rw-r--r--src/mesa/swrast/swrast.h4
2 files changed, 11 insertions, 7 deletions
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index 0b8ad007623..69e9404c55c 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 6d384fbec26..04bd01a0cdc 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);