Merge branch 'mesa_7_5_branch'
[mesa.git] / src / gallium / drivers / i965simple / brw_surface.c
index b89756c47b0245f4b7857943ec3afcfa7355bdb3..511779dbfa04a9c00aa9080087958ace904064dd 100644 (file)
@@ -30,7 +30,7 @@
 #include "brw_state.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_inlines.h"
-#include "pipe/p_winsys.h"
+#include "pipe/internal/p_winsys_screen.h"
 #include "util/u_tile.h"
 #include "util/u_rect.h"
 
@@ -41,7 +41,6 @@
  */
 static void
 brw_surface_copy(struct pipe_context *pipe,
-                 boolean do_flip,
                  struct pipe_surface *dst,
                  unsigned dstx, unsigned dsty,
                  struct pipe_surface *src,
@@ -64,23 +63,25 @@ brw_surface_copy(struct pipe_context *pipe,
       pipe_copy_rect(dst_map,
                      &dst->block,
                      dst->stride,
-                     dstx, dsty, 
-                     width, height, 
-                     src_map, 
-                     do_flip ? -(int) src->stride : src->stride, 
-                     srcx, do_flip ? height - 1 - srcy : srcy);
+                     dstx, dsty,
+                     width, height,
+                     src_map,
+                     src->stride,
+                     srcx, srcy);
 
       pipe->screen->surface_unmap(pipe->screen, src);
       pipe->screen->surface_unmap(pipe->screen, dst);
    }
    else {
+      struct brw_texture *dst_tex = (struct brw_texture *)dst->texture;
+      struct brw_texture *src_tex = (struct brw_texture *)src->texture;
       assert(dst->block.width == 1);
       assert(dst->block.height == 1);
       brw_copy_blit(brw_context(pipe),
-                    do_flip,
+                    FALSE,
                     dst->block.size,
-                    (short) src->stride/src->block.size, src->buffer, src->offset, FALSE,
-                    (short) dst->stride/dst->block.size, dst->buffer, dst->offset, FALSE,
+                    (short) src->stride/src->block.size, src_tex->buffer, src->offset, FALSE,
+                    (short) dst->stride/dst->block.size, dst_tex->buffer, dst->offset, FALSE,
                     (short) srcx, (short) srcy, (short) dstx, (short) dsty,
                     (short) width, (short) height, PIPE_LOGICOP_COPY);
    }
@@ -103,12 +104,13 @@ brw_surface_fill(struct pipe_context *pipe,
       pipe->screen->surface_unmap(pipe->screen, dst);
    }
    else {
+      struct brw_texture *tex = (struct brw_texture *)dst->texture;
       assert(dst->block.width == 1);
       assert(dst->block.height == 1);
       brw_fill_blit(brw_context(pipe),
                     dst->block.size,
                     (short) dst->stride/dst->block.size, 
-                    dst->buffer, dst->offset, FALSE,
+                    tex->buffer, dst->offset, FALSE,
                     (short) dstx, (short) dsty,
                     (short) width, (short) height,
                     value);