From c5687704e9b1e3f67c6a095c86368b8dc9809629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Date: Fri, 13 Nov 2015 17:49:53 +0100 Subject: xcb: Remove unneeded null pointer checks Since a094af001795c9651b299d700a992150d1aba33a we don't need any null pointer checks for xcb screens. This reverts patch 7532fb4e61fc4102fd11022f57f7d8195414167b Change-Id: I8b90ed538aad4403650ef42aab6f39de5861d9ed Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbbackingstore.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbbackingstore.cpp') diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index d5a82a7509..e57b089878 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -326,12 +326,9 @@ QPaintDevice *QXcbBackingStore::paintDevice() void QXcbBackingStore::beginPaint(const QRegion ®ion) { - if (!m_image && !m_size.isEmpty()) - resize(m_size, QRegion()); - if (!m_image) return; - m_size = QSize(); + m_paintRegion = region; m_image->preparePaint(m_paintRegion); @@ -438,8 +435,7 @@ void QXcbBackingStore::resize(const QSize &size, const QRegion &) return; Q_XCB_NOOP(connection()); - - QXcbScreen *screen = window()->screen() ? static_cast(window()->screen()->handle()) : 0; + QXcbScreen *screen = static_cast(window()->screen()->handle()); QPlatformWindow *pw = window()->handle(); if (!pw) { window()->create(); @@ -448,11 +444,6 @@ void QXcbBackingStore::resize(const QSize &size, const QRegion &) QXcbWindow* win = static_cast(pw); delete m_image; - if (!screen) { - m_image = 0; - m_size = size; - return; - } m_image = new QXcbShmImage(screen, size, win->depth(), win->imageFormat()); // Slow path for bgr888 VNC: Create an additional image, paint into that and // swap R and B while copying to m_image after each paint. -- cgit v1.2.3