diff options
-rw-r--r-- | src/plugins/platforms/webgl/qwebglintegration.cpp | 6 | ||||
-rw-r--r-- | src/plugins/platforms/webgl/qwebglintegration.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/webgl/qwebglwindow.cpp | 16 | ||||
-rw-r--r-- | src/plugins/platforms/webgl/qwebglwindow.h | 10 |
4 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/platforms/webgl/qwebglintegration.cpp b/src/plugins/platforms/webgl/qwebglintegration.cpp index dfae866..645c766 100644 --- a/src/plugins/platforms/webgl/qwebglintegration.cpp +++ b/src/plugins/platforms/webgl/qwebglintegration.cpp @@ -253,6 +253,12 @@ QPlatformWindow *QWebGLIntegration::createPlatformWindow(QWindow *window) const return platformWindow; } +QPlatformOffscreenSurface *QWebGLIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const +{ + qCDebug(lcWebGL, "New offscreen surface %p", surface); + return new QWebGLOffscreenSurface(surface); +} + QPlatformOpenGLContext *QWebGLIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { diff --git a/src/plugins/platforms/webgl/qwebglintegration.h b/src/plugins/platforms/webgl/qwebglintegration.h index f3e22df..2e1d6c4 100644 --- a/src/plugins/platforms/webgl/qwebglintegration.h +++ b/src/plugins/platforms/webgl/qwebglintegration.h @@ -59,6 +59,7 @@ public: QPlatformInputContext *inputContext() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; + QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; diff --git a/src/plugins/platforms/webgl/qwebglwindow.cpp b/src/plugins/platforms/webgl/qwebglwindow.cpp index 93a77bc..8b2af2e 100644 --- a/src/plugins/platforms/webgl/qwebglwindow.cpp +++ b/src/plugins/platforms/webgl/qwebglwindow.cpp @@ -40,6 +40,7 @@ #include <QtGui/qpa/qwindowsysteminterface.h> #include <QtGui/qpa/qplatformintegration.h> #include <QtGui/qopenglcontext.h> +#include <QtGui/qoffscreensurface.h> #include "qwebglwindow.h" @@ -170,4 +171,19 @@ WId QWebGLWindow::winId() const return d->id; } +QWebGLOffscreenSurface::QWebGLOffscreenSurface(QOffscreenSurface *offscreenSurface) + : QPlatformOffscreenSurface(offscreenSurface) +{ +} + +QSurfaceFormat QWebGLOffscreenSurface::format() const +{ + return offscreenSurface()->format(); +} + +bool QWebGLOffscreenSurface::isValid() const +{ + return true; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/webgl/qwebglwindow.h b/src/plugins/platforms/webgl/qwebglwindow.h index 945541d..8724d9c 100644 --- a/src/plugins/platforms/webgl/qwebglwindow.h +++ b/src/plugins/platforms/webgl/qwebglwindow.h @@ -35,6 +35,7 @@ #include <QtCore/qscopedpointer.h> #include <QtGui/qpa/qplatformwindow.h> +#include <QtGui/qpa/qplatformoffscreensurface.h> QT_BEGIN_NAMESPACE @@ -72,6 +73,15 @@ private: QScopedPointer<QWebGLWindowPrivate> d_ptr; }; +class QWebGLOffscreenSurface : public QPlatformOffscreenSurface +{ +public: + QWebGLOffscreenSurface(QOffscreenSurface *offscreenSurface); + + QSurfaceFormat format() const override; + bool isValid() const override; +}; + QT_END_NAMESPACE #endif // QWEBGLWINDOW_H |