diff options
author | Fredrik Höglund <fredrik@kde.org> | 2009-10-27 14:25:46 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-10-27 14:36:08 (GMT) |
commit | c6218e0e9b64e53391e3e0ddc4988f4f079712eb (patch) | |
tree | 4acf49b73ab1d63134feb152135955da5388fe09 /src/gui/image | |
parent | abfee117ec2dd5ad5be3b1c497a12f884b28568d (diff) | |
download | Qt-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/image')
-rw-r--r-- | src/gui/image/qnativeimage.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp index 88faea8..e4ea2e9 100644 --- a/src/gui/image/qnativeimage.cpp +++ b/src/gui/image/qnativeimage.cpp @@ -199,10 +199,12 @@ QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /* shmctl(xshminfo.shmid, IPC_RMID, 0); return; } - xshmpm = XShmCreatePixmap(X11->display, DefaultRootWindow(X11->display), xshmimg->data, - &xshminfo, width, height, dd); - if (!xshmpm) { - qWarning() << "QNativeImage: Unable to create shared Pixmap."; + if (X11->use_mitshm_pixmaps) { + xshmpm = XShmCreatePixmap(X11->display, DefaultRootWindow(X11->display), xshmimg->data, + &xshminfo, width, height, dd); + if (!xshmpm) { + qWarning() << "QNativeImage: Unable to create shared Pixmap."; + } } } |