summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@intopalo.com>2015-05-03 20:52:15 +0300
committerAndrew Knight <qt@panimo.net>2015-05-08 02:33:58 +0000
commit00a341daa7c55926ce4d1c1f0290520b5e6c22a5 (patch)
treed9117b7a3cfe0bc16f333878682251845f3ef7e7 /src/plugins/platforms
parenta34e9ebc1b908d31ba645688a8b0e9e53c2d3c6e (diff)
winrt: Use ANGLE sub-buffer swap on Windows Phone
This allows the plugin to communicate the swap region to ANGLE and avoid glitches when the orientation changes. Task-number: QTBUG-44333 Change-Id: I40240cbcb3aaec92dbf4a82f4957965e92b9c3da Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.cpp14
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.cpp b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
index fd90582119..0832fbb586 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
@@ -33,6 +33,9 @@
#include "qwinrteglcontext.h"
+#define EGL_EGLEXT_PROTOTYPES
+#include "EGL/eglext.h"
+
QT_BEGIN_NAMESPACE
QWinRTEGLContext::QWinRTEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLSurface surface, EGLConfig config)
@@ -40,6 +43,17 @@ QWinRTEGLContext::QWinRTEGLContext(const QSurfaceFormat &format, QPlatformOpenGL
{
}
+void QWinRTEGLContext::swapBuffers(QPlatformSurface *surface)
+{
+#ifdef Q_OS_WINPHONE
+ const QSize size = surface->surface()->size();
+ eglPostSubBufferNV(eglDisplay(), eglSurfaceForPlatformSurface(surface),
+ 0, 0, size.width(), size.height());
+#else
+ eglSwapBuffers(eglDisplay(), eglSurfaceForPlatformSurface(surface));
+#endif
+}
+
EGLSurface QWinRTEGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
{
if (surface->surface()->surfaceClass() == QSurface::Window) {
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.h b/src/plugins/platforms/winrt/qwinrteglcontext.h
index bec9c19089..9b1ef37d1b 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.h
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.h
@@ -43,6 +43,7 @@ class QWinRTEGLContext : public QEGLPlatformContext
public:
explicit QWinRTEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLSurface surface, EGLConfig config);
+ void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
protected: