summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/gl_integration/xcomposite_egl
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-06-21 13:39:26 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-06-21 14:02:22 +0200
commit176f30b13739b352cbe453cba7796d9a9c808bcd (patch)
tree8fa60b6ae4ef06455652863a0406bc5e86a22303 /src/plugins/platforms/wayland/gl_integration/xcomposite_egl
parent272daebaa07b21e372ad4274fafb51ce0be92396 (diff)
OpenGL API refactor.
Rename QGuiGLFormat to QSurfaceFormat, and make QWindow sub-class of QSurface and QPlatformWindow sub-class of QPlatformSurface, instead of having QPlatformGLSurface accessor in QWindow.
Diffstat (limited to 'src/plugins/platforms/wayland/gl_integration/xcomposite_egl')
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp30
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h18
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp2
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h2
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp7
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h2
6 files changed, 20 insertions, 41 deletions
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 c43b675d44..6c1018d79a 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
@@ -48,31 +48,25 @@
#include <QtPlatformSupport/private/qeglconvenience_p.h>
-QWaylandXCompositeEGLSurface::QWaylandXCompositeEGLSurface(QWaylandXCompositeEGLWindow *window)
- : QEGLSurface(window->eglSurface(), window->window()->glFormat())
- , m_window(window)
-{
-}
-
-EGLSurface QWaylandXCompositeEGLSurface::eglSurface() const
-{
- return m_window->eglSurface();
-}
-
-QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(const QGuiGLFormat &format, QPlatformGLContext *share, EGLDisplay display)
+QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformGLContext *share, EGLDisplay display)
: QEGLPlatformContext(format, share, display)
{
}
-void QWaylandXCompositeEGLContext::swapBuffers(const QPlatformGLSurface &surface)
+void QWaylandXCompositeEGLContext::swapBuffers(QPlatformSurface *surface)
{
QEGLPlatformContext::swapBuffers(surface);
- const QWaylandXCompositeEGLSurface &s =
- static_cast<const QWaylandXCompositeEGLSurface &>(surface);
+ QWaylandXCompositeEGLWindow *w =
+ static_cast<QWaylandXCompositeEGLWindow *>(surface);
+
+ QSize size = w->geometry().size();
- QSize size = s.window()->geometry().size();
+ w->damage(QRect(QPoint(), size));
+ w->waitForFrameSync();
+}
- s.window()->damage(QRect(QPoint(), size));
- s.window()->waitForFrameSync();
+EGLSurface QWaylandXCompositeEGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
+{
+ return static_cast<QWaylandXCompositeEGLWindow *>(surface)->eglSurface();
}
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 e394ea1a04..f0e96a19af 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h
@@ -50,23 +50,15 @@
class QWaylandXCompositeEGLWindow;
-class QWaylandXCompositeEGLSurface : public QEGLSurface
-{
-public:
- QWaylandXCompositeEGLSurface(QWaylandXCompositeEGLWindow *window);
-
- EGLSurface eglSurface() const;
- QWaylandXCompositeEGLWindow *window() const { return m_window; }
-private:
- QWaylandXCompositeEGLWindow *m_window;
-};
-
class QWaylandXCompositeEGLContext : public QEGLPlatformContext
{
public:
- QWaylandXCompositeEGLContext(const QGuiGLFormat &format, QPlatformGLContext *share, EGLDisplay display);
+ QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformGLContext *share, EGLDisplay display);
- void swapBuffers(const QPlatformGLSurface &surface);
+ void swapBuffers(QPlatformSurface *surface);
+
+private:
+ EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface);
};
#endif // QWAYLANDXCOMPOSITEEGLCONTEXT_H
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp
index 90d5bea770..47454dccab 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp
@@ -75,7 +75,7 @@ QWaylandWindow * QWaylandXCompositeEGLIntegration::createEglWindow(QWindow *wind
return new QWaylandXCompositeEGLWindow(window,this);
}
-QPlatformGLContext *QWaylandXCompositeEGLIntegration::createPlatformGLContext(const QGuiGLFormat &glFormat, QPlatformGLContext *share) const
+QPlatformGLContext *QWaylandXCompositeEGLIntegration::createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const
{
return new QWaylandXCompositeEGLContext(glFormat, share, eglDisplay());
}
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h
index ac302ef89f..1f67bf28e1 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h
@@ -69,7 +69,7 @@ public:
void initialize();
QWaylandWindow *createEglWindow(QWindow *window);
- QPlatformGLContext *createPlatformGLContext(const QGuiGLFormat &glFormat, QPlatformGLContext *share) const;
+ QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
QWaylandDisplay *waylandDisplay() const;
struct wl_xcomposite *waylandXComposite() const;
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp
index 5e1bab2044..9bf857d734 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp
@@ -57,7 +57,7 @@ QWaylandXCompositeEGLWindow::QWaylandXCompositeEGLWindow(QWindow *window, QWayla
, m_context(0)
, m_buffer(0)
, m_xWindow(0)
- , m_config(q_configFromGLFormat(glxIntegration->eglDisplay(), window->glFormat(), true))
+ , m_config(q_configFromGLFormat(glxIntegration->eglDisplay(), window->format(), true))
, m_surface(0)
, m_waitingForSync(false)
{
@@ -69,11 +69,6 @@ QWaylandWindow::WindowType QWaylandXCompositeEGLWindow::windowType() const
return QWaylandWindow::Egl;
}
-QPlatformGLSurface *QWaylandXCompositeEGLWindow::createGLSurface() const
-{
- return new QWaylandXCompositeEGLSurface(const_cast<QWaylandXCompositeEGLWindow *>(this));
-}
-
void QWaylandXCompositeEGLWindow::setGeometry(const QRect &rect)
{
QWaylandWindow::setGeometry(rect);
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h
index 16188ca3e0..535498a722 100644
--- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h
@@ -54,8 +54,6 @@ public:
QWaylandXCompositeEGLWindow(QWindow *window, QWaylandXCompositeEGLIntegration *glxIntegration);
WindowType windowType() const;
- QPlatformGLSurface *createGLSurface() const;
-
void setGeometry(const QRect &rect);
EGLSurface eglSurface() const;