Huw Davies : wineps.drv: Add support for top-down dibs.

Alexandre Julliard julliard at winehq.org
Thu Nov 19 10:15:17 CST 2009


Module: wine
Branch: master
Commit: eed649a5e18aaabef42e58da0e7a557046b665dc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=eed649a5e18aaabef42e58da0e7a557046b665dc

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Nov 18 16:39:27 2009 +0000

wineps.drv: Add support for top-down dibs.

---

 dlls/wineps.drv/bitmap.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/wineps.drv/bitmap.c b/dlls/wineps.drv/bitmap.c
index 9f5f11d..c450bca 100644
--- a/dlls/wineps.drv/bitmap.c
+++ b/dlls/wineps.drv/bitmap.c
@@ -242,6 +242,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
     if (!get_bitmap_info( info, &fullSrcWidth, &fullSrcHeight, &bpp, &compression )) return FALSE;
 
     stride = get_dib_width_bytes(fullSrcWidth, bpp);
+    if(fullSrcHeight < 0) stride = -stride; /* top-down */
 
     TRACE("full size=%dx%d bpp=%d compression=%d rop=%08x\n", fullSrcWidth,
 	  fullSrcHeight, bpp, compression, dwRop);
@@ -272,6 +273,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
 	PSDRV_WriteImageMaskHeader(physDev, info, xDst, yDst, widthDst, heightDst,
                                    widthSrc, heightSrc);
 	src_ptr = bits;
+        if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride;
 	src_ptr += (ySrc * stride);
 	if(xSrc & 7)
 	    FIXME("This won't work...\n");
@@ -287,6 +289,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
 	PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
 			       widthSrc, heightSrc);
 	src_ptr = bits;
+        if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride;
 	src_ptr += (ySrc * stride);
 	if(xSrc & 1)
 	    FIXME("This won't work...\n");
@@ -302,6 +305,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
 	PSDRV_WriteImageHeader(physDev, info, xDst, yDst, widthDst, heightDst,
 			       widthSrc, heightSrc);
 	src_ptr = bits;
+        if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride;
 	src_ptr += (ySrc * stride);
         bitmap_size = heightSrc * widthSrc;
         dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size);
@@ -318,6 +322,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
 
 
         src_ptr = bits;
+        if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride;
         src_ptr += (ySrc * stride);
         bitmap_size = heightSrc * widthSrc * 3;
         dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size);
@@ -350,6 +355,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
 			       widthSrc, heightSrc);
 
         src_ptr = bits;
+        if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride;
         src_ptr += (ySrc * stride);
         bitmap_size = heightSrc * widthSrc * 3;
         dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size);
@@ -372,6 +378,7 @@ INT CDECL PSDRV_StretchDIBits( PSDRV_PDEVICE *physDev, INT xDst, INT yDst, INT w
 			       widthSrc, heightSrc);
 
         src_ptr = bits;
+        if(stride < 0) src_ptr += (fullSrcHeight + 1) * stride;
         src_ptr += (ySrc * stride);
         bitmap_size = heightSrc * widthSrc * 3;
         dst_ptr = bitmap = HeapAlloc(GetProcessHeap(), 0, bitmap_size);




More information about the wine-cvs mailing list