summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-05-31 15:47:02 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2011-05-31 15:57:03 +0200
commitd0beb0d95b63c230e965cf151a39ac6e7b779ae9 (patch)
tree4dc437b0c75684e9ea6a22277953f3ba5ca661d2 /src/plugins
parent9bd270f64d2eb481130663c4035f4097857c89c3 (diff)
Fix the egl path for xcb and wayland plugins
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/eglconvenience/qeglconvenience.cpp2
-rw-r--r--src/plugins/platforms/eglconvenience/qeglconvenience.h2
-rw-r--r--src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp10
-rw-r--r--src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h2
-rw-r--r--src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp2
-rw-r--r--src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h2
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp6
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp11
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h6
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp5
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp4
12 files changed, 28 insertions, 28 deletions
diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp
index fdfc19b0c1..333425632c 100644
--- a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp
+++ b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp
@@ -195,7 +195,7 @@ bool q_reduceConfigAttributes(QVector<EGLint> *configAttributes)
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);
diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.h b/src/plugins/platforms/eglconvenience/qeglconvenience.h
index dc15de8153..978cab4925 100644
--- a/src/plugins/platforms/eglconvenience/qeglconvenience.h
+++ b/src/plugins/platforms/eglconvenience/qeglconvenience.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
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);
diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp
index a3a86880f9..8769752d5f 100644
--- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp
@@ -43,12 +43,14 @@
#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)
{
@@ -77,7 +79,7 @@ QWaylandReadbackEglContext::QWaylandReadbackEglContext(QWaylandReadbackEglIntegr
, 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;
@@ -112,7 +114,7 @@ void QWaylandReadbackEglContext::swapBuffers()
{
eglSwapBuffers(mEglIntegration->eglDisplay(),mPixmapSurface);
- if (QWindowContext::currentContext().handle() != this) {
+ if (QWindowContext::currentContext()->handle() != this) {
makeCurrent();
}
@@ -141,7 +143,7 @@ void * QWaylandReadbackEglContext::getProcAddress(const QString &procName)
return (void *) eglGetProcAddress(procName.toLatin1().data());
}
-QPlatformWindowFormat QWaylandReadbackEglContext::platformWindowFormat() const
+QWindowFormat QWaylandReadbackEglContext::windowFormat() const
{
return q_windowFormatFromConfig(mEglIntegration->eglDisplay(),mConfig);
}
diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h
index 4a71ef08a7..f57ac46667 100644
--- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h
+++ b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h
@@ -60,7 +60,7 @@ public:
void swapBuffers();
void* getProcAddress(const QString& procName);
- virtual QPlatformWindowFormat platformWindowFormat() const;
+ virtual QWindowFormat windowFormat() const;
void geometryChanged();
diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp
index b77671317d..50a1170f79 100644
--- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp
@@ -83,7 +83,7 @@ void QWaylandReadbackEglIntegration::initialize()
QWaylandWindow * QWaylandReadbackEglIntegration::createEglWindow(QWindow *window)
{
- return new QWaylandReadbackEglWindow(widget,this);
+ return new QWaylandReadbackEglWindow(window,this);
}
EGLDisplay QWaylandReadbackEglIntegration::eglDisplay()
diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h
index 20e1636b7e..649f96e9cc 100644
--- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h
+++ b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h
@@ -48,6 +48,8 @@
#include <QtCore/QDataStream>
#include <QtCore/QMetaType>
#include <QtCore/QVariant>
+#include <QtCore/QEvent>
+#include <QtGui/QCursor>
#include <X11/Xlib.h>
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp
index 90d4aa59a9..4a085ae0bd 100644
--- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp
@@ -44,6 +44,8 @@
#include "qwaylandscreen.h"
#include "qwaylandglcontext.h"
+#include <QtGui/QWindow>
+
QWaylandEglWindow::QWaylandEglWindow(QWindow *window)
: QWaylandWindow(window)
, mGLContext(0)
@@ -83,7 +85,7 @@ QPlatformGLContext * QWaylandEglWindow::glContext() const
{
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);
@@ -98,7 +100,7 @@ void QWaylandEglWindow::newSurfaceCreated()
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);
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
index 172722d85c..0cff704ab1 100644
--- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
@@ -47,22 +47,17 @@
#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);
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h
index 2c6feb498c..47070f54b1 100644
--- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h
@@ -53,14 +53,14 @@ class QWaylandGLWindowSurface;
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;
@@ -70,7 +70,7 @@ private:
EGLContext mContext;
EGLSurface mSurface;
EGLConfig mConfig;
- QPlatformWindowFormat mFormat;
+ QWindowFormat mFormat;
QWaylandGLContext();
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
index 7cdd2b8c5e..e61ee69d37 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
@@ -46,6 +46,7 @@
#include "wayland-xcomposite-client-protocol.h"
#include <QtCore/QDebug>
+#include <QtGui/QRegion>
#include "qeglconvenience.h"
#include "qxlibeglintegration.h"
@@ -58,7 +59,7 @@ QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(QWaylandXCompositeEGL
, 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;
@@ -98,7 +99,7 @@ void * QWaylandXCompositeEGLContext::getProcAddress(const QString &procName)
return (void *)eglGetProcAddress(qPrintable(procName));
}
-QPlatformWindowFormat QWaylandXCompositeEGLContext::platformWindowFormat() const
+QWindowFormat QWaylandXCompositeEGLContext::windowFormat() const
{
return q_windowFormatFromConfig(mEglIntegration->eglDisplay(),mConfig);
}
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h
index 9d9dd53e0b..528faf07c5 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h
@@ -44,8 +44,6 @@
#include <QtGui/QPlatformGLContext>
-#include <QtCore/QWaitCondition>
-
#include "qwaylandbuffer.h"
#include "qwaylandxcompositeeglintegration.h"
@@ -61,7 +59,7 @@ public:
void swapBuffers();
void* getProcAddress(const QString& procName);
- QPlatformWindowFormat platformWindowFormat() const;
+ QWindowFormat windowFormat() const;
void geometryChanged();
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index e17c87fa85..afcec8e139 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -150,7 +150,7 @@ void QXcbWindow::create()
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;
@@ -890,7 +890,7 @@ QPlatformGLContext *QXcbWindow::glContext() const
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);