From 86cf366a30c178006ee23f0fbf5bee1748a26b57 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 31 Jan 2019 13:10:50 +0100 Subject: 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 Reviewed-by: Miguel Costa --- src/plugins/platforms/winrt/qwinrtbackingstore.cpp | 7 +++---- src/plugins/platforms/winrt/qwinrtwindow.cpp | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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 #include -#include -#include +#include 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(screen()); handleContentOrientationChange(window->contentOrientation()); + d->surfaceFormat.setMajorVersion(3); + d->surfaceFormat.setMinorVersion(0); d->surfaceFormat.setAlphaBufferSize(0); d->surfaceFormat.setRedBufferSize(8); d->surfaceFormat.setGreenBufferSize(8); -- cgit v1.2.3