xcb: Remove unneeded null pointer checks

Since a094af0017 we don't need any null
pointer checks for xcb screens.

This reverts patch 7532fb4e61

Change-Id: I8b90ed538aad4403650ef42aab6f39de5861d9ed
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
This commit is contained in:
Błażej Szczygieł 2015-11-13 17:49:53 +01:00
parent b736151c2b
commit c5687704e9
3 changed files with 4 additions and 14 deletions

View File

@ -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.

View File

@ -77,7 +77,6 @@ private:
QXcbShmImage *m_image;
QRegion m_paintRegion;
QImage m_rgbImage;
QSize m_size;
};
QT_END_NAMESPACE

View File

@ -667,7 +667,7 @@ void QXcbWindow::setGeometry(const QRect &rect)
const QRect wmGeometry = windowToWmGeometry(rect);
if (newScreen && newScreen != currentScreen)
if (newScreen != currentScreen)
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->QPlatformScreen::screen());
if (qt_window_private(window())->positionAutomatic) {
@ -1660,7 +1660,7 @@ void QXcbWindow::requestActivateWindow()
return;
}
if (!m_mapped || !xcbScreen()) {
if (!m_mapped) {
m_deferredActivation = true;
return;
}