summaryrefslogtreecommitdiff
path: root/src/mesa/pipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_surface.c5
-rw-r--r--src/mesa/pipe/i915simple/i915_blit.c1
-rw-r--r--src/mesa/pipe/i915simple/i915_blit.h1
-rw-r--r--src/mesa/pipe/i915simple/i915_surface.c6
-rw-r--r--src/mesa/pipe/i965simple/brw_blit.c1
-rw-r--r--src/mesa/pipe/i965simple/brw_blit.h1
-rw-r--r--src/mesa/pipe/i965simple/brw_surface.c6
-rw-r--r--src/mesa/pipe/p_context.h1
-rw-r--r--src/mesa/pipe/p_util.h2
-rw-r--r--src/mesa/pipe/softpipe/sp_surface.c5
-rw-r--r--src/mesa/pipe/util/p_util.c4
-rw-r--r--src/mesa/pipe/xlib/xm_api.c1
12 files changed, 23 insertions, 11 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_surface.c b/src/mesa/pipe/cell/ppu/cell_surface.c
index 6b7b918128..fca93e4742 100644
--- a/src/mesa/pipe/cell/ppu/cell_surface.c
+++ b/src/mesa/pipe/cell/ppu/cell_surface.c
@@ -60,6 +60,7 @@ cell_surface_data(struct pipe_context *pipe,
static void
cell_surface_copy(struct pipe_context *pipe,
+ unsigned do_flip,
struct pipe_surface *dst,
unsigned dstx, unsigned dsty,
struct pipe_surface *src,
@@ -74,8 +75,8 @@ cell_surface_copy(struct pipe_context *pipe,
dstx, dsty,
width, height,
pipe_surface_map(src),
- 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);
diff --git a/src/mesa/pipe/i915simple/i915_blit.c b/src/mesa/pipe/i915simple/i915_blit.c
index d49876f970..db4671ff55 100644
--- a/src/mesa/pipe/i915simple/i915_blit.c
+++ b/src/mesa/pipe/i915simple/i915_blit.c
@@ -85,6 +85,7 @@ i915_fill_blit(struct i915_context *i915,
void
i915_copy_blit( struct i915_context *i915,
+ unsigned do_flip,
unsigned cpp,
short src_pitch,
struct pipe_buffer *src_buffer,
diff --git a/src/mesa/pipe/i915simple/i915_blit.h b/src/mesa/pipe/i915simple/i915_blit.h
index d7a66be10a..6e5b44e124 100644
--- a/src/mesa/pipe/i915simple/i915_blit.h
+++ b/src/mesa/pipe/i915simple/i915_blit.h
@@ -31,6 +31,7 @@
#include "i915_context.h"
extern void i915_copy_blit(struct i915_context *i915,
+ unsigned do_flip,
unsigned cpp,
short src_pitch,
struct pipe_buffer *src_buffer,
diff --git a/src/mesa/pipe/i915simple/i915_surface.c b/src/mesa/pipe/i915simple/i915_surface.c
index 1bdaba773f..6d4b8a0aa9 100644
--- a/src/mesa/pipe/i915simple/i915_surface.c
+++ b/src/mesa/pipe/i915simple/i915_surface.c
@@ -83,6 +83,7 @@ i915_get_tex_surface(struct pipe_context *pipe,
*/
static void
i915_surface_copy(struct pipe_context *pipe,
+ unsigned do_flip,
struct pipe_surface *dst,
unsigned dstx, unsigned dsty,
struct pipe_surface *src,
@@ -98,14 +99,15 @@ i915_surface_copy(struct pipe_context *pipe,
dstx, dsty,
width, height,
pipe_surface_map(src),
- 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 {
i915_copy_blit( i915_context(pipe),
+ do_flip,
dst->cpp,
(short) src->pitch, src->buffer, src->offset,
(short) dst->pitch, dst->buffer, dst->offset,
diff --git a/src/mesa/pipe/i965simple/brw_blit.c b/src/mesa/pipe/i965simple/brw_blit.c
index bbd366294f..8494f70493 100644
--- a/src/mesa/pipe/i965simple/brw_blit.c
+++ b/src/mesa/pipe/i965simple/brw_blit.c
@@ -111,6 +111,7 @@ static unsigned translate_raster_op(unsigned logicop)
/* Copy BitBlt
*/
void brw_copy_blit(struct brw_context *brw,
+ unsigned do_flip,
unsigned cpp,
short src_pitch,
struct pipe_buffer *src_buffer,
diff --git a/src/mesa/pipe/i965simple/brw_blit.h b/src/mesa/pipe/i965simple/brw_blit.h
index 7f17a70173..111c5d91d3 100644
--- a/src/mesa/pipe/i965simple/brw_blit.h
+++ b/src/mesa/pipe/i965simple/brw_blit.h
@@ -16,6 +16,7 @@ void brw_fill_blit(struct brw_context *intel,
short w, short h,
unsigned color);
void brw_copy_blit(struct brw_context *intel,
+ unsigned do_flip,
unsigned cpp,
short src_pitch,
struct pipe_buffer *src_buffer,
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,
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h
index 92a1cd70c4..39f95695fb 100644
--- a/src/mesa/pipe/p_context.h
+++ b/src/mesa/pipe/p_context.h
@@ -178,6 +178,7 @@ struct pipe_context {
*/
void (*surface_copy)(struct pipe_context *pipe,
+ unsigned do_flip, /*<< flip surface contents vertically */
struct pipe_surface *dest,
unsigned destx, unsigned desty,
struct pipe_surface *src, /* don't make this const -
diff --git a/src/mesa/pipe/p_util.h b/src/mesa/pipe/p_util.h
index 469920efee..a8938a7e43 100644
--- a/src/mesa/pipe/p_util.h
+++ b/src/mesa/pipe/p_util.h
@@ -402,7 +402,7 @@ static INLINE int align(int value, int alignment)
extern void pipe_copy_rect(ubyte * dst, unsigned cpp, unsigned dst_pitch,
unsigned dst_x, unsigned dst_y, unsigned width,
unsigned height, const ubyte * src,
- unsigned src_pitch, unsigned src_x, unsigned src_y);
+ int src_pitch, unsigned src_x, int src_y);
#endif
diff --git a/src/mesa/pipe/softpipe/sp_surface.c b/src/mesa/pipe/softpipe/sp_surface.c
index 5978ee48bd..5c6ed3b8d9 100644
--- a/src/mesa/pipe/softpipe/sp_surface.c
+++ b/src/mesa/pipe/softpipe/sp_surface.c
@@ -40,6 +40,7 @@
*/
static void
sp_surface_copy(struct pipe_context *pipe,
+ unsigned do_flip,
struct pipe_surface *dst,
unsigned dstx, unsigned dsty,
struct pipe_surface *src,
@@ -53,8 +54,8 @@ sp_surface_copy(struct pipe_context *pipe,
dstx, dsty,
width, height,
pipe_surface_map(src),
- 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);
diff --git a/src/mesa/pipe/util/p_util.c b/src/mesa/pipe/util/p_util.c
index c4882b77d2..2a92f8e408 100644
--- a/src/mesa/pipe/util/p_util.c
+++ b/src/mesa/pipe/util/p_util.c
@@ -47,9 +47,9 @@ pipe_copy_rect(ubyte * dst,
unsigned width,
unsigned height,
const ubyte * src,
- unsigned src_pitch,
+ int src_pitch,
unsigned src_x,
- unsigned src_y)
+ int src_y)
{
unsigned i;
diff --git a/src/mesa/pipe/xlib/xm_api.c b/src/mesa/pipe/xlib/xm_api.c
index 03985eab5a..e5fef1d7a8 100644
--- a/src/mesa/pipe/xlib/xm_api.c
+++ b/src/mesa/pipe/xlib/xm_api.c
@@ -1229,6 +1229,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
return;
pipe->surface_copy(pipe,
+ FALSE,
surf_front, x, y, /* dest */
surf_back, x, y, /* src */
width, height);