diff options
author | Brian Paul <[email protected]> | 2000-10-31 23:11:06 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-10-31 23:11:06 +0000 |
commit | acdb6db846de9f3dcf97ab918e2d89781f238592 (patch) | |
tree | c3c88d33c614c0fd9eaa06ca827f6df1ceceb692 /src/mesa | |
parent | fda3b1a4b18c917f15fe9aa2b83f166a2fa9d24b (diff) |
Always call Driver.SetReadBuffer() in copy pixels functions, just to be safe
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/swrast/s_copypix.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index eddfe390371..baa9b0454d9 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -1,4 +1,4 @@ -/* $Id: s_copypix.c,v 1.1 2000/10/31 18:00:04 keithw Exp $ */ +/* $Id: s_copypix.c,v 1.2 2000/10/31 23:11:06 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -329,7 +329,10 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, /* If read and draw buffer are different we must do buffer switching */ saveReadAlpha = ctx->ReadBuffer->Alpha; changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer - || ctx->DrawBuffer != ctx->ReadBuffer; + || ctx->DrawBuffer != ctx->ReadBuffer; + + (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer, + ctx->Pixel.DriverReadBuffer ); if (overlapping) { GLint ssy = sy; @@ -487,6 +490,10 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } } + /* Restore pixel source to be the draw buffer (for blending, etc) */ + (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, + ctx->Color.DriverDrawBuffer ); + if (overlapping) FREE(tmpImage); } @@ -534,6 +541,9 @@ static void copy_ci_pixels( GLcontext *ctx, changeBuffer = ctx->Pixel.ReadBuffer != ctx->Color.DrawBuffer || ctx->DrawBuffer != ctx->ReadBuffer; + (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer, + ctx->Pixel.DriverReadBuffer ); + if (overlapping) { GLint ssy = sy; tmpImage = (GLuint *) MALLOC(width * height * sizeof(GLuint)); @@ -592,6 +602,10 @@ static void copy_ci_pixels( GLcontext *ctx, } } + /* Restore pixel source to be the draw buffer (for blending, etc) */ + (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, + ctx->Color.DriverDrawBuffer ); + if (overlapping) FREE(tmpImage); } |