diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2019-01-31 13:10:50 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2019-02-08 08:59:51 +0000 |
commit | 86cf366a30c178006ee23f0fbf5bee1748a26b57 (patch) | |
tree | e58ad24937ddedc1066366516a068df04d9a5d8f | |
parent | 74e04d6ace7aa949db97ae2e46c38a4dc0d4d36a (diff) |
winrt: Use ES3 ANGLE code path when blitting widgets
We run into validation issues when using the ES2 code path when blitting
widgets on winrt. By using ES3 we not only avoid this issue, but there
might also be performance gains.
We now call window()->format() instead of window()->requestedFormat as the
latter will not respect the values that were set on initialization of the
native window (which is done in QWinRTWindow's constructor).
Change-Id: I5ed7a9326691375f9c9cb5d8d22ee8d1b643fbd0
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtbackingstore.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtwindow.cpp | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp index c23d48b2dd..fbf611d7f7 100644 --- a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp +++ b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp @@ -45,8 +45,7 @@ #include <QtGui/QOpenGLContext> #include <QtGui/QOpenGLFramebufferObject> -#include <GLES2/gl2.h> -#include <GLES2/gl2ext.h> +#include <GLES3/gl3.h> QT_BEGIN_NAMESPACE @@ -83,7 +82,7 @@ bool QWinRTBackingStore::initialize() return true; d->context.reset(new QOpenGLContext); - QSurfaceFormat format = window()->requestedFormat(); + QSurfaceFormat format = window()->format(); d->context->setFormat(format); d->context->setScreen(window()->screen()); if (!d->context->create()) @@ -138,7 +137,7 @@ void QWinRTBackingStore::flush(QWindow *window, const QRegion ®ion, const QPo const int y2 = y1 + bounds.height(); const int x1 = bounds.x(); const int x2 = x1 + bounds.width(); - glBlitFramebufferANGLE(x1, y1, x2, y2, + glBlitFramebuffer(x1, y1, x2, y2, x1, d->size.height() - y1, x2, d->size.height() - y2, GL_COLOR_BUFFER_BIT, GL_NEAREST); diff --git a/src/plugins/platforms/winrt/qwinrtwindow.cpp b/src/plugins/platforms/winrt/qwinrtwindow.cpp index 29d234d276..83c3715bfd 100644 --- a/src/plugins/platforms/winrt/qwinrtwindow.cpp +++ b/src/plugins/platforms/winrt/qwinrtwindow.cpp @@ -112,6 +112,8 @@ QWinRTWindow::QWinRTWindow(QWindow *window) d->screen = static_cast<QWinRTScreen *>(screen()); handleContentOrientationChange(window->contentOrientation()); + d->surfaceFormat.setMajorVersion(3); + d->surfaceFormat.setMinorVersion(0); d->surfaceFormat.setAlphaBufferSize(0); d->surfaceFormat.setRedBufferSize(8); d->surfaceFormat.setGreenBufferSize(8); |