diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2013-10-08 14:55:28 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-09 13:52:58 +0200 |
commit | 80cd06fd9d26aa7df02f71e001b449d65bb5b7a3 (patch) | |
tree | 240ef609bab7f481e7b86cd6ad625b457de38c28 /src/plugins/platforms/eglfs/qeglfsintegration.cpp | |
parent | 8d2c6206fdf564aa75680f4fea58e31d26a3d6dd (diff) |
eglfs: Separate compositor and improve raster window support
Separating the compositor into a separate source file improves the
chances of possible future reuse and paves the way to supporting
multiple GL windows. Tooltips are now working too. Implemented a few
window functions like raise() and lower(). Fixed the qFatal for
multiple GL windows to be raised in non-SDK based Android builds too.
Change-Id: Id94d2fb2a4382766f3d130eebe1e6f397a535852
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsintegration.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 45dccfa79f..67f0c35ed7 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -43,6 +43,7 @@ #include "qeglfswindow.h" #include "qeglfsbackingstore.h" +#include "qeglfscompositor.h" #include "qeglfshooks.h" #include <QtGui/private/qguiapplication_p.h> @@ -75,8 +76,6 @@ QT_BEGIN_NAMESPACE -static void *eglContextForContext(QOpenGLContext *context); - QEglFSIntegration::QEglFSIntegration() : mFontDb(new QGenericUnixFontDatabase) , mServices(new QGenericUnixServices) @@ -108,8 +107,8 @@ QEglFSIntegration::QEglFSIntegration() QEglFSIntegration::~QEglFSIntegration() { + QEglFSCompositor::destroy(); delete mScreen; - eglTerminate(mDisplay); QEglFSHooks::hooks()->platformDestroy(); } @@ -131,9 +130,11 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const { + QWindowSystemInterface::flushWindowSystemEvents(); QEglFSWindow *w = new QEglFSWindow(window); w->create(); - w->requestActivateWindow(); + if (window->type() != Qt::ToolTip) + w->requestActivateWindow(); return w; } @@ -263,15 +264,6 @@ void *QEglFSIntegration::nativeResourceForContext(const QByteArray &resource, QO return result; } -QPlatformNativeInterface::NativeResourceForContextFunction QEglFSIntegration::nativeResourceFunctionForContext(const QByteArray &resource) -{ - QByteArray lowerCaseResource = resource.toLower(); - if (lowerCaseResource == "get_egl_context") - return NativeResourceForContextFunction(eglContextForContext); - - return 0; -} - static void *eglContextForContext(QOpenGLContext *context) { Q_ASSERT(context); @@ -283,6 +275,15 @@ static void *eglContextForContext(QOpenGLContext *context) return handle->eglContext(); } +QPlatformNativeInterface::NativeResourceForContextFunction QEglFSIntegration::nativeResourceFunctionForContext(const QByteArray &resource) +{ + QByteArray lowerCaseResource = resource.toLower(); + if (lowerCaseResource == "get_egl_context") + return NativeResourceForContextFunction(eglContextForContext); + + return 0; +} + EGLConfig QEglFSIntegration::chooseConfig(EGLDisplay display, const QSurfaceFormat &format) { class Chooser : public QEglConfigChooser { |