summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt/qwinrteglcontext.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-19 21:18:19 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2016-02-19 21:18:19 +0000
commit611942f2d737cc75c7492dffc183174e432aa155 (patch)
tree29917c92395cf81ab9e10f8a66b92e78e3ee605f /src/plugins/platforms/winrt/qwinrteglcontext.cpp
parent9b49b375e3d753fa3cd8166da266724a85cfe389 (diff)
parent4fe2fbcf827ae6bec976b0b8dcaa5d14bd05dc33 (diff)
Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7
Diffstat (limited to 'src/plugins/platforms/winrt/qwinrteglcontext.cpp')
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.cpp b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
index 8ca669141e..34f439b70f 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
@@ -49,6 +49,7 @@
#include <QOffscreenSurface>
#include <QOpenGLContext>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#include <QtPlatformSupport/private/qeglpbuffer_p.h>
QT_BEGIN_NAMESPACE
@@ -148,14 +149,17 @@ bool QWinRTEGLContext::makeCurrent(QPlatformSurface *windowSurface)
Q_D(QWinRTEGLContext);
Q_ASSERT(windowSurface->surface()->supportsOpenGL());
- if (windowSurface->surface()->surfaceClass() == QSurface::Offscreen)
- return false;
+ EGLSurface surface;
+ if (windowSurface->surface()->surfaceClass() == QSurface::Window) {
+ QWinRTWindow *window = static_cast<QWinRTWindow *>(windowSurface);
+ if (window->eglSurface() == EGL_NO_SURFACE)
+ window->createEglSurface(g->eglDisplay, d->eglConfig);
- QWinRTWindow *window = static_cast<QWinRTWindow *>(windowSurface);
- if (window->eglSurface() == EGL_NO_SURFACE)
- window->createEglSurface(g->eglDisplay, d->eglConfig);
+ surface = window->eglSurface();
+ } else { // Offscreen
+ surface = static_cast<QEGLPbuffer *>(windowSurface)->pbuffer();
+ }
- EGLSurface surface = window->eglSurface();
if (surface == EGL_NO_SURFACE)
return false;
@@ -346,4 +350,9 @@ QFunctionPointer QWinRTEGLContext::getProcAddress(const QByteArray &procName)
return eglGetProcAddress(procName.constData());
}
+EGLDisplay QWinRTEGLContext::display()
+{
+ return g->eglDisplay;
+}
+
QT_END_NAMESPACE