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/kernel/qapplication_x11.cpp | |
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/kernel/qapplication_x11.cpp')
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index bf95684..7f11faa 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -1625,6 +1625,7 @@ void qt_init(QApplicationPrivate *priv, int, // MIT-SHM X11->use_mitshm = false; + X11->use_mitshm_pixmaps = false; X11->mitshm_major = 0; X11->sip_serial = 0; @@ -1918,12 +1919,13 @@ void qt_init(QApplicationPrivate *priv, int, bool local = displayName.isEmpty() || displayName.lastIndexOf(QLatin1Char(':')) == 0; if (local && (qgetenv("QT_X11_NO_MITSHM").toInt() == 0)) { Visual *defaultVisual = DefaultVisual(X11->display, DefaultScreen(X11->display)); - X11->use_mitshm = mitshm_pixmaps && ((defaultVisual->red_mask == 0xff0000 - || defaultVisual->red_mask == 0xf800) - && (defaultVisual->green_mask == 0xff00 - || defaultVisual->green_mask == 0x7e0) - && (defaultVisual->blue_mask == 0xff - || defaultVisual->blue_mask == 0x1f)); + X11->use_mitshm = ((defaultVisual->red_mask == 0xff0000 + || defaultVisual->red_mask == 0xf800) + && (defaultVisual->green_mask == 0xff00 + || defaultVisual->green_mask == 0x7e0) + && (defaultVisual->blue_mask == 0xff + || defaultVisual->blue_mask == 0x1f)); + X11->use_mitshm_pixmaps = X11->use_mitshm && mitshm_pixmaps; } } #endif // QT_NO_MITSHM |