46 #include <QtGui/private/qapplication_p.h> 47 #include <QtCore/QMap> 49 #include <QtCore/QDebug> 51 #if defined(XCB_USE_EGL) 52 #include "../eglconvenience/qeglplatformcontext.h" 53 #elif defined (XCB_USE_DRI2) 77 ResourceType resource = qXcbResourceMap()->value(lowerCaseResource);
81 result = displayForWidget(
widget);
84 result = eglDisplayForWidget(
widget);
87 result = connectionForWidget(
widget);
90 result = qPlatformScreenForWidget(
widget);
93 result = graphicsDeviceForWidget(
widget);
96 result = eglContextForWidget(
widget);
110 screen =
static_cast<QXcbScreen *
>(QApplicationPrivate::platformIntegration()->screens()[0]);
117 #if defined(XCB_USE_XLIB) 118 QXcbScreen *screen = qPlatformScreenForWidget(widget);
128 #if defined(XCB_USE_DRI2) || defined(XCB_USE_EGL) 129 QXcbScreen *screen = qPlatformScreenForWidget(widget);
139 QXcbScreen *screen = qPlatformScreenForWidget(widget);
145 QXcbScreen *screen = qPlatformScreenForWidget(widget);
151 #if defined(XCB_USE_DRI2) 152 QXcbScreen *screen = qPlatformScreenForWidget(widget);
154 return deviceName.
data();
165 if (!widget->platformWindow()) {
166 qDebug() <<
"QPlatformWindow does not exist for widget" << widget
167 <<
"cannot return EGLContext";
171 if (!platformContext) {
172 qDebug() <<
"QPlatformWindow" << widget->platformWindow() <<
"does not have a glContext" 173 <<
"cannot return EGLContext";
176 #if defined(XCB_USE_EGL) 179 #elif defined (XCB_USE_DRI2)
QPointer< QWidget > widget
char * data()
Returns a pointer to the data stored in the byte array.
static QXcbScreen * qPlatformScreenForWidget(QWidget *widget)
The QByteArray class provides an array of bytes.
xcb_connection_t * xcb_connection() const
EGLContext eglContext() const
QByteArray toLower() const
Returns a lowercase copy of the byte array.
QXcbConnection * connection() const
Q_CORE_EXPORT void qDebug(const char *,...)
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
void * connectionForWidget(QWidget *widget)
void * eglContext() const
void * eglContextForWidget(QWidget *widget)
The QPlatformGLContext class provides an abstraction for native GL contexts.
iterator insert(const QByteArray &key, const QXcbNativeInterface::ResourceType &value)
Inserts a new item with the key key and a value of value.
void * graphicsDeviceForWidget(QWidget *widget)
void * screenForWidget(QWidget *widget)
void * displayForWidget(QWidget *widget)
void * eglDisplayForWidget(QWidget *widget)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
The QMap class is a template class that provides a skip-list-based dictionary.
xcb_screen_t * screen() const