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>
This commit is contained in:
parent
a34e9ebc1b
commit
00a341daa7
@ -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) {
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user