summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbbackingstore.cpp
diff options
context:
space:
mode:
authorBłażej Szczygieł <spaz16@wp.pl>2015-11-13 17:49:53 +0100
committerBłażej Szczygieł <spaz16@wp.pl>2016-02-24 14:56:47 +0000
commitc5687704e9b1e3f67c6a095c86368b8dc9809629 (patch)
treec17aa08e4ab6a741757756c543c5bcfa19628ba3 /src/plugins/platforms/xcb/qxcbbackingstore.cpp
parentb736151c2bb6c68f700d38274d740a6e0cf59a49 (diff)
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 <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbbackingstore.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp13
1 files changed, 2 insertions, 11 deletions
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 &region)
{
- 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<QXcbScreen *>(window()->screen()->handle()) : 0;
+ QXcbScreen *screen = static_cast<QXcbScreen *>(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<QXcbWindow *>(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.