From cdd63c5493a4ca71b790c41b6a9fe8b2fc0700d7 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <thunderbird2k@gmail.com>
Date: Thu, 1 Oct 2009 21:40:42 +0200
Subject: [PATCH] Get rid of some parameters to simplify X11DRV_XRender_GetSrcAreaStretch.

---
 dlls/winex11.drv/bitblt.c  |    1 -
 dlls/winex11.drv/x11drv.h  |    2 --
 dlls/winex11.drv/xrender.c |   28 +++++++++++++---------------
 3 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c
index 435e2c2..c0a9273 100644
--- a/dlls/winex11.drv/bitblt.c
+++ b/dlls/winex11.drv/bitblt.c
@@ -1589,7 +1589,6 @@ BOOL CDECL X11DRV_StretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, IN
         if (physDevDst != physDevSrc) X11DRV_CoerceDIBSection( physDevSrc, DIB_Status_GdiMod );
 
         if(!X11DRV_XRender_GetSrcAreaStretch( physDevSrc, physDevDst, pixmaps[SRC], tmpGC,
-                                              widthSrc, heightSrc, widthDst, heightDst,
                                               &visRectSrc, &visRectDst))
         {
             if (fStretch)
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 922855d..cd6c270 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -289,8 +289,6 @@ extern BOOL X11DRV_XRender_ExtTextOut(X11DRV_PDEVICE *physDev, INT x, INT y, UIN
 extern BOOL X11DRV_XRender_SetPhysBitmapDepth(X_PHYSBITMAP *physBitmap, const DIBSECTION *dib);
 BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,
                                       Pixmap pixmap, GC gc,
-                                      INT widthSrc, INT heightSrc,
-                                      INT widthDst, INT heightDst,
                                       RECT *visRectSrc, RECT *visRectDst);
 extern void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev);
 
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index 076b6d4..a1e883e 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -2051,28 +2051,28 @@ void X11DRV_XRender_CopyBrush(X11DRV_PDEVICE *physDev, X_PHYSBITMAP *physBitmap,
 
 BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,
                                       Pixmap pixmap, GC gc,
-                                      INT widthSrc, INT heightSrc,
-                                      INT widthDst, INT heightDst,
                                       RECT *visRectSrc, RECT *visRectDst )
 {
-    BOOL stretch = (widthSrc != widthDst) || (heightSrc != heightDst);
-    int width = visRectDst->right - visRectDst->left;
-    int height = visRectDst->bottom - visRectDst->top;
+    int width_dst = visRectDst->right - visRectDst->left;
+    int height_dst = visRectDst->bottom - visRectDst->top;
+    int width_src = visRectSrc->right - visRectSrc->left;
+    int height_src = visRectSrc->bottom - visRectSrc->top;
+    BOOL stretch = (width_src != width_dst) || (height_src != height_dst);
     int x_src = physDevSrc->dc_rect.left + visRectSrc->left;
     int y_src = physDevSrc->dc_rect.top + visRectSrc->top;
     WineXRenderFormat *src_format = get_xrender_format_from_color_shifts(physDevSrc->depth, physDevSrc->color_shifts);
     WineXRenderFormat *dst_format = get_xrender_format_from_color_shifts(physDevDst->depth, physDevDst->color_shifts);
     Picture src_pict=0, dst_pict=0, mask_pict=0;
 
-    double xscale = widthSrc/(double)widthDst;
-    double yscale = heightSrc/(double)heightDst;
+    double xscale = width_src/(double)width_dst;
+    double yscale = height_src/(double)height_dst;
 
     XRenderPictureAttributes pa;
     pa.subwindow_mode = IncludeInferiors;
     pa.repeat = RepeatNone;
 
-    TRACE("src depth=%d widthSrc=%d heightSrc=%d xSrc=%d ySrc=%d\n", physDevSrc->depth, widthSrc, heightSrc, x_src, y_src);
-    TRACE("dst depth=%d widthDst=%d heightDst=%d\n", physDevDst->depth, widthDst, heightDst);
+    TRACE("src depth=%d width_src=%d height_src=%d xSrc=%d ySrc=%d\n", physDevSrc->depth, width_src, height_src, x_src, y_src);
+    TRACE("dst depth=%d width_dst=%d height_dst=%d\n", physDevDst->depth, width_dst, height_dst);
 
     if(!X11DRV_XRender_Installed)
     {
@@ -2093,7 +2093,7 @@ BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE
     {
         TRACE("Source and destination depth match and no stretching needed falling back to XCopyArea\n");
         wine_tsx11_lock();
-        XCopyArea( gdi_display, physDevSrc->drawable, pixmap, gc, x_src, y_src, width, height, 0, 0);
+        XCopyArea( gdi_display, physDevSrc->drawable, pixmap, gc, x_src, y_src, width_dst, height_dst, 0, 0);
         wine_tsx11_unlock();
         return TRUE;
     }
@@ -2113,9 +2113,9 @@ BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE
 
         /* Create a destination picture and fill it with textPixel color as the background color */
         dst_pict = pXRenderCreatePicture(gdi_display, pixmap, dst_format->pict_format, CPSubwindowMode|CPRepeat, &pa);
-        pXRenderFillRectangle(gdi_display, PictOpSrc, dst_pict, &col, 0, 0, width, height);
+        pXRenderFillRectangle(gdi_display, PictOpSrc, dst_pict, &col, 0, 0, width_dst, height_dst);
 
-        xrender_blit(src_pict, mask_pict, dst_pict, x_src, y_src, xscale, yscale, width, height);
+        xrender_blit(src_pict, mask_pict, dst_pict, x_src, y_src, xscale, yscale, width_dst, height_dst);
 
         if(dst_pict) pXRenderFreePicture(gdi_display, dst_pict);
         if(mask_pict) pXRenderFreePicture(gdi_display, mask_pict);
@@ -2132,7 +2132,7 @@ BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE
                                           pixmap, dst_format->pict_format,
                                           CPSubwindowMode|CPRepeat, &pa);
 
-        xrender_blit(src_pict, 0, dst_pict, x_src, y_src, xscale, yscale, width, height);
+        xrender_blit(src_pict, 0, dst_pict, x_src, y_src, xscale, yscale, width_dst, height_dst);
 
         if(src_pict) pXRenderFreePicture(gdi_display, src_pict);
         if(dst_pict) pXRenderFreePicture(gdi_display, dst_pict);
@@ -2207,8 +2207,6 @@ BOOL X11DRV_XRender_SetPhysBitmapDepth(X_PHYSBITMAP *physBitmap, const DIBSECTIO
 
 BOOL X11DRV_XRender_GetSrcAreaStretch(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDevDst,
                                       Pixmap pixmap, GC gc,
-                                      INT widthSrc, INT heightSrc,
-                                      INT widthDst, INT heightDst,
                                       RECT *visRectSrc, RECT *visRectDst )
 {
     return FALSE;
-- 
1.6.0.4

