src/gui/painting/qwindowsurface_raster.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
--- a/src/gui/painting/qwindowsurface_raster.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/gui/painting/qwindowsurface_raster.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -140,7 +140,7 @@
 
     // Not ready for painting yet, bail out. This can happen in
     // QWidget::create_sys()
-    if (!d->image || rgn.numRects() == 0)
+    if (!d->image || rgn.rectCount() == 0)
         return;
 
 #ifdef Q_WS_WIN
@@ -203,7 +203,7 @@
         wrgn.translate(-wOffset);
     QRect wbr = wrgn.boundingRect();
 
-    if (wrgn.numRects() != 1) {
+    if (wrgn.rectCount() != 1) {
         int num;
         XRectangle *rects = (XRectangle *)qt_getClipRects(wrgn, num);
         XSetClipRectangles(X11->display, d_ptr->gc, 0, 0, rects, num, YXBanded);
@@ -215,6 +215,12 @@
         XCopyArea(X11->display, d_ptr->image->xshmpm, widget->handle(), d_ptr->gc,
                   br.x(), br.y(), br.width(), br.height(), wbr.x(), wbr.y());
         XSync(X11->display, False);
+    } else if (d_ptr->image->xshmimg) {
+        const QImage &src = d->image->image;
+        br = br.intersected(src.rect());
+        XShmPutImage(X11->display, widget->handle(), d_ptr->gc, d_ptr->image->xshmimg,
+                     br.x(), br.y(), wbr.x(), wbr.y(), br.width(), br.height(), False);
+        XSync(X11->display, False);
     } else
 #endif
     {
@@ -236,7 +242,7 @@
         }
     }
 
-    if (wrgn.numRects() != 1)
+    if (wrgn.rectCount() != 1)
         XSetClipMask(X11->display, d_ptr->gc, XNone);
 #endif // FALCON