diff options
author | Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> | 2012-06-06 13:57:09 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-12 04:29:49 +0200 |
commit | e9df01d3db83ec4ba64c99c92495e6dd0e201420 (patch) | |
tree | 11ed60d01ae457b676d9be854762c58b9b178da3 /src/plugins/platforms/eglfs/qeglfsintegration.cpp | |
parent | 040f30decd24c32f71f14eeaed5fdcd58b2dce3d (diff) |
eglfs refactor: move window creation into qeglfswindow
This potentially allows the creation of multiple QWindows. The platform
context is now in a seperate file and the integration provides a new
instance of the context allowing creation of multiple contexts.
Change-Id: If2b6fa29b573d87c0a4cd0a8eff1f044bd1ff9b8
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsintegration.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 94bf0d9732..f27f37acfa 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -61,6 +61,8 @@ #include <QtGui/QScreen> #include <qpa/qplatformcursor.h> +#include "qeglfscontext.h" + #include <EGL/egl.h> QT_BEGIN_NAMESPACE @@ -88,15 +90,12 @@ QEglFSIntegration::QEglFSIntegration() qWarning("Could not open egl display\n"); qFatal("EGL error"); } - qWarning("Opened display %p\n", mDisplay); if (!eglInitialize(mDisplay, &major, &minor)) { qWarning("Could not initialize egl display\n"); qFatal("EGL error"); } - qWarning("Initialized display %d %d\n", major, minor); - int swapInterval = 1; QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL"); if (!swapIntervalString.isEmpty()) { @@ -109,10 +108,6 @@ QEglFSIntegration::QEglFSIntegration() mScreen = new QEglFSScreen(mDisplay); screenAdded(mScreen); - -#ifdef QEGL_EXTRA_DEBUG - qWarning("QEglFSIntegration\n"); -#endif } QEglFSIntegration::~QEglFSIntegration() @@ -139,27 +134,19 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const { -#ifdef QEGL_EXTRA_DEBUG - qWarning("QEglFSIntegration::createPlatformWindow %p\n",window); -#endif QPlatformWindow *w = new QEglFSWindow(window); w->requestActivateWindow(); - return w; } - QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *window) const { -#ifdef QEGL_EXTRA_DEBUG - qWarning("QEglFSIntegration::createWindowSurface %p\n", window); -#endif return new QEglFSBackingStore(window); } QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { - return static_cast<QEglFSScreen *>(context->screen()->handle())->platformContext(); + return new QEglFSContext(context->format(), 0 /*share*/, mDisplay); } QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const |