summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-07-25 14:55:45 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2011-07-26 12:02:32 +0200
commite4042435ba15e6da669f541cd43580f85dbeae3f (patch)
tree527211f3055fb46e09eadb518c5163861020328d /src/gui
parentc7c8a38ec313b998d0df76cd15fa360f56d213e2 (diff)
Get the eglfs plugin compiling.
Change-Id: I5addb1a2593a670d559b9fbf9183f52af410895b Reviewed-on: http://codereview.qt.nokia.com/2176 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiglcontext_qpa.cpp1
-rw-r--r--src/gui/kernel/qplatformglcontext_qpa.cpp28
-rw-r--r--src/gui/kernel/qplatformglcontext_qpa.h17
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.cpp10
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.h3
5 files changed, 58 insertions, 1 deletions
diff --git a/src/gui/kernel/qguiglcontext_qpa.cpp b/src/gui/kernel/qguiglcontext_qpa.cpp
index 61a0479bd3..a11a1c77de 100644
--- a/src/gui/kernel/qguiglcontext_qpa.cpp
+++ b/src/gui/kernel/qguiglcontext_qpa.cpp
@@ -180,6 +180,7 @@ bool QGuiGLContext::create()
Q_D(QGuiGLContext);
d->platformGLContext = QGuiApplicationPrivate::platformIntegration()->createPlatformGLContext(this);
+ d->platformGLContext->setContext(this);
return d->platformGLContext;
}
diff --git a/src/gui/kernel/qplatformglcontext_qpa.cpp b/src/gui/kernel/qplatformglcontext_qpa.cpp
index efad9e3cd6..81030b8cfe 100644
--- a/src/gui/kernel/qplatformglcontext_qpa.cpp
+++ b/src/gui/kernel/qplatformglcontext_qpa.cpp
@@ -79,3 +79,31 @@
Reimplement this function in a subclass to indicate what format the glContext actually has.
*/
+
+struct QPlatformGLContextPrivate
+{
+ QGuiGLContext *context;
+};
+
+QPlatformGLContext::QPlatformGLContext()
+ : d_ptr(new QPlatformGLContextPrivate)
+{
+ Q_D(QPlatformGLContext);
+ d->context = 0;
+}
+
+QPlatformGLContext::~QPlatformGLContext()
+{
+}
+
+QGuiGLContext *QPlatformGLContext::context() const
+{
+ Q_D(const QPlatformGLContext);
+ return d->context;
+}
+
+void QPlatformGLContext::setContext(QGuiGLContext *context)
+{
+ Q_D(QPlatformGLContext);
+ d->context = context;
+}
diff --git a/src/gui/kernel/qplatformglcontext_qpa.h b/src/gui/kernel/qplatformglcontext_qpa.h
index e362e477c0..30d7186bd1 100644
--- a/src/gui/kernel/qplatformglcontext_qpa.h
+++ b/src/gui/kernel/qplatformglcontext_qpa.h
@@ -67,10 +67,14 @@ private:
friend class QPlatformWindow;
};
+class QPlatformGLContextPrivate;
+
class Q_GUI_EXPORT QPlatformGLContext
{
+ Q_DECLARE_PRIVATE(QPlatformGLContext)
public:
- virtual ~QPlatformGLContext() {}
+ QPlatformGLContext();
+ virtual ~QPlatformGLContext();
virtual QSurfaceFormat format() const = 0;
@@ -80,6 +84,17 @@ public:
virtual void doneCurrent() = 0;
virtual void (*getProcAddress(const QByteArray &procName)) () = 0;
+
+ QGuiGLContext *context() const;
+
+private:
+ friend class QGuiGLContext;
+
+ QScopedPointer<QPlatformGLContextPrivate> d_ptr;
+
+ void setContext(QGuiGLContext *context);
+
+ Q_DISABLE_COPY(QPlatformGLContext)
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp
index b1fdc9734d..cd4cc2e034 100644
--- a/src/gui/kernel/qplatformwindow_qpa.cpp
+++ b/src/gui/kernel/qplatformwindow_qpa.cpp
@@ -43,6 +43,7 @@
#include <QtGui/qwindowsysteminterface_qpa.h>
#include <QtGui/qwindow.h>
+#include <QtGui/qscreen.h>
class QPlatformWindowPrivate
{
@@ -89,6 +90,15 @@ QPlatformWindow *QPlatformWindow::parent() const
}
/*!
+ Returns the platform screen handle corresponding to this platform window.
+*/
+QPlatformScreen *QPlatformWindow::screen() const
+{
+ Q_D(const QPlatformWindow);
+ return d->window->screen()->handle();
+}
+
+/*!
Returns the actual surface format of the window.
*/
QSurfaceFormat QPlatformWindow::format() const
diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow_qpa.h
index dc988e183e..680b24ac9b 100644
--- a/src/gui/kernel/qplatformwindow_qpa.h
+++ b/src/gui/kernel/qplatformwindow_qpa.h
@@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
+class QPlatformScreen;
class QPlatformWindowPrivate;
class QWindow;
@@ -68,6 +69,8 @@ public:
QWindow *window() const;
QPlatformWindow *parent() const;
+ QPlatformScreen *screen() const;
+
virtual QSurfaceFormat format() const;
virtual void setGeometry(const QRect &rect);