summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_imaging.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-07-09 01:22:50 +0000
committerBrian Paul <[email protected]>2002-07-09 01:22:50 +0000
commit3b4fbbc129c711a5aec8d653d5c6eb2e195f947c (patch)
treeececa2d3a08ab45afd2068d9cabf5609a0c374d1 /src/mesa/swrast/s_imaging.c
parentb4338e58879a4f2eabf8af09f9dfa7adf6e9f9f2 (diff)
Overhaul of glRead/DrawBuffer() code. Now, swrast->Driver.SetBuffer()
indicates the read AND draw color buffer for all software rasterization. Lots of related clean-ups. See RELNOTES-4.1 for details.
Diffstat (limited to 'src/mesa/swrast/s_imaging.c')
-rw-r--r--src/mesa/swrast/s_imaging.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c
index 1c63f5c3416..98cbe347a72 100644
--- a/src/mesa/swrast/s_imaging.c
+++ b/src/mesa/swrast/s_imaging.c
@@ -1,4 +1,4 @@
-/* $Id: s_imaging.c,v 1.5 2002/04/04 16:53:00 brianp Exp $ */
+/* $Id: s_imaging.c,v 1.6 2002/07/09 01:22:52 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -37,12 +37,10 @@ _swrast_CopyColorTable( GLcontext *ctx,
GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan data[MAX_WIDTH][4];
/* Select buffer to read from */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
+ _swrast_use_read_buffer(ctx);
if (width > MAX_WIDTH)
width = MAX_WIDTH;
@@ -51,8 +49,7 @@ _swrast_CopyColorTable( GLcontext *ctx,
_mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data );
/* Restore reading from draw buffer (the default) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
+ _swrast_use_draw_buffer(ctx);
glColorTable(target, internalformat, width, GL_RGBA, CHAN_TYPE, data);
}
@@ -61,12 +58,10 @@ void
_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width)
{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan data[MAX_WIDTH][4];
/* Select buffer to read from */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
- ctx->Pixel.DriverReadBuffer );
+ _swrast_use_read_buffer(ctx);
if (width > MAX_WIDTH)
width = MAX_WIDTH;
@@ -75,8 +70,7 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
_mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data );
/* Restore reading from draw buffer (the default) */
- (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
- ctx->Color.DriverDrawBuffer );
+ _swrast_use_draw_buffer(ctx);
glColorSubTable(target, start, width, GL_RGBA, CHAN_TYPE, data);
}
@@ -90,6 +84,9 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan rgba[MAX_CONVOLUTION_WIDTH][4];
+ /* Select buffer to read from */
+ _swrast_use_read_buffer(ctx);
+
RENDER_START( swrast, ctx );
/* read the data from framebuffer */
@@ -98,6 +95,9 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
RENDER_FINISH( swrast, ctx );
+ /* Restore reading from draw buffer (the default) */
+ _swrast_use_draw_buffer(ctx);
+
/* store as convolution filter */
glConvolutionFilter1D(target, internalFormat, width,
GL_RGBA, CHAN_TYPE, rgba);
@@ -114,6 +114,9 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4];
GLint i;
+ /* Select buffer to read from */
+ _swrast_use_read_buffer(ctx);
+
RENDER_START(swrast,ctx);
/* read pixels from framebuffer */
@@ -124,6 +127,9 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
RENDER_FINISH(swrast,ctx);
+ /* Restore reading from draw buffer (the default) */
+ _swrast_use_draw_buffer(ctx);
+
/*
* HACK: save & restore context state so we can store this as a
* convolution filter via the GL api. Doesn't call any callbacks