dib shm patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Log:
Gavriel State <gav@transgaming.com>
Speed up the GetImageBits case where we have an XShm image.

Index: graphics/x11drv/dib.c
===================================================================
RCS file: /cvsroot/winex/wine/graphics/x11drv/dib.c,v
retrieving revision 1.1.1.20
retrieving revision 1.37
diff -u -r1.1.1.20 -r1.37
--- graphics/x11drv/dib.c	2001/12/31 10:50:33	1.1.1.20
+++ graphics/x11drv/dib.c	2002/01/02 17:33:10	1.37
@@ -4607,13 +4607,40 @@
         }
     }
 
-    TRACE("XGetSubImage(%ld,%d,%d,%d,%d,%ld,%d,%p,%d,%d)\n",
-     descr->drawable, descr->xSrc, descr->ySrc, descr->width,
-     lines, AllPlanes, ZPixmap, bmpImage, descr->xDest, descr->yDest);
-    XGetSubImage( gdi_display, descr->drawable, descr->xSrc, descr->ySrc,
-                  descr->width, lines, AllPlanes, ZPixmap,
-                  bmpImage, descr->xDest, descr->yDest );
+    if (descr->useShm)
+    {
+        int saveRed, saveGreen, saveBlue;
+ 
+        TRACE("XShmGetImage(%p, %ld, %p, %d, %d, %ld)\n",
+                            gdi_display, descr->drawable, bmpImage,
+                            descr->xSrc, descr->ySrc, AllPlanes);
+
+ 	/* We must save and restore the bmpImage's masks in order
+ 	 * to preserve them across the call to XShmGetImage, which
+ 	 * decides to eleminate them since it doesn't happen to know
+ 	 * what the format of the image is supposed to be, even though 
+ 	 * we do. */
+        saveRed = bmpImage->red_mask;
+        saveBlue= bmpImage->blue_mask;
+        saveGreen = bmpImage->green_mask;
+ 
+        XShmGetImage( gdi_display, descr->drawable, bmpImage,
+                      descr->xSrc, descr->ySrc, AllPlanes);
 
+        bmpImage->red_mask = saveRed;
+        bmpImage->blue_mask = saveBlue;
+        bmpImage->green_mask = saveGreen;
+    }
+    else
+    {
+        TRACE("XGetSubImage(%p,%ld,%d,%d,%d,%d,%ld,%d,%p,%d,%d)\n",
+              gdi_display, descr->drawable, descr->xSrc, descr->ySrc, descr->width,
+              lines, AllPlanes, ZPixmap, bmpImage, descr->xDest, descr->yDest);
+        XGetSubImage( gdi_display, descr->drawable, descr->xSrc, descr->ySrc,
+                      descr->width, lines, AllPlanes, ZPixmap,
+                      bmpImage, descr->xDest, descr->yDest );
+    }
+ 
     TRACE("Dib: depth=%2d r=%lx g=%lx b=%lx\n",
           descr->infoBpp,descr->rMask,descr->gMask,descr->bMask);
     TRACE("Bmp: depth=%2d/%2d r=%lx g=%lx b=%lx\n",




[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux