summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorFredrik Höglund <fredrik@kde.org>2009-10-27 14:25:46 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-10-27 14:36:08 (GMT)
commitc6218e0e9b64e53391e3e0ddc4988f4f079712eb (patch)
tree4acf49b73ab1d63134feb152135955da5388fe09 /src/gui/painting
parentabfee117ec2dd5ad5be3b1c497a12f884b28568d (diff)
downloadQt-c6218e0e9b64e53391e3e0ddc4988f4f079712eb.zip
Qt-c6218e0e9b64e53391e3e0ddc4988f4f079712eb.tar.gz
Qt-c6218e0e9b64e53391e3e0ddc4988f4f079712eb.tar.bz2
Use shared memory images when shared pixmaps are not available.
Modern graphics drivers tend to disable shared memory pixmaps, since rendering operations often can't be accelerated by the GPU when the pixmap data is pinned in system RAM. Use XShmPutImage() to flush the window surface when this is case, instead of falling back to the slower XPutImage() method. Merge-request: 1684 Reviewed-by: Samuel Rødal <sroedal@trolltech.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qwindowsurface_raster.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp
index 3a118bd..d412040 100644
--- a/src/gui/painting/qwindowsurface_raster.cpp
+++ b/src/gui/painting/qwindowsurface_raster.cpp
@@ -215,6 +215,12 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
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
{