aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-11-21 23:01:22 +0000
committerBrian Paul <[email protected]>2000-11-21 23:01:22 +0000
commitbaf3e77ee2ea0a8721715d540d88066771f2dd67 (patch)
treede4eb13f430e5a5ce732654b886d37c21f367552 /src/mesa/main
parent3c2e1022ed0a9fab82fddedd3ba4e20361665336 (diff)
added some RENDER_START/RENDER_FINISH macros. Minor GLchan changes
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/colortab.c6
-rw-r--r--src/mesa/main/convolve.c15
2 files changed, 14 insertions, 7 deletions
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index 12c8dbbde7a..63b58e57f7b 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -1,4 +1,4 @@
-/* $Id: colortab.c,v 1.27 2000/11/19 23:10:25 brianp Exp $ */
+/* $Id: colortab.c,v 1.28 2000/11/21 23:01:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -633,7 +633,9 @@ _mesa_CopyColorTable(GLenum target, GLenum internalformat,
width = MAX_WIDTH;
/* read the data from framebuffer */
+ RENDER_START(ctx);
gl_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data );
+ RENDER_FINISH(ctx);
/* Restore reading from draw buffer (the default) */
(*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
@@ -662,7 +664,9 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start,
width = MAX_WIDTH;
/* read the data from framebuffer */
+ RENDER_START(ctx);
gl_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data );
+ RENDER_FINISH(ctx);
/* Restore reading from draw buffer (the default) */
(*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c
index aa4af92e94c..1641f497d87 100644
--- a/src/mesa/main/convolve.c
+++ b/src/mesa/main/convolve.c
@@ -1,4 +1,4 @@
-/* $Id: convolve.c,v 1.11 2000/11/10 18:31:04 brianp Exp $ */
+/* $Id: convolve.c,v 1.12 2000/11/21 23:01:22 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -464,7 +464,7 @@ void
_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
{
GLenum baseFormat;
- GLfloat rgba[MAX_CONVOLUTION_WIDTH][4];
+ GLchan rgba[MAX_CONVOLUTION_WIDTH][4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyConvolutionFilter1D");
@@ -485,11 +485,13 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi
}
/* read pixels from framebuffer */
+ RENDER_START(ctx);
gl_read_rgba_span(ctx, ctx->ReadBuffer, width, x, y, (GLchan (*)[4]) rgba);
+ RENDER_FINISH(ctx);
/* store as convolution filter */
_mesa_ConvolutionFilter1D(target, internalFormat, width,
- GL_RGBA, GL_UNSIGNED_BYTE, rgba);
+ GL_RGBA, CHAN_TYPE, rgba);
}
@@ -499,7 +501,7 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi
GLenum baseFormat;
GLint i;
struct gl_pixelstore_attrib packSave;
- GLfloat rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4];
+ GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyConvolutionFilter2D");
@@ -524,10 +526,12 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi
}
/* read pixels from framebuffer */
+ RENDER_START(ctx);
for (i = 0; i < height; i++) {
gl_read_rgba_span(ctx, ctx->ReadBuffer, width, x, y + i,
(GLchan (*)[4]) rgba[i]);
}
+ RENDER_FINISH(ctx);
/*
* store as convolution filter
@@ -545,7 +549,7 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi
ctx->NewState |= _NEW_PACKUNPACK;
_mesa_ConvolutionFilter2D(target, internalFormat, width, height,
- GL_RGBA, GL_UNSIGNED_BYTE, rgba);
+ GL_RGBA, CHAN_TYPE, rgba);
ctx->Unpack = packSave; /* restore pixel packing params */
ctx->NewState |= _NEW_PACKUNPACK;
@@ -587,7 +591,6 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *im
filter->Height, format, type,
0, row, 0);
const GLfloat *src = filter->Filter + row * filter->Width * 4;
- /* XXX apply transfer ops or not? */
_mesa_pack_float_rgba_span(ctx, filter->Width,
(const GLfloat (*)[4]) src,
format, type, dst, &ctx->Pack, 0);