diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-02-11 14:59:30 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-13 20:54:01 +0100 |
commit | ff11af4fbc2948a3a3bc635549c7ac349d249abc (patch) | |
tree | 79d6544923010bb740913842c550a010c6ae6922 /src/platformsupport/eglconvenience/qeglplatformintegration.cpp | |
parent | 5b422304a9b97b628dc9990fd67e2f293d535b41 (diff) |
QOpenGLWidget and new-style compositing on eglfs
Integrate with QOpenGLTextureBlitter, QOpenGLWidget and friends.
Change-Id: Ic2867b713a21a3d2820d546174fc9164b3dd220c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformintegration.cpp')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformintegration.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp index 5fc1721f6c..a961035e22 100644 --- a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp @@ -41,6 +41,7 @@ #include <QtGui/QWindow> #include <QtGui/QOpenGLContext> +#include <QtGui/QOffscreenSurface> #include <QtGui/QGuiApplication> #include <qpa/qwindowsysteminterface.h> #include <qpa/qplatforminputcontextfactory_p.h> @@ -79,8 +80,7 @@ QT_BEGIN_NAMESPACE The backing store, native interface accessors, font database, basic capability flags, etc. are provided out of the box, no - further customization is needed. Subclasses are still responsible - however for context and offscreen surface creation. + further customization is needed. \note It is critical that this class' implementation of initialize() is called. Therefore subclasses should either avoid @@ -155,6 +155,23 @@ QPlatformWindow *QEGLPlatformIntegration::createPlatformWindow(QWindow *window) return w; } +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; + return createContext(context->format(), + compositingContext ? compositingContext->handle() : context->shareHandle(), + display()); +} + +QPlatformOffscreenSurface *QEGLPlatformIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const +{ + QEGLPlatformScreen *screen = static_cast<QEGLPlatformScreen *>(surface->screen()->handle()); + return createOffscreenSurface(screen->display(), surface->requestedFormat(), surface); +} + bool QEGLPlatformIntegration::hasCapability(QPlatformIntegration::Capability cap) const { switch (cap) { @@ -162,6 +179,7 @@ bool QEGLPlatformIntegration::hasCapability(QPlatformIntegration::Capability cap case OpenGL: return true; case ThreadedOpenGL: return true; case WindowManagement: return false; + case RasterGLSurface: return true; default: return QPlatformIntegration::hasCapability(cap); } } |