diff options
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/qopenglcontext/qopenglcontext.pro | 2 | ||||
-rw-r--r-- | tests/manual/qopenglcontext/qopenglcontextwindow.cpp | 16 | ||||
-rw-r--r-- | tests/manual/qopenglcontext/qopenglcontextwindow.h | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/tests/manual/qopenglcontext/qopenglcontext.pro b/tests/manual/qopenglcontext/qopenglcontext.pro index 08a9ab407c..06e2fc2e3b 100644 --- a/tests/manual/qopenglcontext/qopenglcontext.pro +++ b/tests/manual/qopenglcontext/qopenglcontext.pro @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = qopenglcontext -QT += gui-private egl_support-private +QT += gui-private egl_support-private opengl HEADERS += $$PWD/qopenglcontextwindow.h diff --git a/tests/manual/qopenglcontext/qopenglcontextwindow.cpp b/tests/manual/qopenglcontext/qopenglcontextwindow.cpp index 0763d7244c..67898c0028 100644 --- a/tests/manual/qopenglcontext/qopenglcontextwindow.cpp +++ b/tests/manual/qopenglcontext/qopenglcontextwindow.cpp @@ -34,7 +34,6 @@ #include <qpa/qplatformnativeinterface.h> #include <QtEglSupport/private/qeglconvenience_p.h> -#include <QtPlatformHeaders/QEGLNativeContext> QOpenGLContextWindow::QOpenGLContextWindow() : m_blitter(0) @@ -98,7 +97,12 @@ void QOpenGLContextWindow::createForeignContext() // underlying native context. This way the texture, that belongs to the context // created here, will be accessible from m_context too. - EGLContext shareCtx = m_context->nativeHandle().value<QEGLNativeContext>().context(); + using namespace QPlatformInterface; + auto *eglContext = m_context->platformInterface<QEGLContext>(); + if (!eglContext) + qFatal("Not running with EGL backend"); + + EGLContext shareCtx = eglContext->nativeContext(); Q_ASSERT(shareCtx != EGL_NO_CONTEXT); EGLDisplay dpy = (EGLDisplay) qGuiApp->platformNativeInterface()->nativeResourceForWindow( @@ -127,12 +131,8 @@ void QOpenGLContextWindow::createForeignContext() Q_ASSERT(ctx != EGL_NO_CONTEXT); // Wrap ctx into a QOpenGLContext. - QOpenGLContext *ctxWrap = new QOpenGLContext; - ctxWrap->setNativeHandle(QVariant::fromValue<QEGLNativeContext>(QEGLNativeContext(ctx, dpy))); - ctxWrap->setShareContext(m_context); // only needed for correct bookkeeping - if (!ctxWrap->create()) - qFatal("Failed to created wrapping context"); - Q_ASSERT(ctxWrap->nativeHandle().value<QEGLNativeContext>().context() == ctx); + QOpenGLContext *ctxWrap = QEGLContext::fromNative(ctx, dpy, m_context); + Q_ASSERT(ctxWrap->platformInterface<QEGLContext>()->nativeContext() == ctx); QOffscreenSurface surface; surface.setFormat(fmt); diff --git a/tests/manual/qopenglcontext/qopenglcontextwindow.h b/tests/manual/qopenglcontext/qopenglcontextwindow.h index 37ff1b2082..1a497a750c 100644 --- a/tests/manual/qopenglcontext/qopenglcontextwindow.h +++ b/tests/manual/qopenglcontext/qopenglcontextwindow.h @@ -31,7 +31,7 @@ #include <QtGui/QWindow> #include <QtGui/QOpenGLContext> -#include <QtGui/QOpenGLTextureBlitter> +#include <QtOpenGL/QOpenGLTextureBlitter> #include <QtGui/QImage> #include <QtCore/QVariant> |