diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-11-19 14:58:43 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2014-11-26 09:31:16 +0100 |
commit | 37cce4cadace48a22cbc5252810237341a371b10 (patch) | |
tree | 8cbe588c8ee3ad7e06428736bedeac94e7f49d3e /src/platformsupport/eglconvenience/qeglplatformintegration.cpp | |
parent | e41713b21dad247aca1af493aa7e06f0822dc4ea (diff) |
Add generic OpenGL compositor and backingstore bits
By removing the EGL(FS) dependencies we get classes that can be used
by any platform plugin that runs without a windowing system.
Change-Id: If99b42de5a4da02bbef80863609b6d92c6734613
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformintegration.cpp')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformintegration.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp index fea2ae2369..09011e6e58 100644 --- a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp @@ -43,6 +43,7 @@ #include <QtPlatformSupport/private/qgenericunixservices_p.h> #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> #include <QtPlatformSupport/private/qfbvthandler_p.h> +#include <QtPlatformSupport/private/qopenglcompositorbackingstore_p.h> #if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)) #include <QtPlatformSupport/private/qevdevmousemanager_p.h> @@ -59,7 +60,6 @@ #include "qeglplatformintegration_p.h" #include "qeglplatformcontext_p.h" #include "qeglplatformwindow_p.h" -#include "qeglplatformbackingstore_p.h" #include "qeglplatformscreen_p.h" #include "qeglplatformcursor_p.h" @@ -141,7 +141,9 @@ QPlatformFontDatabase *QEGLPlatformIntegration::fontDatabase() const QPlatformBackingStore *QEGLPlatformIntegration::createPlatformBackingStore(QWindow *window) const { - return new QEGLPlatformBackingStore(window); + QOpenGLCompositorBackingStore *bs = new QOpenGLCompositorBackingStore(window); + static_cast<QEGLPlatformWindow *>(window->handle())->setBackingStore(bs); + return bs; } QPlatformWindow *QEGLPlatformIntegration::createPlatformWindow(QWindow *window) const @@ -156,10 +158,9 @@ QPlatformWindow *QEGLPlatformIntegration::createPlatformWindow(QWindow *window) QPlatformOpenGLContext *QEGLPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { - QEGLPlatformScreen *screen = static_cast<QEGLPlatformScreen *>(context->screen()->handle()); // If there is a "root" window into which raster and QOpenGLWidget content is // composited, all other contexts must share with its context. - QOpenGLContext *compositingContext = screen ? screen->compositingContext() : 0; + QOpenGLContext *compositingContext = QOpenGLCompositor::instance()->context(); QPlatformOpenGLContext *share = compositingContext ? compositingContext->handle() : context->shareHandle(); QVariant nativeHandle = context->nativeHandle(); QPlatformOpenGLContext *platformContext = createContext(context->format(), |