summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2018-12-27 01:10:29 +0100
committerGatis Paeglis <gatis.paeglis@qt.io>2019-01-03 10:09:40 +0000
commit7d8fe4d98fc5e05f60a91649f208b92d622a4eac (patch)
tree48377a5bb6c3991b65ff9dd2127f71fd5ea308cb /src/plugins/platforms
parent6899117a59256082f37492d81ecaf56a0844690e (diff)
configure: make xcb-render a hard dependency for xcb plugin
Its been available by default since at least libxcb 1.5, and in Qt 5.12 we have even increased the minimal required libxcb version to 1.9. Having configure switches for extensions is a legacy from Qt 4. There are still few exceptions in Qt5, where the reason is that we have to support Linux distributions that don't ship recent enough libxcb. Task-number: QTBUG-30939 Change-Id: I0a02d93b6411119ec018b0cb8fe5c63beeab62ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_basic.cpp10
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbimage.cpp11
-rw-r--r--src/plugins/platforms/xcb/xcb_qpa_lib.pro5
6 files changed, 7 insertions, 38 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index e446933dac..f9240a45cc 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -45,10 +45,8 @@
#include <xcb/shm.h>
#include <xcb/xcb_image.h>
-#if QT_CONFIG(xcb_render)
#include <xcb/render.h>
#include <xcb/xcb_renderutil.h>
-#endif
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -956,16 +954,13 @@ QXcbSystemTrayBackingStore::QXcbSystemTrayBackingStore(QWindow *window)
if (depth != 32) {
platformWindow->setParentRelativeBackPixmap();
-#if QT_CONFIG(xcb_render)
initXRenderMode();
-#endif
m_useGrabbedBackgound = !m_usingXRenderMode;
}
}
QXcbSystemTrayBackingStore::~QXcbSystemTrayBackingStore()
{
-#if QT_CONFIG(xcb_render)
if (m_xrenderPicture) {
xcb_render_free_picture(xcb_connection(), m_xrenderPicture);
m_xrenderPicture = XCB_NONE;
@@ -978,7 +973,6 @@ QXcbSystemTrayBackingStore::~QXcbSystemTrayBackingStore()
xcb_render_free_picture(xcb_connection(), m_windowPicture);
m_windowPicture = XCB_NONE;
}
-#endif // QT_CONFIG(xcb_render)
}
void QXcbSystemTrayBackingStore::beginPaint(const QRegion &region)
@@ -1000,7 +994,6 @@ void QXcbSystemTrayBackingStore::render(xcb_window_t window, const QRegion &regi
return;
}
-#if QT_CONFIG(xcb_render)
m_image->put(m_xrenderPixmap, region, offset);
const QRect bounds = region.boundingRect();
const QPoint target = bounds.topLeft();
@@ -1011,7 +1004,6 @@ void QXcbSystemTrayBackingStore::render(xcb_window_t window, const QRegion &regi
m_xrenderPicture, 0, m_windowPicture,
target.x(), target.y(), 0, 0, target.x(), target.y(),
source.width(), source.height());
-#endif // QT_CONFIG(xcb_render)
}
void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &size)
@@ -1028,7 +1020,6 @@ void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &siz
return;
}
-#if QT_CONFIG(xcb_render)
if (m_xrenderPicture) {
xcb_render_free_picture(xcb_connection(), m_xrenderPicture);
m_xrenderPicture = XCB_NONE;
@@ -1051,10 +1042,8 @@ void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &siz
m_image->resize(size);
else
m_image = new QXcbBackingStoreImage(this, size, 32, QImage::Format_ARGB32_Premultiplied);
-#endif // QT_CONFIG(xcb_render)
}
-#if QT_CONFIG(xcb_render)
void QXcbSystemTrayBackingStore::initXRenderMode()
{
if (!connection()->hasXRender())
@@ -1098,6 +1087,5 @@ void QXcbSystemTrayBackingStore::initXRenderMode()
m_usingXRenderMode = true;
}
-#endif // QT_CONFIG(xcb_render)
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.h b/src/plugins/platforms/xcb/qxcbbackingstore.h
index b91e5c7dc2..0c30929d4e 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.h
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.h
@@ -99,14 +99,13 @@ protected:
void recreateImage(QXcbWindow *win, const QSize &size) override;
private:
-#if QT_CONFIG(xcb_render)
void initXRenderMode();
xcb_pixmap_t m_xrenderPixmap = XCB_NONE;
xcb_render_picture_t m_xrenderPicture = XCB_NONE;
xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE;
xcb_render_picture_t m_windowPicture = XCB_NONE;
-#endif
+
bool m_usingXRenderMode = false;
bool m_useGrabbedBackgound = false;
QPixmap m_grabbedBackground;
diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp
index b8335d1240..c69912c361 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp
@@ -44,12 +44,10 @@
#include <xcb/sync.h>
#include <xcb/xfixes.h>
#include <xcb/xinerama.h>
+#include <xcb/render.h>
#if QT_CONFIG(xcb_xinput)
#include <xcb/xinput.h>
#endif
-#if QT_CONFIG(xcb_render)
-#include <xcb/render.h>
-#endif
#if QT_CONFIG(xkb)
#define explicit dont_use_cxx_explicit
#include <xcb/xkb.h>
@@ -139,12 +137,10 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName)
xcb_extension_t *extensions[] = {
&xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id,
+ &xcb_render_id,
#if QT_CONFIG(xkb)
&xcb_xkb_id,
#endif
-#if QT_CONFIG(xcb_render)
- &xcb_render_id,
-#endif
#if QT_CONFIG(xcb_xinput)
&xcb_input_id,
#endif
@@ -293,7 +289,6 @@ void QXcbBasicConnection::initializeShm()
void QXcbBasicConnection::initializeXRandr()
{
-#if QT_CONFIG(xcb_render)
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_render_id);
if (!reply || !reply->present) {
qCDebug(lcQpaXcb, "XRender extension not present on the X server");
@@ -311,7 +306,6 @@ void QXcbBasicConnection::initializeXRandr()
m_hasXRandr = true;
m_xrenderVersion.first = xrenderQuery->major_version;
m_xrenderVersion.second = xrenderQuery->minor_version;
-#endif
}
void QXcbBasicConnection::initializeXinerama()
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index 7831671d42..fbadab4d50 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -607,14 +607,10 @@ xcb_cursor_t QXcbCursor::createBitmapCursor(QCursor *cursor)
QPoint spot = cursor->hotSpot();
xcb_cursor_t c = XCB_NONE;
if (cursor->pixmap().depth() > 1) {
-#if QT_CONFIG(xcb_render)
if (connection()->hasXRender(0, 5))
c = qt_xcb_createCursorXRender(m_screen, cursor->pixmap().toImage(), spot);
else
qCWarning(lcQpaXcb, "xrender >= 0.5 required to create pixmap cursors");
-#else
- qCWarning(lcQpaXcb, "This build of Qt does not support pixmap cursors");
-#endif
} else {
xcb_connection_t *conn = xcb_connection();
xcb_pixmap_t cp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->bitmap()->toImage());
diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp
index 31c24f40b4..8f33e6ed31 100644
--- a/src/plugins/platforms/xcb/qxcbimage.cpp
+++ b/src/plugins/platforms/xcb/qxcbimage.cpp
@@ -42,10 +42,9 @@
#include <QtGui/QColor>
#include <QtGui/private/qimage_p.h>
#include <QtGui/private/qdrawhelper_p.h>
-#if QT_CONFIG(xcb_render)
+
#include <xcb/render.h>
#include <xcb/xcb_renderutil.h>
-#endif
#include "qxcbconnection.h"
#include "qxcbintegration.h"
@@ -230,7 +229,6 @@ xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image)
xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image,
const QPoint &spot)
{
-#if QT_CONFIG(xcb_render)
xcb_connection_t *conn = screen->xcb_connection();
const int w = image.width();
const int h = image.height();
@@ -283,13 +281,6 @@ xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image,
xcb_render_free_picture(conn, pic);
xcb_free_pixmap(conn, pix);
return cursor;
-
-#else
- Q_UNUSED(screen);
- Q_UNUSED(image);
- Q_UNUSED(spot);
- return XCB_NONE;
-#endif
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
index 1369d3496e..647058167b 100644
--- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro
+++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
@@ -97,9 +97,10 @@ qtConfig(vulkan) {
!qtConfig(system-xcb) {
QMAKE_USE += xcb-static
} else {
- qtConfig(xcb-render): QMAKE_USE += xcb_render xcb_renderutil
qtConfig(xcb-xinput): QMAKE_USE += xcb_xinput
- QMAKE_USE += xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama
+ QMAKE_USE += \
+ xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \
+ xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama
}
QMAKE_USE += xcb