diff options
author | Liang Qi <liang.qi@qt.io> | 2016-06-23 07:18:39 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-06-23 10:29:37 +0200 |
commit | 5cfb80a28ef6bf6820c970a6c355e6879021e46e (patch) | |
tree | e60f1f43e9670e82923e3c2d0d19b29198b9c300 /src | |
parent | 930e750b7aca024b839c9856cfcc79aab8c0abbc (diff) | |
parent | f4be16e1f7828a0f6992ef2e20b9106177d7fc88 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
src/angle/src/libGLESv2/libGLESv2.pro
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
Change-Id: If8da4cfe8f57fea9f78e7239f378a6302c01674e
Diffstat (limited to 'src')
-rw-r--r-- | src/angle/src/common/common.pri | 12 | ||||
-rw-r--r-- | src/angle/src/compiler/preprocessor/preprocessor.pro | 1 | ||||
-rw-r--r-- | src/angle/src/compiler/translator.pro | 1 | ||||
-rw-r--r-- | src/angle/src/libEGL/libEGL.pro | 1 | ||||
-rw-r--r-- | src/angle/src/libGLESv2/libGLESv2.pro | 2 | ||||
-rw-r--r-- | src/corelib/corelib.pro | 5 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 2 | ||||
-rw-r--r-- | src/gui/opengl/qopenglframebufferobject.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qblendfunctions_p.h | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols_p.h | 4 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qioscontext.mm | 6 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 21 | ||||
-rw-r--r-- | src/widgets/kernel/qdesktopwidget.cpp | 20 | ||||
-rw-r--r-- | src/widgets/widgets/qdockwidget.cpp | 2 |
15 files changed, 36 insertions, 48 deletions
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri index 50dde6398b..83cd1e8687 100644 --- a/src/angle/src/common/common.pri +++ b/src/angle/src/common/common.pri @@ -1,3 +1,9 @@ +# static builds should still link ANGLE dynamically when dynamic GL is enabled +static:contains(QT_CONFIG, dynamicgl) { + CONFIG -= static + CONFIG += shared +} + CONFIG += installed include (../config.pri) @@ -48,10 +54,4 @@ winrt|if(msvc:!win32-msvc2005:!win32-msvc2008:!win32-msvc2010) { } } -# static builds should still link ANGLE dynamically when dynamic GL is enabled -static:contains(QT_CONFIG, dynamicgl) { - CONFIG -= static - CONFIG += shared -} - static: DEFINES *= LIBGLESV2_EXPORT_H_ ANGLE_EXPORT= diff --git a/src/angle/src/compiler/preprocessor/preprocessor.pro b/src/angle/src/compiler/preprocessor/preprocessor.pro index 12f644870d..cbf411623d 100644 --- a/src/angle/src/compiler/preprocessor/preprocessor.pro +++ b/src/angle/src/compiler/preprocessor/preprocessor.pro @@ -1,4 +1,5 @@ CONFIG += static +contains(QT_CONFIG, dynamicgl): CONFIG += not_installed include(../../config.pri) INCLUDEPATH = $$ANGLE_DIR/src/compiler/preprocessor diff --git a/src/angle/src/compiler/translator.pro b/src/angle/src/compiler/translator.pro index 928fd589fb..d48ac70472 100644 --- a/src/angle/src/compiler/translator.pro +++ b/src/angle/src/compiler/translator.pro @@ -1,4 +1,5 @@ CONFIG += static +contains(QT_CONFIG, dynamicgl): CONFIG += not_installed include(../config.pri) INCLUDEPATH += \ diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro index 695f7fd50c..860b60735e 100644 --- a/src/angle/src/libEGL/libEGL.pro +++ b/src/angle/src/libEGL/libEGL.pro @@ -1,4 +1,3 @@ -CONFIG += installed include(../common/common.pri) DEF_FILE_TARGET=$${TARGET} TARGET=$$qtLibraryTarget($${LIBEGL_NAME}) diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro index 49e69db2e5..b699ae159a 100644 --- a/src/angle/src/libGLESv2/libGLESv2.pro +++ b/src/angle/src/libGLESv2/libGLESv2.pro @@ -1,4 +1,4 @@ -CONFIG += simd installed no_batch +CONFIG += simd no_batch include(../common/common.pri) DEF_FILE_TARGET=$${TARGET} TARGET=$$qtLibraryTarget($${LIBGLESV2_NAME}) diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 42fd5d1a61..2faa97eb17 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -27,8 +27,9 @@ ANDROID_PERMISSIONS = \ android.permission.WRITE_EXTERNAL_STORAGE # QtCore can't be compiled with -Wl,-no-undefined because it uses the "environ" -# variable and on FreeBSD, this variable is in the final executable itself -freebsd: QMAKE_LFLAGS_NOUNDEF = +# variable and on FreeBSD and OpenBSD, this variable is in the final executable itself. +# OpenBSD 6.0 will include environ in libc. +freebsd|openbsd: QMAKE_LFLAGS_NOUNDEF = load(qfeatures) diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index ff04116705..f7e57461e3 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -318,7 +318,7 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib) } if (!ret && lib) - lib->errorString = QLibrary::tr("Plugin verification data mismatch in '%1'").arg(library); + lib->errorString = QLibrary::tr("Failed to extract plugin meta data from '%1'").arg(library); file.close(); return ret; } diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 6750925853..b539bef5db 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4141,8 +4141,6 @@ QDateTime QDateTime::currentDateTimeUtc() qint64 QDateTime::currentMSecsSinceEpoch() Q_DECL_NOTHROW { - QDate d; - QTime t; SYSTEMTIME st; memset(&st, 0, sizeof(SYSTEMTIME)); GetSystemTime(&st); diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index aa0520f695..c5818e9373 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1294,7 +1294,8 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ (qstrcmp(renderer, "Mali-T760") == 0 && ::strstr(ver, "3.1") != 0) || (qstrcmp(renderer, "Mali-T720") == 0 - && ::strstr(ver, "3.1") != 0); + && ::strstr(ver, "3.1") != 0) || + qstrcmp(renderer, "PowerVR SGX 554") == 0; const bool supports_bgra = has_bgra_ext && !blackListed; diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h index 00036f9994..d21765bcde 100644 --- a/src/gui/painting/qblendfunctions_p.h +++ b/src/gui/painting/qblendfunctions_p.h @@ -140,7 +140,7 @@ void qt_scale_image_16bit(uchar *destPixels, int dbpl, if (yend < 0 || yend >= srch) --h; int xend = (basex + ix * (w - 1)) >> 16; - if (xend < 0 || xend >= (int)(sbpl/sizeof(quint32))) + if (xend < 0 || xend >= (int)(sbpl/sizeof(SRC))) --w; while (h--) { diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h index 36e041b6cb..df17fd8a9c 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h @@ -373,10 +373,10 @@ int q_SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPT int q_SSL_set_ex_data(SSL *ssl, int idx, void *arg); void *q_SSL_get_ex_data(const SSL *ssl, int idx); #endif -#ifndef OPENSSL_NO_PSK +#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK) typedef unsigned int (*q_psk_client_callback_t)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len); void q_SSL_set_psk_client_callback(SSL *ssl, q_psk_client_callback_t callback); -#endif // OPENSSL_NO_PSK +#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK) #if OPENSSL_VERSION_NUMBER >= 0x10000000L #ifndef OPENSSL_NO_SSL2 const SSL_METHOD *q_SSLv2_client_method(); diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index d18e317bfb..50374dc951 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -217,8 +217,12 @@ void QIOSContext::swapBuffers(QPlatformSurface *surface) if (surface->surface()->surfaceClass() == QSurface::Offscreen) return; // Nothing to do + // When using threaded rendering, the render-thread may not have picked up + // yet on the fact that a window is no longer exposed, and will try to swap + // a non-exposed window. This may in some cases result in crashes, e.g. when + // iOS is suspending an application, so we have an extra guard here. if (!static_cast<QIOSWindow *>(surface)->isExposed()) { - qCWarning(lcQpaGLContext, "Detected swapBuffers on a non-exposed window, skipping flush"); + qCDebug(lcQpaGLContext, "Detected swapBuffers on a non-exposed window, skipping flush"); return; } diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index fb2fd2b946..ddf856d7a4 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -223,26 +223,7 @@ void QIOSWindow::applyGeometry(const QRect &rect) bool QIOSWindow::isExposed() const { - // Note: At startup of an iOS app it will enter UIApplicationStateInactive - // while showing the launch screen, and once the application returns from - // applicationDidFinishLaunching it will hide the launch screen and enter - // UIApplicationStateActive. Technically, a window is not exposed until - // it's actually visible on screen, and Apple also documents that "Apps - // that use OpenGL ES for drawing must not use didFinishLaunching to - // prepare their drawing environment. Instead, defer any OpenGL ES - // drawing calls to applicationDidBecomeActive". Unfortunately, if we - // wait until the applicationState reaches ApplicationActive to signal - // that the window is exposed, we get a lag between hiding the launch - // screen and blitting the first pixels of the application, as Qt - // spends some time drawing those pixels in response to the expose. - // In practice there doesn't seem to be any issues starting GL setup - // and drawing from within applicationDidFinishLaunching, and this is - // also the recommended approach for other 3rd party GL toolkits on iOS, - // so we 'cheat', and report that a window is exposed even if the app - // is in UIApplicationStateInactive, so that the startup transition - // between the launch screen and the application content is smooth. - - return qApp->applicationState() > Qt::ApplicationHidden + return qApp->applicationState() >= Qt::ApplicationActive && window()->isVisible() && !window()->geometry().isEmpty(); } diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp index ece673337a..eee818b685 100644 --- a/src/widgets/kernel/qdesktopwidget.cpp +++ b/src/widgets/kernel/qdesktopwidget.cpp @@ -44,6 +44,9 @@ #include "qwidget_p.h" #include "qwindow.h" +#include <private/qhighdpiscaling_p.h> +#include <qpa/qplatformscreen.h> + QT_BEGIN_NAMESPACE QDesktopScreenWidget::QDesktopScreenWidget(QScreen *screen, const QRect &geometry) @@ -245,18 +248,18 @@ int QDesktopWidget::screenNumber(const QWidget *w) const if (screens.isEmpty()) // This should never happen return primaryScreen(); + const QWindow *winHandle = w->windowHandle(); + if (!winHandle) { + if (const QWidget *nativeParent = w->nativeParentWidget()) + winHandle = nativeParent->windowHandle(); + } + // If there is more than one virtual desktop if (screens.count() != screens.constFirst()->virtualSiblings().count()) { // Find the root widget, get a QScreen from it and use the // virtual siblings for checking the window position. - const QWidget *root = w; - const QWidget *tmp = w; - while ((tmp = tmp->parentWidget())) - root = tmp; - const QWindow *winHandle = root->windowHandle(); if (winHandle) { - const QScreen *winScreen = winHandle->screen(); - if (winScreen) + if (const QScreen *winScreen = winHandle->screen()) screens = winScreen->virtualSiblings(); } } @@ -266,11 +269,12 @@ int QDesktopWidget::screenNumber(const QWidget *w) const QRect frame = w->frameGeometry(); if (!w->isWindow()) frame.moveTopLeft(w->mapToGlobal(QPoint(0, 0))); + const QRect nativeFrame = QHighDpi::toNativePixels(frame, winHandle); QScreen *widgetScreen = Q_NULLPTR; int largestArea = 0; foreach (QScreen *screen, screens) { - QRect intersected = screen->geometry().intersected(frame); + const QRect intersected = screen->handle()->geometry().intersected(nativeFrame); int area = intersected.width() * intersected.height(); if (largestArea < area) { widgetScreen = screen; diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 293a04ef88..19444f8315 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1451,8 +1451,6 @@ bool QDockWidget::event(QEvent *event) switch (event->type()) { #ifndef QT_NO_ACTION case QEvent::Hide: - if (d->state && d->state->dragging) - d->endDrag(true); if (layout != 0) layout->keepSize(this); d->toggleViewAction->setChecked(false); |