From e922adbe1d6c1764968377658ea92ae6de0585db Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Wed, 13 Feb 2008 11:39:58 +0000 Subject: gallium: pipe->surface_copy can flip the contents vertically when necessary. Fixes gears being upside down on the box in demos/gearbox. --- src/mesa/state_tracker/st_cb_drawpixels.c | 1 + src/mesa/state_tracker/st_cb_texture.c | 3 +++ src/mesa/state_tracker/st_texture.c | 1 + 3 files changed, 5 insertions(+) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 3245a7488bc..f13199a3c0f 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -1259,6 +1259,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, if (st->haveFramebufferSurfaces) { /* copy source framebuffer surface into mipmap/texture */ pipe->surface_copy(pipe, + FALSE, psTex, /* dest */ 0, 0, /* destx/y */ psRead, diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 0ea367549b8..91a40288cc7 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1132,6 +1132,7 @@ do_copy_texsubimage(GLcontext *ctx, struct pipe_context *pipe = ctx->st->pipe; struct pipe_surface *dest_surface; uint dest_format, src_format; + uint do_flip = FALSE; (void) texImage; @@ -1153,6 +1154,7 @@ do_copy_texsubimage(GLcontext *ctx, if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) { srcY = strb->Base.Height - srcY - height; + do_flip = TRUE; } src_format = strb->surface->format; @@ -1190,6 +1192,7 @@ do_copy_texsubimage(GLcontext *ctx, #else pipe->surface_copy(pipe, + do_flip, /* dest */ dest_surface, destX, destY, diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 2622d009530..b86f416c9b4 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -300,6 +300,7 @@ st_texture_image_copy(struct pipe_context *pipe, src_surface = pipe->get_tex_surface(pipe, src, face, srcLevel, i); pipe->surface_copy(pipe, + FALSE, dst_surface, 0, 0, /* destX, Y */ src_surface, -- cgit v1.2.3