xcb: Fix build with -no-xcb-xlib -qt-xcb
The EGL integration should not call Xlib functions in this case. Change-Id: I46656b12d603ca1b4b0b41f34c3c0e8410c91db8 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>bb10
parent
fbeeaf23fe
commit
b63c721a0e
|
|
@ -57,13 +57,7 @@ QXcbEglIntegration::~QXcbEglIntegration()
|
|||
bool QXcbEglIntegration::initialize(QXcbConnection *connection)
|
||||
{
|
||||
m_connection = connection;
|
||||
|
||||
#ifdef USE_XCB_XLIB
|
||||
Display *dpy = (Display *)m_connection->xlib_display();
|
||||
#else
|
||||
EGLNativeDisplayType dpy = EGL_DEFAULT_DISPLAY;
|
||||
#endif
|
||||
m_egl_display = eglGetDisplay(dpy);
|
||||
m_egl_display = eglGetDisplay(reinterpret_cast<EGLNativeDisplayType>(xlib_display()));
|
||||
|
||||
EGLint major, minor;
|
||||
bool success = eglInitialize(m_egl_display, &major, &minor);
|
||||
|
|
@ -101,4 +95,13 @@ QPlatformOffscreenSurface *QXcbEglIntegration::createPlatformOffscreenSurface(QO
|
|||
return new QEGLPbuffer(eglDisplay(), surface->requestedFormat(), surface);
|
||||
}
|
||||
|
||||
void *QXcbEglIntegration::xlib_display() const
|
||||
{
|
||||
#ifdef XCB_USE_XLIB
|
||||
return m_connection->xlib_display();
|
||||
#else
|
||||
return EGL_DEFAULT_DISPLAY;
|
||||
#endif
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public:
|
|||
bool supportsThreadedOpenGL() const Q_DECL_OVERRIDE { return true; }
|
||||
|
||||
EGLDisplay eglDisplay() const { return m_egl_display; }
|
||||
void *xlib_display() const { return m_connection->xlib_display(); }
|
||||
void *xlib_display() const;
|
||||
private:
|
||||
QXcbConnection *m_connection;
|
||||
EGLDisplay m_egl_display;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ void QXcbEglWindow::resolveFormat()
|
|||
|
||||
void *QXcbEglWindow::createVisual()
|
||||
{
|
||||
#ifdef XCB_USE_XLIB
|
||||
Display *xdpy = static_cast<Display *>(m_glIntegration->xlib_display());
|
||||
VisualID id = QXlibEglIntegration::getCompatibleVisualId(xdpy, m_glIntegration->eglDisplay(), m_config);
|
||||
|
||||
|
|
@ -72,6 +73,9 @@ void *QXcbEglWindow::createVisual()
|
|||
int matchingCount = 0;
|
||||
visualInfo = XGetVisualInfo(xdpy, VisualIDMask, &visualInfoTemplate, &matchingCount);
|
||||
return visualInfo;
|
||||
#else
|
||||
return QXcbWindow::createVisual();
|
||||
#endif
|
||||
}
|
||||
|
||||
void QXcbEglWindow::create()
|
||||
|
|
|
|||
|
|
@ -9,10 +9,7 @@ include(../gl_integrations_plugin_base.pri)
|
|||
|
||||
CONFIG += egl
|
||||
|
||||
DEFINES += SUPPORT_X11
|
||||
#should be removed from sources
|
||||
DEFINES += XCB_USE_EGL XCB_USE_XLIB
|
||||
|
||||
contains(QT_CONFIG, xcb-xlib): DEFINES += XCB_USE_XLIB
|
||||
|
||||
HEADERS += \
|
||||
qxcbeglcontext.h \
|
||||
|
|
|
|||
Loading…
Reference in New Issue