Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.6' into 5.7
Browse files Browse the repository at this point in the history
Conflicts:
	src/plugins/platforms/minimalegl/qminimaleglintegration.cpp

Change-Id: Ia6ab42a6daadbf8abc085c971545904d49ea4b56
  • Loading branch information
liangqi committed Oct 31, 2016
2 parents 5545e5a + 694702e commit 8e20daa
Show file tree
Hide file tree
Showing 25 changed files with 115 additions and 65 deletions.
2 changes: 1 addition & 1 deletion doc/global/template/style/offline-simple.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pre {
pre, .LegaleseLeft {
background-color: #f0f0f0;
font-family: Courier, monospace;
font-weight: 600;
Expand Down
8 changes: 6 additions & 2 deletions doc/global/template/style/offline.css
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ table styles

/* table with border alternative colours*/

table, pre {
table, pre, .LegaleseLeft {
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
Expand Down Expand Up @@ -485,6 +485,10 @@ table, pre {
margin: 0px
}

.LegaleseLeft {
font-family: monospace;
white-space: pre-wrap;
}
/* table bodless & white*/

.borderless {
Expand Down Expand Up @@ -547,7 +551,7 @@ ol.a > li{
text-align: left
}

.cpp {
.cpp, .LegaleseLeft {
display: block;
margin: 10px;
overflow: auto;
Expand Down
6 changes: 5 additions & 1 deletion doc/global/template/style/online.css
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ div.qt_commercial {
border-top:5px solid #5caa15;
margin-bottom:50px
}
pre {
pre, .LegaleseLeft {
background-color:#404244;
color:#fff;
display:block;
Expand All @@ -1381,6 +1381,10 @@ pre {
padding:25px;
margin-top:0.75em
}
.mainContent .LegaleseLeft p {
color:#fff;
white-space: pre-wrap
}
.copy_text {
background-color:#46a2da;
color:#fff;
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/doc/src/calculator.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@

\snippet widgets/calculator/calculator.cpp 20

Like in \c additiveOperatorClicked(), we start by handing any
Like in \c additiveOperatorClicked(), we start by handling any
pending multiplicative and additive operators. Then we display \c
sumSoFar and reset the variable to zero. Resetting the variable
to zero is necessary to avoid counting the value twice.
Expand Down
15 changes: 11 additions & 4 deletions qmake/generators/win32/msvc_nmake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,21 @@ void NmakeMakefileGenerator::init()
project->values("QMAKE_DISTCLEAN").append(tgt + ".lib");
}
if (project->isActiveConfig("debug_info")) {
// Add the compiler's PDB file.
QString pdbfile = var("OBJECTS_DIR") + project->first("TARGET") + ".vc.pdb";
QString pdbfile;
QString distPdbFile = tgt + ".pdb";
if (project->isActiveConfig("staticlib")) {
// For static libraries, the compiler's pdb file and the dist pdb file are the same.
pdbfile = distPdbFile;
} else {
// Use $${TARGET}.vc.pdb in the OBJECTS_DIR for the compiler and
// $${TARGET}.pdb (the default) for the linker.
pdbfile = var("OBJECTS_DIR") + project->first("TARGET") + ".vc.pdb";
}
QString escapedPdbFile = escapeFilePath(pdbfile);
project->values("QMAKE_CFLAGS").append("/Fd" + escapedPdbFile);
project->values("QMAKE_CXXFLAGS").append("/Fd" + escapedPdbFile);
project->values("QMAKE_CLEAN").append(pdbfile);
// Add the linker's PDB file to the distclean target.
project->values("QMAKE_DISTCLEAN").append(tgt + ".pdb");
project->values("QMAKE_DISTCLEAN").append(distPdbFile);
}
if (project->isActiveConfig("debug")) {
project->values("QMAKE_CLEAN").append(tgt + ".ilk");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ QSet<QString> dictionary = QtConcurrent::blockingFilteredReduced(strings, allLow
//! [7]
// keep only images with an alpha channel
QList<QImage> images = ...;
QFuture<void> alphaImages = QtConcurrent::filter(strings, &QImage::hasAlphaChannel);
QFuture<void> alphaImages = QtConcurrent::filter(images, &QImage::hasAlphaChannel);

// keep only gray scale images
// retrieve gray scale images
QList<QImage> images = ...;
QFuture<QImage> grayscaleImages = QtConcurrent::filtered(images, &QImage::isGrayscale);

Expand Down
2 changes: 1 addition & 1 deletion src/gui/text/qfontengine_ft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,7 @@ void QFontEngineFT::unlockAlphaMapForGlyph()
static inline bool is2dRotation(const QTransform &t)
{
return qFuzzyCompare(t.m11(), t.m22()) && qFuzzyCompare(t.m12(), -t.m21())
&& qFuzzyCompare(t.m11()*t.m22() - t.m12()*t.m21(), 1.0);
&& qFuzzyCompare(t.m11()*t.m22() - t.m12()*t.m21(), qreal(1.0));
}

QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g,
Expand Down
4 changes: 2 additions & 2 deletions src/network/socket/qabstractsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ bool QAbstractSocketPrivate::writeToSocket()
const char *ptr = writeBuffer.readPointer();

// Attempt to write it all in one chunk.
qint64 written = socketEngine->write(ptr, nextSize);
qint64 written = nextSize ? socketEngine->write(ptr, nextSize) : Q_INT64_C(0);
if (written < 0) {
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug() << "QAbstractSocketPrivate::writeToSocket() write error, aborting."
Expand Down Expand Up @@ -2501,7 +2501,7 @@ qint64 QAbstractSocket::writeData(const char *data, qint64 size)
if (!d->isBuffered && d->socketType == TcpSocket
&& d->socketEngine && d->writeBuffer.isEmpty()) {
// This code is for the new Unbuffered QTcpSocket use case
qint64 written = d->socketEngine->write(data, size);
qint64 written = size ? d->socketEngine->write(data, size) : Q_INT64_C(0);
if (written < 0) {
d->setError(d->socketEngine->error(), d->socketEngine->errorString());
} else if (written < size) {
Expand Down
4 changes: 4 additions & 0 deletions src/network/socket/qnativesocketengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,10 @@ qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 size, const Q
/*!
Writes a block of \a size bytes from \a data to the socket.
Returns the number of bytes written, or -1 if an error occurred.
Passing zero as the \a size parameter on a connected UDP socket
will send an empty datagram. For other socket types results are
unspecified.
*/
qint64 QNativeSocketEngine::write(const char *data, qint64 size)
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ - (id)init

- (void)dealloc
{
[self restoreOriginalContentView];
[mStolenContentView release];
[mColorPanel setDelegate:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ - (id)init

- (void)dealloc
{
[self restoreOriginalContentView];
[mStolenContentView release];
[mFontPanel setDelegate:nil];
[[NSFontManager sharedFontManager] setDelegate:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
#include <QtCore/private/qabstractfileengine_p.h>

Q_FORWARD_DECLARE_OBJC_CLASS(ALAsset);

QT_BEGIN_NAMESPACE

class QIOSAssetData;

class QIOSFileEngineAssetsLibrary : public QAbstractFileEngine
Expand Down Expand Up @@ -78,5 +81,7 @@ class QIOSFileEngineAssetsLibrary : public QAbstractFileEngine
ALAsset *loadAsset() const;
};

QT_END_NAMESPACE

#endif // QIOSFILEENGINEASSETSLIBRARY_H

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#include <QtCore/qset.h>
#include <QtCore/qthreadstorage.h>

QT_BEGIN_NAMESPACE

static QThreadStorage<QString> g_iteratorCurrentUrl;
static QThreadStorage<QPointer<QIOSAssetData> > g_assetDataCache;

Expand Down Expand Up @@ -472,4 +474,6 @@ QFileInfo currentFileInfo() const Q_DECL_OVERRIDE
return 0;
}

QT_END_NAMESPACE

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include <QtCore/private/qabstractfileengine_p.h>
#include "qiosfileengineassetslibrary.h"

QT_BEGIN_NAMESPACE

class QIOSFileEngineFactory : public QAbstractFileEngineHandler
{
public:
Expand All @@ -58,4 +60,6 @@ class QIOSFileEngineFactory : public QAbstractFileEngineHandler
}
};

QT_END_NAMESPACE

#endif // QIOSFILEENGINEFACTORY_H
3 changes: 2 additions & 1 deletion src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QScreen>

#include <QtPlatformSupport/private/qt_egl_p.h>
// this is where EGL headers are pulled in, make sure it is last
#include "qminimaleglscreen.h"

QT_BEGIN_NAMESPACE

Expand Down
2 changes: 0 additions & 2 deletions src/plugins/platforms/minimalegl/qminimaleglintegration.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#ifndef QMINIMALEGLINTEGRATION_H
#define QMINIMALEGLINTEGRATION_H

#include "qminimaleglscreen.h"

#include <qpa/qplatformintegration.h>
#include <qpa/qplatformscreen.h>

Expand Down
1 change: 0 additions & 1 deletion src/plugins/platforms/minimalegl/qminimaleglwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#define QMINIMALEGLWINDOW_H

#include "qminimaleglintegration.h"
#include "qminimaleglscreen.h"

#include <qpa/qplatformwindow.h>

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 @@ -102,6 +102,18 @@
"features": [
"disable_desktopgl", "disable_d3d11", "disable_d3d9"
]
},
{
"id": 9,
"description": "Intel 945 crash (QTBUG-40991)",
"vendor_id": "0x8086",
"device_id": [ "0x27A2" ],
"os": {
"type": "win"
},
"features": [
"disable_desktopgl"
]
}
]
}
3 changes: 0 additions & 3 deletions src/widgets/kernel/qwidget_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,6 @@ class Q_WIDGETS_EXPORT QWidgetPrivate : public QObjectPrivate
const QRegion &rgn, const QPoint &offset, int flags,
QPainter *sharedPainter, QWidgetBackingStore *backingStore);


QPainter *beginSharedPainter();
bool endSharedPainter();
#ifndef QT_NO_GRAPHICSVIEW
static QGraphicsProxyWidget * nearestGraphicsProxyWidget(const QWidget *origin);
#endif
Expand Down
10 changes: 8 additions & 2 deletions src/widgets/kernel/qwidgetbackingstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
if (widget != tlw)
offset += widget->mapTo(tlw, QPoint());

QRegion effectiveRegion = region;
#ifndef QT_NO_OPENGL
const bool compositionWasActive = widget->d_func()->renderToTextureComposeActive;
if (!widgetTextures) {
Expand All @@ -125,6 +126,11 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
} else {
widget->d_func()->renderToTextureComposeActive = true;
}
// When changing the composition status, make sure the dirty region covers
// the entire widget. Just having e.g. the shown/hidden render-to-texture
// widget's area marked as dirty is incorrect when changing flush paths.
if (compositionWasActive != widget->d_func()->renderToTextureComposeActive)
effectiveRegion = widget->rect();

// re-test since we may have been forced to this path via the dummy texture list above
if (widgetTextures) {
Expand All @@ -136,12 +142,12 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
const bool translucentBackground = widget->testAttribute(Qt::WA_TranslucentBackground);
// Use the tlw's context, not widget's. The difference is important with native child
// widgets where tlw != widget.
backingStore->handle()->composeAndFlush(widget->windowHandle(), region, offset, widgetTextures,
backingStore->handle()->composeAndFlush(widget->windowHandle(), effectiveRegion, offset, widgetTextures,
tlw->d_func()->shareContext(), translucentBackground);
widget->window()->d_func()->sendComposeStatus(widget->window(), true);
} else
#endif
backingStore->flush(region, widget->windowHandle(), offset);
backingStore->flush(effectiveRegion, widget->windowHandle(), offset);
}

#ifndef QT_NO_PAINT_DEBUG
Expand Down
36 changes: 18 additions & 18 deletions src/widgets/styles/qwindowsxpstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ bool QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData)

bool translucentToplevel = false;
const QPaintDevice *paintDevice = painter->device();
const qreal aditionalDevicePixelRatio = themeData.widget ? themeData.widget->devicePixelRatio() : 1;
const qreal aditionalDevicePixelRatio = themeData.widget ? themeData.widget->devicePixelRatioF() : qreal(1);
if (paintDevice->devType() == QInternal::Widget) {
const QWidget *window = static_cast<const QWidget *>(paintDevice)->window();
translucentToplevel = window->testAttribute(Qt::WA_TranslucentBackground);
Expand Down Expand Up @@ -840,28 +840,28 @@ bool QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData)

const HDC dc = canDrawDirectly ? hdcForWidgetBackingStore(themeData.widget) : HDC(0);
const bool result = dc
? drawBackgroundDirectly(dc, themeData, qRound(aditionalDevicePixelRatio))
: drawBackgroundThruNativeBuffer(themeData, qRound(aditionalDevicePixelRatio));
? drawBackgroundDirectly(dc, themeData, aditionalDevicePixelRatio)
: drawBackgroundThruNativeBuffer(themeData, aditionalDevicePixelRatio);
painter->restore();
return result;
}

static inline QRect scaleRect(const QRect &r, int factor)
static inline QRectF scaleRect(const QRectF &r, qreal factor)
{
return r.isValid() && factor > 1
? QRect(r.topLeft() * factor, r.size() * factor)
? QRectF(r.topLeft() * factor, r.size() * factor)
: r;
}

static QRegion scaleRegion(const QRegion &region, int factor)
static QRegion scaleRegion(const QRegion &region, qreal factor)
{
if (region.isEmpty() || factor == 1)
if (region.isEmpty() || qFuzzyCompare(factor, qreal(1)))
return region;
if (region.rectCount() == 1)
return QRegion(scaleRect(region.boundingRect(), factor));
return QRegion(scaleRect(QRectF(region.boundingRect()), factor).toRect());
QRegion result;
foreach (const QRect &rect, region.rects())
result += QRect(rect.topLeft() * factor, rect.size() * factor);
result += QRectF(QPointF(rect.topLeft()) * factor, QSizeF(rect.size() * factor)).toRect();
return result;
}

Expand All @@ -870,21 +870,20 @@ static QRegion scaleRegion(const QRegion &region, int factor)
Do not use this if you need to perform other transformations on the
resulting data.
*/
bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeData, int additionalDevicePixelRatio)
bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeData, qreal additionalDevicePixelRatio)
{
QPainter *painter = themeData.painter;

QPoint redirectionDelta(int(painter->deviceMatrix().dx()),
int(painter->deviceMatrix().dy()));
QRect area = scaleRect(themeData.rect, additionalDevicePixelRatio).translated(redirectionDelta);
const QPointF redirectionDelta(painter->deviceMatrix().dx(), painter->deviceMatrix().dy());
const QRect area = scaleRect(QRectF(themeData.rect), additionalDevicePixelRatio).translated(redirectionDelta).toRect();

QRegion sysRgn = painter->paintEngine()->systemClip();
if (sysRgn.isEmpty())
sysRgn = area;
else
sysRgn &= area;
if (painter->hasClipping())
sysRgn &= scaleRegion(painter->clipRegion(), additionalDevicePixelRatio).translated(redirectionDelta);
sysRgn &= scaleRegion(painter->clipRegion(), additionalDevicePixelRatio).translated(redirectionDelta.toPoint());
HRGN hrgn = qt_hrgn_from_qregion(sysRgn);
SelectClipRgn(dc, hrgn);

Expand Down Expand Up @@ -956,15 +955,16 @@ bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeDa
engine).
*/
bool QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeData,
int additionalDevicePixelRatio)
qreal additionalDevicePixelRatio)
{
QPainter *painter = themeData.painter;
QRect rect = scaleRect(themeData.rect, additionalDevicePixelRatio);
QRectF rectF = scaleRect(QRectF(themeData.rect), additionalDevicePixelRatio);

if ((themeData.rotate + 90) % 180 == 0) { // Catch 90,270,etc.. degree flips.
rect = QRect(0, 0, rect.height(), rect.width());
rectF = QRectF(0, 0, rectF.height(), rectF.width());
}
rect.moveTo(0,0);
rectF.moveTo(0, 0);
QRect rect = rectF.toRect();
int partId = themeData.partId;
int stateId = themeData.stateId;
int w = rect.width();
Expand Down
Loading

0 comments on commit 8e20daa

Please sign in to comment.