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/pipe/i965simple/brw_surface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa/pipe/i965simple/brw_surface.c') diff --git a/src/mesa/pipe/i965simple/brw_surface.c b/src/mesa/pipe/i965simple/brw_surface.c index eb7835836e..518845e4b2 100644 --- a/src/mesa/pipe/i965simple/brw_surface.c +++ b/src/mesa/pipe/i965simple/brw_surface.c @@ -103,6 +103,7 @@ brw_surface_data(struct pipe_context *pipe, */ static void brw_surface_copy(struct pipe_context *pipe, + unsigned do_flip, struct pipe_surface *dst, unsigned dstx, unsigned dsty, struct pipe_surface *src, @@ -118,14 +119,15 @@ brw_surface_copy(struct pipe_context *pipe, dstx, dsty, width, height, pipe_surface_map(src) + src->offset, - src->pitch, - srcx, srcy); + do_flip ? -src->pitch : src->pitch, + srcx, do_flip ? 1 - srcy - height : srcy); pipe_surface_unmap(src); pipe_surface_unmap(dst); } else { brw_copy_blit(brw_context(pipe), + do_flip, dst->cpp, (short) src->pitch, src->buffer, src->offset, FALSE, (short) dst->pitch, dst->buffer, dst->offset, FALSE, -- cgit v1.2.3