From 1309ad303559731a2f4f47fa07dbf0447b859ec2 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <thunderbird2k@gmail.com>
Date: Fri, 30 Oct 2009 11:21:32 +0100
Subject: [PATCH 2/2] Make sure the formats match in XRender_GetSrcAreaStretch.

---
 dlls/winex11.drv/xrender.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index 7899a61..943013d 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -2103,6 +2103,7 @@ BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE
     int height = visRectDst->bottom - visRectDst->top;
     int x_src = physDevSrc->dc_rect.left + visRectSrc->left;
     int y_src = physDevSrc->dc_rect.top + visRectSrc->top;
+    struct xrender_info *src_info = get_xrender_info(physDevSrc);
     const WineXRenderFormat *dst_format = get_xrender_format_from_color_shifts(physDevDst->depth, physDevDst->color_shifts);
     Picture src_pict=0, dst_pict=0, mask_pict=0;
 
@@ -2130,8 +2131,8 @@ BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE
     if((physDevDst->depth == 1) && (physDevSrc->depth > 1))
         return FALSE;
 
-    /* Just use traditional X copy when the depths match and we don't need stretching */
-    if((physDevSrc->depth == physDevDst->depth) && !stretch)
+    /* Just use traditional X copy when the formats match and we don't need stretching */
+    if((src_info->format->format == dst_format->format) && !stretch)
     {
         TRACE("Source and destination depth match and no stretching needed falling back to XCopyArea\n");
         wine_tsx11_lock();
-- 
1.6.3.3

