diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-11 15:59:23 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-11 15:59:23 +0200 |
commit | 7d6697a4fa30349852d9559f4742fcfe3868504e (patch) | |
tree | b5b7f1f71db7af4ea2eb4eeb42adb48ac2d8bee6 | |
parent | 90bb25e2132aded600cf68337f2390e3eb7d7a0d (diff) | |
parent | 93946a3c2391d2e7260e310db0999b7f87e16083 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I7a33f19a46adc206a282a5854a98e89542c7b99d
-rw-r--r-- | dist/changes-5.11.2 | 24 | ||||
-rw-r--r-- | src/plugins/platforms/webgl/qwebglcontext.cpp | 12 | ||||
-rw-r--r-- | tests/plugins/platforms/webgl/tst_webgl.cpp | 15 |
3 files changed, 41 insertions, 10 deletions
diff --git a/dist/changes-5.11.2 b/dist/changes-5.11.2 new file mode 100644 index 0000000..8efdf5e --- /dev/null +++ b/dist/changes-5.11.2 @@ -0,0 +1,24 @@ +Qt 5.11.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.11.0 through 5.11.1. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.11 series is binary compatible with the 5.10.x series. +Applications compiled for 5.10 will continue to run with 5.11. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.11.2 Changes * +**************************************************************************** + + - This release contains only minor code improvements. diff --git a/src/plugins/platforms/webgl/qwebglcontext.cpp b/src/plugins/platforms/webgl/qwebglcontext.cpp index cb56182..409b093 100644 --- a/src/plugins/platforms/webgl/qwebglcontext.cpp +++ b/src/plugins/platforms/webgl/qwebglcontext.cpp @@ -41,6 +41,7 @@ #include <QtCore/qrect.h> #include <QtCore/qset.h> #include <QtGui/private/qguiapplication_p.h> +#include <QtGui/private/qopenglcontext_p.h> #include <QtGui/qguiapplication.h> #include <QtGui/qimage.h> #include <QtGui/qopenglcontext.h> @@ -1506,17 +1507,16 @@ bool QWebGLContext::makeCurrent(QPlatformSurface *surface) return false; } - auto context = QOpenGLContext::currentContext(); - Q_ASSERT(context); - auto handle = static_cast<QWebGLContext *>(context->handle()); - handle->d_func()->currentSurface = surface; + QOpenGLContextPrivate::setCurrentContext(context()); + d->currentSurface = surface; + auto event = createEvent(QStringLiteral("makeCurrent")); if (!event) return false; event->addInt(d->id); if (surface->surface()->surfaceClass() == QSurface::Window) { auto window = static_cast<QWebGLWindow *>(surface); - if (s_contextData[handle->id()].cachedParameters.isEmpty()) { + if (s_contextData[id()].cachedParameters.isEmpty()) { auto future = window->d_func()->defaults.get_future(); std::future_status status = std::future_status::timeout; while (status == std::future_status::timeout) { @@ -1524,7 +1524,7 @@ bool QWebGLContext::makeCurrent(QPlatformSurface *surface) return false; status = future.wait_for(std::chrono::milliseconds(100)); } - s_contextData[handle->id()].cachedParameters = future.get(); + s_contextData[id()].cachedParameters = future.get(); } event->addInt(window->window()->width()); event->addInt(window->window()->height()); diff --git a/tests/plugins/platforms/webgl/tst_webgl.cpp b/tests/plugins/platforms/webgl/tst_webgl.cpp index 306d6fd..d7bb6bb 100644 --- a/tests/plugins/platforms/webgl/tst_webgl.cpp +++ b/tests/plugins/platforms/webgl/tst_webgl.cpp @@ -60,6 +60,8 @@ class tst_WebGL : public QObject QStringList functions; QProcess process; + bool findSwapBuffers(const QSignalSpy &spy); + signals: void command(const QString &name, const QVariantList ¶meters); void queryCommand(const QString &name, int id, const QVariantList ¶meters); @@ -81,6 +83,14 @@ private slots: void waitForSwapBuffers(); }; +bool tst_WebGL::findSwapBuffers(const QSignalSpy &spy) +{ + return std::find_if(spy.cbegin(), spy.cend(), [](const QList<QVariant> &list) { + // Our connect message changed the scene's size, forcing a swapBuffers() call. + return list.first() == QLatin1String("swapBuffers"); + }) != spy.cend(); +} + void tst_WebGL::parseTextMessage(const QString &text) { const auto document = QJsonDocument::fromJson(text.toUtf8()); @@ -275,10 +285,7 @@ void tst_WebGL::waitForSwapBuffers_data() void tst_WebGL::waitForSwapBuffers() { QSignalSpy spy(this, &tst_WebGL::queryCommand); - QTRY_VERIFY(std::find_if(spy.cbegin(), spy.cend(), [](const QList<QVariant> &list) { - // Our connect message changed the scene's size, forcing a swapBuffers() call. - return list.first() == QLatin1String("swapBuffers"); - }) != spy.cend()); + QTRY_VERIFY(findSwapBuffers(spy)); } QTEST_MAIN(tst_WebGL) |