gallium: Use surface_copy for 1:1 blits.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 3 Jul 2008 06:02:56 +0000 (15:02 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 3 Jul 2008 06:06:24 +0000 (15:06 +0900)
src/gallium/auxiliary/util/u_blit.c

index ae779335dc0b10eade7254e77be288c32e0ae41c..c9e3abc88bee1cc79d135c17240c492d5e6179f3 100644 (file)
@@ -308,6 +308,16 @@ util_blit_pixels(struct blit_state *ctx,
    }
 
    assert(screen->is_format_supported(screen, src->format, PIPE_TEXTURE));
+   assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE));
+
+   if(dst->format == src->format && (dstX1 - dstX0) == srcW && (dstY1 - dstY0) == srcH) {
+      pipe->surface_copy(pipe, FALSE,
+                        dst, dstX0, dstY0,   /* dest */
+                        src, srcX0, srcY0, /* src */
+                        srcW, srcH);     /* size */
+      return;
+   }
+   
    assert(screen->is_format_supported(screen, dst->format, PIPE_SURFACE));
 
    /*