Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.6.1' into 5.6
Browse files Browse the repository at this point in the history
Conflicts:
	src/network/socket/qnativesocketengine_winrt.cpp

Change-Id: I8edb72f8ba958d80c3d7993b3feaaae782ca8d9c
  • Loading branch information
liangqi committed May 19, 2016
2 parents d16692e + eba979f commit 6404418
Show file tree
Hide file tree
Showing 34 changed files with 200 additions and 46 deletions.
1 change: 0 additions & 1 deletion .qmake.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load(qt_build_config)
CONFIG += qt_example_installs
CONFIG += warning_clean

QT_SOURCE_TREE = $$PWD
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -4039,7 +4039,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
setBootstrapVariable QMAKE_LFLAGS
setBootstrapVariable QMAKE_LFLAGS_GCSECTIONS

if [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
if [ "$CFG_DEBUG" = "no" ] || [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
setBootstrapVariable QMAKE_CFLAGS_RELEASE
setBootstrapVariable QMAKE_CXXFLAGS_RELEASE
EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
Expand Down
6 changes: 5 additions & 1 deletion mkspecs/features/lex.prf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
lex.variable_out = GENERATED_SOURCES
}

isEmpty(QMAKE_LEXFLAGS_MANGLE):QMAKE_LEXFLAGS_MANGLE = -P${QMAKE_FILE_BASE}
QMAKE_LEXEXTRAFLAGS = $$QMAKE_LEXFLAGS
!yacc_no_name_mangle:QMAKE_LEXEXTRAFLAGS += $$QMAKE_LEXFLAGS_MANGLE

contains(QMAKE_LEX, .*flex) {
# GNU flex, we can use -o outfile
lex.commands = $$QMAKE_LEX $$QMAKE_LEXFLAGS --nounistd -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
lex.commands = $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS --nounistd -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
} else {
# stupid POSIX lex, it only generates a file called lex.yy.c
# or lex.prefix.c if the -P<prefix> option is active
Expand Down
1 change: 1 addition & 0 deletions mkspecs/features/qt_build_config.prf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ CONFIG += \
create_prl link_prl \
prepare_docs qt_docs_targets \
no_private_qt_headers_warning QTDIR_build \
qt_example_installs \
# Qt modules get compiled without exceptions enabled by default.
# However, testcases should be still built with exceptions.
exceptions_off testcase_exceptions
Expand Down
14 changes: 14 additions & 0 deletions mkspecs/features/qt_example_installs.prf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
!isEmpty(allfiles): warning("remaining files in $$_PRO_FILE_PWD_: $$allfiles")
}

equals(TEMPLATE, app)|equals(TEMPLATE, lib) {
!contains(INSTALLS, target) {
!install_ok: \
error("$$_PRO_FILE_ is lacking an install target.")
else: check_examples: \
warning("$$_PRO_FILE_ is lacking an install target.")
} else: !equals(target.path, $$sources.path) {
!install_ok: \
error("$$_PRO_FILE_ installs target to unexpected location.")
else: check_examples: \
warning("$$_PRO_FILE_ installs target to unexpected location.")
}
}

!equals(TEMPLATE, subdirs):!compile_examples {
TEMPLATE = aux
CONFIG -= have_target qt staticlib dll
Expand Down
1 change: 1 addition & 0 deletions mkspecs/features/qt_helper_lib.prf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ load(qt_build_paths)

TEMPLATE = lib
CONFIG -= qt
QT = # In case qt is re-added.

CONFIG -= warning_clean # Don't presume 3rd party code to be clean
load(qt_common)
Expand Down
13 changes: 13 additions & 0 deletions src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2370,6 +2370,19 @@ unsigned int Renderer11::getReservedFragmentUniformBuffers() const

bool Renderer11::getShareHandleSupport() const
{
if (mDriverType == D3D_DRIVER_TYPE_WARP)
{
#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
// Warp mode does not support shared handles in Windows versions below Windows 8
OSVERSIONINFO result = { sizeof(OSVERSIONINFO), 0, 0, 0, 0, {'\0'}};
if (GetVersionEx(&result) &&
((result.dwMajorVersion == 6 && result.dwMinorVersion < 2) || result.dwMajorVersion < 6))
{
// WARP on Windows 7 doesn't support shared handles
return false;
}
#endif // ANGLE_ENABLE_WINDOWS_STORE
}
// We only currently support share handles with BGRA surfaces, because
// chrome needs BGRA. Once chrome fixes this, we should always support them.
// PIX doesn't seem to support using share handles, so disable them.
Expand Down
8 changes: 4 additions & 4 deletions src/3rdparty/freetype/freetype.pro
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ win32 {
INCLUDEPATH += $$PWD/include

DEFINES += FT2_BUILD_LIBRARY
contains(QT_CONFIG, system-zlib) {
DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB
include($$PWD/../zlib_dependency.pri)
}

DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB
include(../zlib_dependency.pri)

contains(QT_CONFIG, system-png) {
DEFINES += FT_CONFIG_OPTION_USE_PNG
include($$PWD/../png_dependency.pri)
Expand Down
4 changes: 4 additions & 0 deletions src/3rdparty/zlib_dependency.pri
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ contains(QT_CONFIG, system-zlib) {
}
} else {
INCLUDEPATH += $$PWD/zlib
!no_core_dep {
CONFIG += qt
QT_PRIVATE += core
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From db13a9cf7e41207660f080827983655864df802d Mon Sep 17 00:00:00 2001
From: Oliver Wolff <[email protected]>
Date: Wed, 11 May 2016 13:51:54 +0200
Subject: [PATCH] ANGLE: Disable support for shared handles in warp mode on
Windows < 8

Shared handles are not supported on Windows 7 and below. If the
according flag is set CreateTexture2D will fail with E_OUTOFMEMORY. The
check already happens with newer ANGLE versions, which we use in 5.7
but has to happen here as well. Otherwise Qt applications running on
Windows 7 and below will crash at startup.

Change-Id: I8f539f16dce298611fb1ec7b2f6804d4a04d04e0
---
.../angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
index 223e2b0..dd554f4 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
@@ -2370,6 +2370,19 @@ unsigned int Renderer11::getReservedFragmentUniformBuffers() const

bool Renderer11::getShareHandleSupport() const
{
+ if (mDriverType == D3D_DRIVER_TYPE_WARP)
+ {
+#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
+ // Warp mode does not support shared handles in Windows versions below Windows 8
+ OSVERSIONINFO result = { sizeof(OSVERSIONINFO), 0, 0, 0, 0, {'\0'}};
+ if (GetVersionEx(&result) &&
+ ((result.dwMajorVersion == 6 && result.dwMinorVersion < 2) || result.dwMajorVersion < 6))
+ {
+ // WARP on Windows 7 doesn't support shared handles
+ return false;
+ }
+#endif // ANGLE_ENABLE_WINDOWS_STORE
+ }
// We only currently support share handles with BGRA surfaces, because
// chrome needs BGRA. Once chrome fixes this, we should always support them.
// PIX doesn't seem to support using share handles, so disable them.
--
2.7.0.windows.1

2 changes: 1 addition & 1 deletion src/concurrent/doc/qtconcurrent.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project = QtConcurrent
description = Qt Concurrent Reference Documentation
version = $QT_VERSION

examplesinstallpath = qtbase/qtconcurrent
examplesinstallpath = qtconcurrent

qhp.projects = QtConcurrent

Expand Down
2 changes: 1 addition & 1 deletion src/corelib/doc/qtcore.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project = QtCore
description = Qt Core Reference Documentation
version = $QT_VERSION

examplesinstallpath = qtbase/corelib
examplesinstallpath = corelib

qhp.projects = QtCore

Expand Down
4 changes: 2 additions & 2 deletions src/corelib/itemmodels/qabstractitemmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3653,7 +3653,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
\fn QAbstractItemModel::modelAboutToBeReset()
\since 4.2

This signal is emitted when reset() is called, before the model's internal
This signal is emitted when beginResetModel() is called, before the model's internal
state (e.g. persistent model indexes) has been invalidated.

\sa beginResetModel(), modelReset()
Expand All @@ -3663,7 +3663,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
\fn QAbstractItemModel::modelReset()
\since 4.1

This signal is emitted when reset() or endResetModel() is called, after the
This signal is emitted when endResetModel() is called, after the
model's internal state (e.g. persistent model indexes) has been invalidated.

Note that if a model is reset it should be considered that all information
Expand Down
1 change: 1 addition & 0 deletions src/corelib/tools/tools.pri
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ else:SOURCES += tools/qelapsedtimer_generic.cpp
contains(QT_CONFIG, zlib) {
include($$PWD/../../3rdparty/zlib.pri)
} else {
CONFIG += no_core_dep
include($$PWD/../../3rdparty/zlib_dependency.pri)
}

Expand Down
2 changes: 1 addition & 1 deletion src/dbus/doc/qtdbus.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sourcedirs += .. \
../../../examples/dbus/doc/src
excludedirs += ../../../examples/widgets/doc

examplesinstallpath = qtbase/dbus
examplesinstallpath = dbus

depends += qtdoc qtcore

Expand Down
2 changes: 1 addition & 1 deletion src/gui/doc/qtgui.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project = QtGui
description = Qt GUI Reference Documentation
version = $QT_VERSION

examplesinstallpath = qtbase/gui
examplesinstallpath = gui

qhp.projects = QtGui

Expand Down
4 changes: 2 additions & 2 deletions src/gui/painting/qpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6268,7 +6268,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
pen.setColor(uc);

// Adapt wave to underlineOffset or pen width, whatever is larger, to make it work on all platforms
const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / 2.), pen);
const QPixmap wave = generateWavyPixmap(qMin(qMax(underlineOffset, pen.widthF()), maxHeight / qreal(2.)), pen);
const int descent = qFloor(maxHeight);

painter->setBrushOrigin(painter->brushOrigin().x(), 0);
Expand All @@ -6279,7 +6279,7 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
// the text above it, but limit it to stay within descent.
qreal adjustedUnderlineOffset = std::ceil(underlineOffset) + 0.5;
if (underlineOffset <= fe->descent().toReal())
adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - 0.5);
adjustedUnderlineOffset = qMin(adjustedUnderlineOffset, fe->descent().toReal() - qreal(0.5));
const qreal underlinePos = pos.y() + adjustedUnderlineOffset;
QColor uc = charFormat.underlineColor();
if (uc.isValid())
Expand Down
2 changes: 1 addition & 1 deletion src/network/doc/qtnetwork.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project = QtNetwork
description = Qt Network Reference Documentation
version = $QT_VERSION

examplesinstallpath = qtbase/network
examplesinstallpath = network

qhp.projects = QtNetwork

Expand Down
30 changes: 16 additions & 14 deletions src/network/socket/qnativesocketengine_winrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,22 +458,24 @@ void QNativeSocketEngine::close()
}

#if _MSC_VER >= 1900
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
HRESULT hr;
// To close the connection properly (not with a hard reset) all pending read operation have to
// be finished or cancelled. The API isn't available on Windows 8.1 though.
ComPtr<IStreamSocket3> socket3;
hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3));
Q_ASSERT_SUCCEEDED(hr);
if (d->socketType == QAbstractSocket::TcpSocket) {
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
HRESULT hr;
// To close the connection properly (not with a hard reset) all pending read operation have to
// be finished or cancelled. The API isn't available on Windows 8.1 though.
ComPtr<IStreamSocket3> socket3;
hr = d->tcpSocket()->QueryInterface(IID_PPV_ARGS(&socket3));
Q_ASSERT_SUCCEEDED(hr);

ComPtr<IAsyncAction> action;
hr = socket3->CancelIOAsync(&action);
Q_ASSERT_SUCCEEDED(hr);
hr = QWinRTFunctions::await(action);
ComPtr<IAsyncAction> action;
hr = socket3->CancelIOAsync(&action);
Q_ASSERT_SUCCEEDED(hr);
hr = QWinRTFunctions::await(action);
Q_ASSERT_SUCCEEDED(hr);
return S_OK;
});
Q_ASSERT_SUCCEEDED(hr);
return S_OK;
});
Q_ASSERT_SUCCEEDED(hr);
}
#endif // _MSC_VER >= 1900

