48 #include <QtCore/QDebug> 53 #include <X11/extensions/Xcomposite.h> 57 , mEglIntegration(glxIntegration)
62 , mWaitingForSync(false)
65 eglContextAttrs.
append(EGL_CONTEXT_CLIENT_VERSION); eglContextAttrs.
append(2);
66 eglContextAttrs.
append(EGL_NONE);
70 qFatal(
"failed to find context");
100 return (
void *)eglGetProcAddress(
qPrintable(procName));
117 if (size.isEmpty()) {
130 XVisualInfo visualInfoTemplate;
131 memset(&visualInfoTemplate, 0,
sizeof(XVisualInfo));
132 visualInfoTemplate.visualid = visualId;
134 int matchingCount = 0;
135 XVisualInfo *visualInfo = XGetVisualInfo(
mEglIntegration->
xDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount);
139 XSetWindowAttributes
a;
142 0, visualInfo->depth, InputOutput, visualInfo->visual,
149 if (mEglWindowSurface == EGL_NO_SURFACE) {
150 qFatal(
"Could not make eglsurface");
166 while (mWaitingForSync) {
EGLDisplay eglDisplay() const
QPointer< QWidget > widget
static void sync_function(void *data)
QWaylandXCompositeEGLWindow * mWindow
EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QPlatformWindowFormat &format, bool highestPixelFormat, int surfaceType)
struct wl_visual * argbVisual()
virtual void doneCurrent()
Reimplement in subclass to release current context.
QWaylandXCompositeEGLContext(QWaylandXCompositeEGLIntegration *glxIntegration, QWaylandXCompositeEGLWindow *window)
long ASN1_INTEGER_get ASN1_INTEGER * a
The QString class provides a Unicode character string.
QWaylandDisplay * waylandDisplay() const
void * getProcAddress(const QString &procName)
Reimplement in subclass to native getProcAddr calls.
static VisualID getCompatibleVisualId(Display *display, EGLDisplay eglDisplay, EGLConfig config)
struct wl_xcomposite * waylandXComposite() const
QSize size() const
Returns the size of the rectangle.
void swapBuffers()
Reimplement in subclass to native swap buffers calls.
void append(const T &t)
Inserts value at the end of the vector.
static const char * data(const QByteArray &arr)
QPlatformWindowFormat platformWindowFormat() const
QWidget has the function qplatformWindowFormat().
Window rootWindow() const
virtual void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.
void doneCurrent()
Reimplement in subclass to release current context.
void attach(QWaylandBuffer *buffer)
Q_CORE_EXPORT void qFatal(const char *,...)
The QPlatformGLContext class provides an abstraction for native GL contexts.
QPlatformWindowFormat qt_qPlatformWindowFormatFromConfig(EGLDisplay display, const EGLConfig config)
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.
The QSize class defines the size of a two-dimensional object using integer point precision.
const T * constData() const
Returns a const pointer to the data stored in the vector.
void damage(const QRect &rect)
EGLSurface mEglWindowSurface
#define qPrintable(string)
Display * xDisplay() const
QWaylandXCompositeEGLIntegration * mEglIntegration
struct wl_display * wl_display() const