summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbbackingstore.cpp
diff options
context:
space:
mode:
authorLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2016-03-02 13:12:10 -0800
committerLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2016-03-04 14:25:57 +0000
commit7b46cad5c944bf0b3fdde89e3cd736e0756569c6 (patch)
treec80d54a0bd9f06420524916cedb14df736efc25d /src/plugins/platforms/xcb/qxcbbackingstore.cpp
parentf2ba6586a7589d8ab1f01749c82634f384a7ddad (diff)
QXcbBackingStore: Minor code cleanup
Change-Id: I5086e2031201b939b49603f17c373e414a91c32a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbbackingstore.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index c4ee90e59f..2e04799998 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -147,14 +147,8 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
{
Q_XCB_NOOP(connection());
- const xcb_setup_t *setup = xcb_get_setup(xcb_connection());
- xcb_format_t *fmt = xcb_setup_pixmap_formats(setup);
- xcb_format_t *fmtend = fmt + xcb_setup_pixmap_formats_length(setup);
- for (; fmt != fmtend; ++fmt)
- if (fmt->depth == depth)
- break;
-
- Q_ASSERT(fmt != fmtend);
+ const xcb_format_t *fmt = connection()->formatForDepth(depth);
+ Q_ASSERT(fmt);
m_xcb_image = xcb_image_create(size.width(), size.height(),
XCB_IMAGE_FORMAT_Z_PIXMAP,