Comment out __FUNCTION__ usage.
[mesa.git] / src / mesa / main / convolve.c
index 0b1d4113c6fe917a9a9a0fa9582c8d715fea4348..faea445e4c8a7ab8f2abd6129707b63a9f147a16 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: convolve.c,v 1.20 2001/03/03 20:33:27 brianp Exp $ */
+/* $Id: convolve.c,v 1.24 2001/05/09 22:24:22 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -243,7 +243,7 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G
    {
       const GLfloat *scale = ctx->Pixel.ConvolutionFilterScale[1];
       const GLfloat *bias = ctx->Pixel.ConvolutionFilterBias[1];
-      for (i = 0; i < width * height * 4; i++) {
+      for (i = 0; i < width * height; i++) {
          GLfloat r = ctx->Convolution2D.Filter[i * 4 + 0];
          GLfloat g = ctx->Convolution2D.Filter[i * 4 + 1];
          GLfloat b = ctx->Convolution2D.Filter[i * 4 + 2];
@@ -468,7 +468,6 @@ void
 _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width)
 {
    GLenum baseFormat;
-   GLchan rgba[MAX_CONVOLUTION_WIDTH][4];
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
@@ -488,14 +487,8 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi
       return;
    }
 
-   /* read pixels from framebuffer */
-   RENDER_START(ctx);
-   _mesa_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, CHAN_TYPE, rgba);
+   ctx->Driver.CopyConvolutionFilter1D( ctx, target, 
+                                       internalFormat, x, y, width);
 }
 
 
@@ -503,9 +496,6 @@ void
 _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height)
 {
    GLenum baseFormat;
-   GLint i;
-   struct gl_pixelstore_attrib packSave;
-   GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4];
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
@@ -529,34 +519,9 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi
       return;
    }
 
-   /* read pixels from framebuffer */
-   RENDER_START(ctx);
-   for (i = 0; i < height; i++) {
-      _mesa_read_rgba_span(ctx, ctx->ReadBuffer, width, x, y + i,
-                        (GLchan (*)[4]) rgba[i]);
-   }
-   RENDER_FINISH(ctx);
-
-   /*
-    * store as convolution filter
-    */
-   packSave = ctx->Unpack;  /* save pixel packing params */
-
-   ctx->Unpack.Alignment = 1;
-   ctx->Unpack.RowLength = MAX_CONVOLUTION_WIDTH;
-   ctx->Unpack.SkipPixels = 0;
-   ctx->Unpack.SkipRows = 0;
-   ctx->Unpack.ImageHeight = 0;
-   ctx->Unpack.SkipImages = 0;
-   ctx->Unpack.SwapBytes = GL_FALSE;
-   ctx->Unpack.LsbFirst = GL_FALSE;
-   ctx->NewState |= _NEW_PACKUNPACK;   
-
-   _mesa_ConvolutionFilter2D(target, internalFormat, width, height,
-                             GL_RGBA, CHAN_TYPE, rgba);
-
-   ctx->Unpack = packSave;  /* restore pixel packing params */
-   ctx->NewState |= _NEW_PACKUNPACK;   
+   ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y, 
+                                       width, height );
+
 }
 
 
@@ -564,7 +529,7 @@ void
 _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image)
 {
    const struct gl_convolution_attrib *filter;
-   GLint row;
+   GLuint row;
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
@@ -1450,4 +1415,3 @@ _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions,
       *height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1);
    }
 }
-