diff options
author | Liang Qi <liang.qi@qt.io> | 2017-04-07 10:18:50 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-04-07 10:24:33 +0200 |
commit | 5d6073be27cb951b692bbcc4dc0dd54cc09c9fd4 (patch) | |
tree | c87c236cd1b9c15eb5f40df3d86915687ab6c59a /src/gui/kernel | |
parent | 97d7d80e7355019bb23bb03c2a82908e4436deb0 (diff) | |
parent | bbb67ca32cebad312f02e916dff54e591b92af24 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
mkspecs/linux-icc/qmake.conf
mkspecs/macx-icc/qmake.conf
mkspecs/win32-icc/qmake.conf
src/gui/painting/qgrayraster.c
Change-Id: Ib08c45ea3215be05f986ecb3e1f4b37d209aa775
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 34 | ||||
-rw-r--r-- | src/gui/kernel/qplatforminputcontextfactory.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qrasterwindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/kernel/qrasterwindow.h | 1 |
5 files changed, 47 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index b665750181..a3b2c4c1e4 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2008,6 +2008,8 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh buttons, e->modifiers, e->phase, e->source, e->inverted); ev.setTimestamp(e->timestamp); QGuiApplication::sendSpontaneousEvent(window, &ev); +#else + Q_UNUSED(e); #endif /* ifndef QT_NO_WHEELEVENT */ } diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 8aea593bf0..3dc06ae60e 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -982,6 +982,40 @@ bool QOpenGLContext::makeCurrent(QSurface *surface) QOpenGLContext *previous = QOpenGLContextPrivate::setCurrentContext(this); if (d->platformGLContext->makeCurrent(surface->surfaceHandle())) { + static bool needsWorkaroundSet = false; + static bool needsWorkaround = false; + + if (!needsWorkaroundSet) { + QByteArray env; +#ifdef Q_OS_ANDROID + env = qgetenv(QByteArrayLiteral("QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND")); + needsWorkaround = env.isEmpty() || env == QByteArrayLiteral("0") || env == QByteArrayLiteral("false"); +#endif + env = qgetenv(QByteArrayLiteral("QT_ENABLE_GLYPH_CACHE_WORKAROUND")); + if (env == QByteArrayLiteral("1") || env == QByteArrayLiteral("true")) + needsWorkaround = true; + + if (!needsWorkaround) { + const char *rendererString = reinterpret_cast<const char *>(functions()->glGetString(GL_RENDERER)); + if (rendererString) + needsWorkaround = + qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450 + || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205 + || qstrncmp(rendererString, "Adreno 2xx", 8) == 0 // Same as above but without the '(TM)' + || qstrncmp(rendererString, "Adreno (TM) 30x", 14) == 0 // Adreno 302, 305 + || qstrncmp(rendererString, "Adreno 30x", 9) == 0 // Same as above but without the '(TM)' + || qstrncmp(rendererString, "Adreno (TM) 4xx", 13) == 0 // Adreno 405, 418, 420, 430 + || qstrncmp(rendererString, "Adreno 4xx", 8) == 0 // Same as above but without the '(TM)' + || qstrcmp(rendererString, "GC800 core") == 0 + || qstrcmp(rendererString, "GC1000 core") == 0 + || qstrcmp(rendererString, "Immersion.16") == 0; + } + needsWorkaroundSet = true; + } + + if (needsWorkaround) + d->workaround_brokenFBOReadBack = true; + d->surface = surface; d->shareGroup->d_func()->deletePendingResources(this); diff --git a/src/gui/kernel/qplatforminputcontextfactory.cpp b/src/gui/kernel/qplatforminputcontextfactory.cpp index 5f4f8d88fa..c59d89fabe 100644 --- a/src/gui/kernel/qplatforminputcontextfactory.cpp +++ b/src/gui/kernel/qplatforminputcontextfactory.cpp @@ -82,6 +82,8 @@ QPlatformInputContext *QPlatformInputContextFactory::create(const QString& key) delete ic; } +#else + Q_UNUSED(key); #endif return 0; } diff --git a/src/gui/kernel/qrasterwindow.cpp b/src/gui/kernel/qrasterwindow.cpp index d8d448249e..73871e0f39 100644 --- a/src/gui/kernel/qrasterwindow.cpp +++ b/src/gui/kernel/qrasterwindow.cpp @@ -105,6 +105,14 @@ QRasterWindow::QRasterWindow(QWindow *parent) d_func()->backingstore.reset(new QBackingStore(this)); } +QRasterWindow::~QRasterWindow() +{ + Q_D(QRasterWindow); + // Delete backingstore while window is still alive, as it + // might need to reference the window in the process + d->backingstore.reset(nullptr); +} + /*! \internal */ diff --git a/src/gui/kernel/qrasterwindow.h b/src/gui/kernel/qrasterwindow.h index 76312bcda2..9b29183ad6 100644 --- a/src/gui/kernel/qrasterwindow.h +++ b/src/gui/kernel/qrasterwindow.h @@ -54,6 +54,7 @@ class Q_GUI_EXPORT QRasterWindow : public QPaintDeviceWindow public: explicit QRasterWindow(QWindow *parent = Q_NULLPTR); + ~QRasterWindow(); protected: int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE; |