if (d->readOp) {
Expand Down
2 changes: 1 addition & 1 deletion src/opengl/doc/qtopengl.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ imagedirs += images \

depends += qtdoc qtcore qtgui qtwidgets qmake

examplesinstallpath = qtbase/opengl
examplesinstallpath = opengl

# The following parameters are for creating a qhp file, the qhelpgenerator
# program can convert the qhp file into a qch file which can be opened in
Expand Down
2 changes: 1 addition & 1 deletion src/platformheaders/doc/qtplatformheaders.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project = QtPlatformHeaders
description = Qt Platform Headers Reference Documentation
version = $QT_VERSION

examplesinstallpath = qtbase/qtplatformheaders
examplesinstallpath = qtplatformheaders

qhp.projects = QtPlatformHeaders

Expand Down
10 changes: 5 additions & 5 deletions src/plugins/imageformats/ico/qicohandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
typedef struct
{
quint8 bWidth; // Width of the image
quint8 bHeight; // Height of the image (times 2)
quint8 bHeight; // Height of the image (actual height, not times 2)
quint8 bColorCount; // Number of colors in image (0 if >=8bpp) [ not ture ]
quint8 bReserved; // Reserved
quint16 wPlanes; // Color Planes
Expand Down Expand Up @@ -681,8 +681,8 @@ bool ICOReader::write(QIODevice *device, const QVector<QImage> &images)
entries[i].bColorCount = 0;
entries[i].bReserved = 0;
entries[i].wBitCount = nbits;
entries[i].bHeight = image.height();
entries[i].bWidth = image.width();
entries[i].bHeight = image.height() < 256 ? image.height() : 0; // 0 means 256
entries[i].bWidth = image.width() < 256 ? image.width() : 0; // 0 means 256
entries[i].dwBytesInRes = BMP_INFOHDR_SIZE + (bpl_bmp * image.height())
+ (maskImage.bytesPerLine() * maskImage.height());
entries[i].wPlanes = 1;
Expand All @@ -696,11 +696,11 @@ bool ICOReader::write(QIODevice *device, const QVector<QImage> &images)
bmpHeaders[i].biClrImportant = 0;
bmpHeaders[i].biClrUsed = entries[i].bColorCount;
bmpHeaders[i].biCompression = 0;
bmpHeaders[i].biHeight = entries[i].bHeight * 2; // 2 is for the mask
bmpHeaders[i].biHeight = entries[i].bHeight ? entries[i].bHeight * 2 : 256 * 2; // 2 is for the mask
bmpHeaders[i].biPlanes = entries[i].wPlanes;
bmpHeaders[i].biSize = BMP_INFOHDR_SIZE;
bmpHeaders[i].biSizeImage = entries[i].dwBytesInRes - BMP_INFOHDR_SIZE;
bmpHeaders[i].biWidth = entries[i].bWidth;
bmpHeaders[i].biWidth = entries[i].bWidth ? entries[i].bWidth : 256;
bmpHeaders[i].biXPelsPerMeter = 0;
bmpHeaders[i].biYPelsPerMeter = 0;

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/platforms/cocoa/qcocoamenuitem.mm
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ NSUInteger keySequenceModifierMask(const QKeySequence &accel)
if (m_merged) {
[m_native setHidden:YES];
} else {
if (m_menu && m_menu->attachedItem() == m_native)
m_menu->setAttachedItem(nil);
[m_native release];
}

Expand Down
12 changes: 12 additions & 0 deletions src/plugins/platforms/windows/openglblacklists/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@
"features": [
"disable_angle"
]
},
{
"id": 8,
"description": "Standard VGA: Insufficent support for OpenGL, D3D9 and D3D11",
"vendor_id": "0x0000",
"device_id": ["0x0000"],
"os": {
"type": "win"
},
"features": [
"disable_desktopgl", "disable_d3d11", "disable_d3d9"
]
}
]
}
2 changes: 1 addition & 1 deletion src/printsupport/doc/qtprintsupport.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project = QtPrintSupport
description = Qt Print Support Reference Documentation
version = $QT_VERSION

examplesinstallpath = qtbase/printsupport
examplesinstallpath = printsupport

qhp.projects = QtPrintSupport

Expand Down
2 changes: 1 addition & 1 deletion src/sql/doc/qtsql.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project = QtSql
description = Qt SQL Reference Documentation
version = $QT_VERSION

examplesinstallpath = qtbase/sql
examplesinstallpath = sql

qhp.projects = QtSql

Expand Down
7 changes: 6 additions & 1 deletion src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ src_plugins.depends = src_sql src_xml src_network
src_android.subdir = $$PWD/android

# this order is important
contains(QT_CONFIG, zlib)|cross_compile: SUBDIRS += src_qtzlib
contains(QT_CONFIG, zlib)|cross_compile {
SUBDIRS += src_qtzlib
contains(QT_CONFIG, zlib) {
src_3rdparty_freetype.depends += src_corelib
}
}
SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc
!contains(QT_DISABLED_FEATURES, regularexpression):pcre {
SUBDIRS += src_3rdparty_pcre
Expand Down
Loading

0 comments on commit 6404418

Please sign in to comment.