From ffe218bbb0ffa6d2a7f7cbf6b1f81797e667183a Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 5 Mar 2012 09:59:38 +0100 Subject: libfontenc xserver pixman mesa git update 5 Mar 2012 font-util-1.3.0 xclock-1.0.6 libXfont-1.4.5 inputproto-2.2 --- mesalib/src/gallium/auxiliary/util/u_blit.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'mesalib/src/gallium/auxiliary/util/u_blit.c') diff --git a/mesalib/src/gallium/auxiliary/util/u_blit.c b/mesalib/src/gallium/auxiliary/util/u_blit.c index a10fd17cb..127973388 100644 --- a/mesalib/src/gallium/auxiliary/util/u_blit.c +++ b/mesalib/src/gallium/auxiliary/util/u_blit.c @@ -320,6 +320,26 @@ regions_overlap(int srcX0, int srcY0, } +/** + * Can we blit from src format to dest format with a simple copy? + */ +static boolean +formats_compatible(enum pipe_format src_format, + enum pipe_format dst_format) +{ + if (src_format == dst_format) { + return TRUE; + } + else { + const struct util_format_description *src_desc = + util_format_description(src_format); + const struct util_format_description *dst_desc = + util_format_description(dst_format); + return util_is_format_compatible(src_desc, dst_desc); + } +} + + /** * Copy pixel block from src surface to dst surface. * Overlapping regions are acceptable. @@ -377,7 +397,7 @@ util_blit_pixels_writemask(struct blit_state *ctx, * no overlapping. * Filter mode should not matter since there's no stretching. */ - if (dst_format == src_format && + if (formats_compatible(src_format, dst_format) && srcX0 < srcX1 && dstX0 < dstX1 && srcY0 < srcY1 && -- cgit v1.2.3