return false;
}
-EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QWindowFormat &format, bool highestPixelFormat, int surfaceType)
+EGLConfig q_configFromQWindowFormat(EGLDisplay display, const QWindowFormat &format, bool highestPixelFormat, int surfaceType)
{
EGLConfig cfg = 0;
QVector<EGLint> configureAttributes = q_createConfigAttributesFromFormat(format);
QVector<EGLint> q_createConfigAttributesFromFormat(const QWindowFormat &format);
bool q_reduceConfigAttributes(QVector<EGLint> *configAttributes);
-EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QWindowFormat &format, bool highestPixelFormat = false, int surfaceType = EGL_WINDOW_BIT);
+EGLConfig q_configFromQWindowFormat(EGLDisplay display, const QWindowFormat &format, bool highestPixelFormat = false, int surfaceType = EGL_WINDOW_BIT);
QWindowFormat q_windowFormatFromConfig(EGLDisplay display, const EGLConfig config);
bool q_hasEglExtension(EGLDisplay display,const char* extensionName);
#include "../../../eglconvenience/qeglconvenience.h"
+#include <QtCore/QDebug>
+#include <QtGui/QWindowContext>
+
#include <QtOpenGL/QGLContext>
#include <QtOpenGL/private/qglextensions_p.h>
#include "qwaylandshmsurface.h"
-#include <QtCore/QDebug>
static inline void qgl_byteSwapImage(QImage &img, GLenum pixel_type)
{
, mWindow(window)
, mBuffer(0)
, mPixmap(0)
- , mConfig(q_configFromQPlatformWindowFormat(eglIntegration->eglDisplay(),window->widget()->platformWindowFormat(),true,EGL_PIXMAP_BIT))
+ , mConfig(q_configFromQWindowFormat(eglIntegration->eglDisplay(),window->window()->requestedWindowFormat(),true,EGL_PIXMAP_BIT))
, mPixmapSurface(EGL_NO_SURFACE)
{
QVector<EGLint> eglContextAttrs;
{
eglSwapBuffers(mEglIntegration->eglDisplay(),mPixmapSurface);
- if (QWindowContext::currentContext().handle() != this) {
+ if (QWindowContext::currentContext()->handle() != this) {
makeCurrent();
}
return (void *) eglGetProcAddress(procName.toLatin1().data());
}
-QPlatformWindowFormat QWaylandReadbackEglContext::platformWindowFormat() const
+QWindowFormat QWaylandReadbackEglContext::windowFormat() const
{
return q_windowFormatFromConfig(mEglIntegration->eglDisplay(),mConfig);
}
void swapBuffers();
void* getProcAddress(const QString& procName);
- virtual QPlatformWindowFormat platformWindowFormat() const;
+ virtual QWindowFormat windowFormat() const;
void geometryChanged();
QWaylandWindow * QWaylandReadbackEglIntegration::createEglWindow(QWindow *window)
{
- return new QWaylandReadbackEglWindow(widget,this);
+ return new QWaylandReadbackEglWindow(window,this);
}
EGLDisplay QWaylandReadbackEglIntegration::eglDisplay()
#include <QtCore/QDataStream>
#include <QtCore/QMetaType>
#include <QtCore/QVariant>
+#include <QtCore/QEvent>
+#include <QtGui/QCursor>
#include <X11/Xlib.h>
#include "qwaylandscreen.h"
#include "qwaylandglcontext.h"
+#include <QtGui/QWindow>
+
QWaylandEglWindow::QWaylandEglWindow(QWindow *window)
: QWaylandWindow(window)
, mGLContext(0)
{
if (!mGLContext) {
QWaylandEglWindow *that = const_cast<QWaylandEglWindow *>(this);
- that->mGLContext = new QWaylandGLContext(mEglIntegration->eglDisplay(),widget()->platformWindowFormat());
+ that->mGLContext = new QWaylandGLContext(mEglIntegration->eglDisplay(),this->window()->requestedWindowFormat());
EGLNativeWindowType window(reinterpret_cast<EGLNativeWindowType>(mWaylandEglWindow));
EGLSurface surface = eglCreateWindowSurface(mEglIntegration->eglDisplay(),mGLContext->eglConfig(),window,NULL);
if (mWaylandEglWindow) {
wl_egl_window_destroy(mWaylandEglWindow);
}
- wl_visual *visual = QWaylandScreen::waylandScreenFromWidget(widget())->visual();
+ wl_visual *visual = QWaylandScreen::waylandScreenFromWindow(window())->visual();
QSize size = geometry().size();
if (!size.isValid())
size = QSize(0,0);
#include "../../../eglconvenience/qeglconvenience.h"
#include <QtGui/QPlatformGLContext>
-#include <QtGui/QPlatformWindowFormat>
+#include <QtGui/QWindowFormat>
#include <QtCore/QMutex>
-QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, const QPlatformWindowFormat &format)
+QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, const QWindowFormat &format)
: QPlatformGLContext()
, mEglDisplay(eglDisplay)
, mSurface(EGL_NO_SURFACE)
- , mConfig(q_configFromQPlatformWindowFormat(mEglDisplay,format,true))
+ , mConfig(q_configFromQWindowFormat(mEglDisplay,format,true))
, mFormat(q_windowFormatFromConfig(mEglDisplay,mConfig))
{
- QPlatformGLContext *sharePlatformContext = 0;
- sharePlatformContext = format.sharedGLContext();
- mFormat.setSharedContext(sharePlatformContext);
EGLContext shareEGLContext = EGL_NO_CONTEXT;
- if (sharePlatformContext)
- shareEGLContext = static_cast<const QWaylandGLContext*>(sharePlatformContext)->mContext;
eglBindAPI(EGL_OPENGL_ES_API);
class QWaylandGLContext : public QPlatformGLContext {
public:
- QWaylandGLContext(EGLDisplay eglDisplay, const QPlatformWindowFormat &format);
+ QWaylandGLContext(EGLDisplay eglDisplay, const QWindowFormat &format);
~QWaylandGLContext();
void makeCurrent();
void doneCurrent();
void swapBuffers();
void* getProcAddress(const QString&);
- QPlatformWindowFormat platformWindowFormat() const { return mFormat; }
+ QWindowFormat windowFormat() const { return mFormat; }
void setEglSurface(EGLSurface surface);
EGLConfig eglConfig() const;
EGLContext mContext;
EGLSurface mSurface;
EGLConfig mConfig;
- QPlatformWindowFormat mFormat;
+ QWindowFormat mFormat;
QWaylandGLContext();
#include "wayland-xcomposite-client-protocol.h"
#include <QtCore/QDebug>
+#include <QtGui/QRegion>
#include "qeglconvenience.h"
#include "qxlibeglintegration.h"
, mWindow(window)
, mBuffer(0)
, mXWindow(0)
- , mConfig(q_configFromQPlatformWindowFormat(glxIntegration->eglDisplay(),window->widget()->platformWindowFormat(),true,EGL_WINDOW_BIT))
+ , mConfig(q_configFromQWindowFormat(glxIntegration->eglDisplay(),window->window()->requestedWindowFormat(),true,EGL_WINDOW_BIT))
, mWaitingForSync(false)
{
QVector<EGLint> eglContextAttrs;
return (void *)eglGetProcAddress(qPrintable(procName));
}
-QPlatformWindowFormat QWaylandXCompositeEGLContext::platformWindowFormat() const
+QWindowFormat QWaylandXCompositeEGLContext::windowFormat() const
{
return q_windowFormatFromConfig(mEglIntegration->eglDisplay(),mConfig);
}
#include <QtGui/QPlatformGLContext>
-#include <QtCore/QWaitCondition>
-
#include "qwaylandbuffer.h"
#include "qwaylandxcompositeeglintegration.h"
void swapBuffers();
void* getProcAddress(const QString& procName);
- QPlatformWindowFormat platformWindowFormat() const;
+ QWindowFormat windowFormat() const;
void geometryChanged();
XVisualInfo *visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(m_screen),m_screen->screenNumber(), window()->requestedWindowFormat());
#elif defined(XCB_USE_EGL)
EGLDisplay eglDisplay = connection()->egl_display();
- EGLConfig eglConfig = q_configFromQPlatformWindowFormat(eglDisplay,window()->requestedWindowFormat(),true);
+ EGLConfig eglConfig = q_configFromQWindowFormat(eglDisplay,window()->requestedWindowFormat(),true);
VisualID id = QXlibEglIntegration::getCompatibleVisualId(DISPLAY_FROM_XCB(this), eglDisplay, eglConfig);
XVisualInfo visualInfoTemplate;
that->m_context = new QGLXContext(m_window, m_screen, window()->requestedWindowFormat());
#elif defined(XCB_USE_EGL)
EGLDisplay display = connection()->egl_display();
- EGLConfig config = q_configFromQPlatformWindowFormat(display,window()->requestedWindowFormat(),true);
+ EGLConfig config = q_configFromQWindowFormat(display,window()->requestedWindowFormat(),true);
QVector<EGLint> eglContextAttrs;
eglContextAttrs.append(EGL_CONTEXT_CLIENT_VERSION);
eglContextAttrs.append(2);