diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-16 01:00:32 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-16 01:00:33 +0200 |
commit | 56f46ba13dd9273b4be4e8f1f1f867a6feff04da (patch) | |
tree | c05a8f2bea5f645eaff32a5aa0380a9704366b6e /src | |
parent | 37bae591b7829cd8ac6a9c8556bbe6b96b365bc3 (diff) | |
parent | 66a1975200c5ec106205522c37e32f990df84883 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ia3645f92b9debf3e1fe2d972300c7d0dbd649268
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 20 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 4 | ||||
-rw-r--r-- | src/gui/opengl/qopenglprogrambinarycache.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qstroker_p.h | 2 | ||||
-rw-r--r-- | src/network/access/http2/http2protocol_p.h | 6 | ||||
-rw-r--r-- | src/platformsupport/glxconvenience/qglxconvenience.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsglcontext.cpp | 11 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 12 | ||||
-rw-r--r-- | src/testlib/qtestcase.h | 2 |
9 files changed, 40 insertions, 24 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index a8ed8ca6fd..dd54ef61dc 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -88,6 +88,11 @@ # include <sys/systeminfo.h> #endif +#if defined(Q_OS_DARWIN) && QT_HAS_INCLUDE(<IOKit/IOKitLib.h>) +# include <IOKit/IOKitLib.h> +# include <private/qcore_mac_p.h> +#endif + #ifdef Q_OS_UNIX #include <sys/utsname.h> #include <private/qcore_unix_p.h> @@ -2996,20 +3001,19 @@ enum { */ QByteArray QSysInfo::machineUniqueId() { -#ifdef Q_OS_BSD4 +#if defined(Q_OS_DARWIN) && QT_HAS_INCLUDE(<IOKit/IOKitLib.h>) + char uuid[UuidStringLen + 1]; + io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); + QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); + CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); + return QByteArray(uuid); +#elif defined(Q_OS_BSD4) && defined(KERN_HOSTUUID) char uuid[UuidStringLen + 1]; size_t uuidlen = sizeof(uuid); -# ifdef KERN_HOSTUUID int name[] = { CTL_KERN, KERN_HOSTUUID }; if (sysctl(name, sizeof name / sizeof name[0], &uuid, &uuidlen, nullptr, 0) == 0 && uuidlen == sizeof(uuid)) return QByteArray(uuid, uuidlen - 1); - -# else - // Darwin: no fixed value, we need to search by name - if (sysctlbyname("kern.uuid", uuid, &uuidlen, nullptr, 0) == 0 && uuidlen == sizeof(uuid)) - return QByteArray(uuid, uuidlen - 1); -# endif #elif defined(Q_OS_UNIX) // The modern name on Linux is /etc/machine-id, but that path is // unlikely to exist on non-Linux (non-systemd) systems. The old diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index e82939dcd9..2b271ef5be 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -322,8 +322,10 @@ QLibraryInfo::buildDate() #elif defined(Q_CC_MSVC) # if _MSC_VER < 1910 # define COMPILER_STRING "MSVC 2015" -# elif _MSC_VER < 2000 +# elif _MSC_VER < 1917 # define COMPILER_STRING "MSVC 2017" +# elif _MSC_VER < 2000 +# define COMPILER_STRING "MSVC 2019" # else # define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER) # endif diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp index 1f1ac1fd80..8d4d8ed183 100644 --- a/src/gui/opengl/qopenglprogrambinarycache.cpp +++ b/src/gui/opengl/qopenglprogrambinarycache.cpp @@ -40,6 +40,7 @@ #include "qopenglprogrambinarycache_p.h" #include <QOpenGLContext> #include <QOpenGLExtraFunctions> +#include <QSysInfo> #include <QStandardPaths> #include <QDir> #include <QSaveFile> @@ -102,7 +103,7 @@ static inline bool qt_ensureWritableDir(const QString &name) QOpenGLProgramBinaryCache::QOpenGLProgramBinaryCache() : m_cacheWritable(false) { - const QString subPath = QLatin1String("/qtshadercache/"); + const QString subPath = QLatin1String("/qtshadercache-") + QSysInfo::buildAbi() + QLatin1Char('/'); const QString sharedCachePath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation); if (!sharedCachePath.isEmpty()) { m_cacheDir = sharedCachePath + subPath; diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h index f107b6eb20..3207f1944b 100644 --- a/src/gui/painting/qstroker_p.h +++ b/src/gui/painting/qstroker_p.h @@ -209,7 +209,7 @@ public: QStroker(); ~QStroker(); - void setStrokeWidth(qfixed width) { m_strokeWidth = width; m_curveThreshold = qt_real_to_fixed(width > 4 ? 1.0/width : 0.25); } + void setStrokeWidth(qfixed width) { m_strokeWidth = width; m_curveThreshold = qt_real_to_fixed(qBound(0.025, 1.0/width, 0.25)); } qfixed strokeWidth() const { return m_strokeWidth; } void setCapStyle(Qt::PenCapStyle capStyle) { m_capStyle = joinModeForCap(capStyle); } diff --git a/src/network/access/http2/http2protocol_p.h b/src/network/access/http2/http2protocol_p.h index f7a89859d3..7142d6f1fa 100644 --- a/src/network/access/http2/http2protocol_p.h +++ b/src/network/access/http2/http2protocol_p.h @@ -168,8 +168,10 @@ struct Q_AUTOTEST_EXPORT ProtocolParameters bool indexStrings = true; // This parameter is not negotiated via SETTINGS frames, so we have it - // as a member and will convey it to our peer as a WINDOW_UPDATE frame: - qint32 maxSessionReceiveWindowSize = Http2::maxSessionReceiveWindowSize; + // as a member and will convey it to our peer as a WINDOW_UPDATE frame. + // Note, some servers do not accept our WINDOW_UPDATE from the default + // 64 KB to the possible maximum. Let's use a half of it: + qint32 maxSessionReceiveWindowSize = Http2::maxSessionReceiveWindowSize / 2; // This is our default SETTINGS frame: // diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp index 948b00596f..81bccb1c25 100644 --- a/src/platformsupport/glxconvenience/qglxconvenience.cpp +++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp @@ -261,9 +261,11 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format qCDebug(lcGlx) << "qglx_findConfig: Found non-matching but compatible FBConfig"; return compatibleCandidate; } - qCWarning(lcGlx, "qglx_findConfig: Failed to finding matching FBConfig (%d %d %d %d)", requestedRed, requestedGreen, requestedBlue, requestedAlpha); } while (qglx_reduceFormat(&format)); + if (!config) + qCWarning(lcGlx) << "qglx_findConfig: Failed to finding matching FBConfig for" << format; + return config; } diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index 24526bad2c..101db75d0b 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -876,10 +876,6 @@ QWindowsOpenGLContextFormat QWindowsOpenGLContextFormat::current() result.options |= QSurfaceFormat::DeprecatedFunctions; if (value & GL_CONTEXT_FLAG_DEBUG_BIT) result.options |= QSurfaceFormat::DebugContext; - value = 0; - QOpenGLStaticContext::opengl32.glGetIntegerv(RESET_NOTIFICATION_STRATEGY_ARB, &value); - if (value == LOSE_CONTEXT_ON_RESET_ARB) - result.options |= QSurfaceFormat::ResetNotification; if (result.version < 0x0302) return result; // v3.2 onwards: Profiles @@ -889,6 +885,13 @@ QWindowsOpenGLContextFormat QWindowsOpenGLContextFormat::current() result.profile = QSurfaceFormat::CoreProfile; else if (value & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) result.profile = QSurfaceFormat::CompatibilityProfile; + if (result.version < 0x0400) + return result; + // v4.0 onwards + value = 0; + QOpenGLStaticContext::opengl32.glGetIntegerv(RESET_NOTIFICATION_STRATEGY_ARB, &value); + if (value == LOSE_CONTEXT_ON_RESET_ARB) + result.options |= QSurfaceFormat::ResetNotification; return result; } diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index f26f698e76..5e5fefca90 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -163,10 +163,12 @@ static void updateFormatFromContext(QSurfaceFormat &format) format.setOption(QSurfaceFormat::StereoBuffers); if (format.renderableType() == QSurfaceFormat::OpenGL) { - GLint value = 0; - glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &value); - if (value == GL_LOSE_CONTEXT_ON_RESET_ARB) - format.setOption(QSurfaceFormat::ResetNotification); + if (format.version() >= qMakePair(4, 0)) { + GLint value = 0; + glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &value); + if (value == GL_LOSE_CONTEXT_ON_RESET_ARB) + format.setOption(QSurfaceFormat::ResetNotification); + } if (format.version() < qMakePair(3, 0)) { format.setOption(QSurfaceFormat::DeprecatedFunctions); @@ -175,7 +177,7 @@ static void updateFormatFromContext(QSurfaceFormat &format) // Version 3.0 onwards - check if it includes deprecated functionality or is // a debug context - value = 0; + GLint value = 0; glGetIntegerv(GL_CONTEXT_FLAGS, &value); if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)) format.setOption(QSurfaceFormat::DeprecatedFunctions); diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index e61e450e98..e1518708e8 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -153,7 +153,7 @@ do {\ #define QTRY_IMPL(expr, timeout)\ const int qt_test_step = timeout < 350 ? timeout / 7 + 1 : 50; \ const int qt_test_timeoutValue = timeout; \ - QTRY_LOOP_IMPL((expr), qt_test_timeoutValue, qt_test_step); \ + { QTRY_LOOP_IMPL((expr), qt_test_timeoutValue, qt_test_step); } \ QTRY_TIMEOUT_DEBUG_IMPL((expr), qt_test_timeoutValue, qt_test_step)\ // Will try to wait for the expression to become true while allowing event processing |