Browse Source

Fix a front/back CopyPixels glitch.

tags/R300_DRIVER_0
Brian Paul 22 years ago
parent
commit
a6ad01c14e
2 changed files with 32 additions and 10 deletions
  1. 4
    2
      src/mesa/drivers/x11/xm_dd.c
  2. 28
    8
      src/mesa/swrast/s_copypix.c

+ 4
- 2
src/mesa/drivers/x11/xm_dd.c View File

@@ -930,7 +930,9 @@ xmesa_CopyPixels( GLcontext *ctx,
ASSERT(dpy);
ASSERT(gc);

if (drawBuffer && /* buffer != 0 means it's a Window or Pixmap */
if (ctx->Color.DrawBuffer == GL_FRONT &&
ctx->Pixel.ReadBuffer == GL_FRONT &&
drawBuffer && /* buffer != 0 means it's a Window or Pixmap */
readBuffer &&
type == GL_COLOR &&
(swrast->_RasterMask & ~CLIP_BIT) == 0 && /* no blend, z-test, etc */
@@ -1120,7 +1122,7 @@ void xmesa_init_pointers( GLcontext *ctx )
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.CopyPixels = _swrast_CopyPixels;
#else
ctx->Driver.CopyPixels = xmesa_CopyPixels;
ctx->Driver.CopyPixels = /*_swrast_CopyPixels;*/xmesa_CopyPixels;
if (xmesa->xm_visual->undithered_pf == PF_8R8G8B &&
xmesa->xm_visual->dithered_pf == PF_8R8G8B) {
ctx->Driver.DrawPixels = xmesa_DrawPixels_8R8G8B;

+ 28
- 8
src/mesa/swrast/s_copypix.c View File

@@ -310,8 +310,13 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
stepy = 1;
}

overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
if (ctx->DrawBuffer == ctx->ReadBuffer) {
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
}
else {
overlapping = GL_FALSE;
}

if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
@@ -521,8 +526,13 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
stepy = 1;
}

overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
if (ctx->DrawBuffer == ctx->ReadBuffer) {
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
}
else {
overlapping = GL_FALSE;
}

if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
@@ -636,8 +646,13 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
stepy = 1;
}

overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
if (ctx->DrawBuffer == ctx->ReadBuffer) {
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
}
else {
overlapping = GL_FALSE;
}

_swrast_span_default_color(ctx, &span);
if (ctx->Fog.Enabled)
@@ -736,8 +751,13 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
stepy = 1;
}

overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
if (ctx->DrawBuffer == ctx->ReadBuffer) {
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
}
else {
overlapping = GL_FALSE;
}

if (overlapping) {
GLint ssy = sy;

Loading…
Cancel
Save