Module: Mesa
Branch: master
Commit: dc3839ef3dc032627b7bb10b2c24786efc3ef5ec
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dc3839ef3dc032627b7bb10b2c24786efc3ef5ec

Author: Brian Paul <[email protected]>
Date:   Sat Sep 19 16:27:59 2009 -0600

mesa: move readbuffer tests

---

 src/mesa/main/colortab.c    |    9 ++++++++-
 src/mesa/main/convolve.c    |    8 ++++++++
 src/mesa/swrast/s_imaging.c |   20 --------------------
 3 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index fcd54bc..5447eb1 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -543,7 +543,10 @@ _mesa_CopyColorTable(GLenum target, GLenum internalformat,
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
-   /* Select buffer to read from */
+   if (!ctx->ReadBuffer->_ColorReadBuffer) {
+      return;      /* no readbuffer - OK */
+   }
+
    ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width );
 }
 
@@ -556,6 +559,10 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start,
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
+   if (!ctx->ReadBuffer->_ColorReadBuffer) {
+      return;      /* no readbuffer - OK */
+   }
+
    ctx->Driver.CopyColorSubTable( ctx, target, start, x, y, width );
 }
 
diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c
index 7095111..bf6f661 100644
--- a/src/mesa/main/convolve.c
+++ b/src/mesa/main/convolve.c
@@ -482,6 +482,10 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum 
internalFormat, GLint x, GLi
       return;
    }
 
+   if (!ctx->ReadBuffer->_ColorReadBuffer) {
+      return;      /* no readbuffer - OK */
+   }
+
    ctx->Driver.CopyConvolutionFilter1D( ctx, target, 
                                        internalFormat, x, y, width);
 }
@@ -514,6 +518,10 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum 
internalFormat, GLint x, GLi
       return;
    }
 
+   if (!ctx->ReadBuffer->_ColorReadBuffer) {
+      return;      /* no readbuffer - OK */
+   }
+
    ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y, 
                                        width, height );
 }
diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c
index 3578b71..5a860a5 100644
--- a/src/mesa/swrast/s_imaging.c
+++ b/src/mesa/swrast/s_imaging.c
@@ -42,11 +42,6 @@ _swrast_CopyColorTable( GLcontext *ctx,
    GLchan data[MAX_WIDTH][4];
    struct gl_buffer_object *bufferSave;
 
-   if (!ctx->ReadBuffer->_ColorReadBuffer) {
-      /* no readbuffer - OK */
-      return;
-   }
-
    if (width > MAX_WIDTH)
       width = MAX_WIDTH;
 
@@ -76,11 +71,6 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, 
GLsizei start,
    GLchan data[MAX_WIDTH][4];
    struct gl_buffer_object *bufferSave;
 
-   if (!ctx->ReadBuffer->_ColorReadBuffer) {
-      /* no readbuffer - OK */
-      return;
-   }
-
    if (width > MAX_WIDTH)
       width = MAX_WIDTH;
 
@@ -111,11 +101,6 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum 
target,
    GLchan rgba[MAX_CONVOLUTION_WIDTH][4];
    struct gl_buffer_object *bufferSave;
 
-   if (!ctx->ReadBuffer->_ColorReadBuffer) {
-      /* no readbuffer - OK */
-      return;
-   }
-
    swrast_render_start(ctx);
 
    /* read the data from framebuffer */
@@ -147,11 +132,6 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum 
target,
    GLint i;
    struct gl_buffer_object *bufferSave;
 
-   if (!ctx->ReadBuffer->_ColorReadBuffer) {
-      /* no readbuffer - OK */
-      return;
-   }
-
    swrast_render_start(ctx);
    
    /* read pixels from framebuffer */

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to