summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-02-18 10:18:34 -0700
committerBrian Paul <[email protected]>2011-02-18 10:24:41 -0700
commit09f14a60867ed902a27307da090e429546d8e838 (patch)
tree985da70a5ee2be8e94e53233d5af590bbe6fb0b9 /src/mesa/state_tracker
parent0ced789a0b56256891a2a26342befe645f4fa46d (diff)
st/mesa: check buffer orientation in blit_copy_pixels()
Can't invert the region if copying between surfaces with different orientations.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index aaa5bbff679..c0da1696247 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -1188,6 +1188,7 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
!ctx->FragmentProgram.Enabled &&
!ctx->VertexProgram.Enabled &&
!ctx->Shader.CurrentFragmentProgram &&
+ st_fb_orientation(ctx->ReadBuffer) == st_fb_orientation(ctx->DrawBuffer) &&
ctx->DrawBuffer->_NumColorDrawBuffers == 1) {
struct st_renderbuffer *rbRead, *rbDraw;
GLint drawX, drawY;
@@ -1226,11 +1227,11 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
struct pipe_box srcBox;
/* flip src/dst position if needed */
- if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP)
+ if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) {
+ /* both buffers will have the same orientation */
readY = ctx->ReadBuffer->Height - readY - readH;
-
- if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP)
drawY = ctx->DrawBuffer->Height - drawY - readH;
+ }
u_box_2d(readX, readY, readW, readH, &srcBox);