summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-30 01:00:58 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-30 01:00:58 +0100
commit4c89005ebed79bb6ba871c407e6b8c2f8d982abf (patch)
treeec03d80933a2a3d60b129344c244d19fec24fb5b
parent3de89e57c9640ef9d476130abc4cca9120d3ef8c (diff)
parent4e9e9c2c17afa472fb8ae04fc36d9605863f8b83 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
-rw-r--r--src/corelib/global/qcompilerdetection.h1
-rw-r--r--src/corelib/kernel/qmetatype.h3
-rw-r--r--src/corelib/thread/qbasicatomic.h6
-rw-r--r--src/gui/image/qimage_conversions.cpp28
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp22
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp20
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfscontext.cpp2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow.cpp3
-rw-r--r--src/plugins/platforms/vnc/qvncclient.cpp1
-rw-r--r--tests/auto/gui/text/qfontdatabase/testdata.qrc1
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp29
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp15
-rw-r--r--tests/auto/other/lancelot/scripts/filltest.qps26
-rw-r--r--tests/auto/other/lancelot/scripts/perspectives2.qps14
-rw-r--r--tests/auto/shared/resources/testfont_open.otfbin0 -> 62676 bytes
-rw-r--r--tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp20
16 files changed, 101 insertions, 90 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index ad3d2be69b..7cfbe1273f 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -358,7 +358,6 @@
# define Q_COMPILER_ATTRIBUTES
# define Q_COMPILER_AUTO_FUNCTION
# define Q_COMPILER_CLASS_ENUM
-# define Q_COMPILER_CONSTEXPR
# define Q_COMPILER_DECLTYPE
# define Q_COMPILER_DEFAULT_MEMBERS
# define Q_COMPILER_DELETE_MEMBERS
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index caa158841c..af1b0faf38 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -1215,9 +1215,12 @@ public:
{ IteratorOwner<typename T::const_iterator>::assign(iterator,
static_cast<const T*>(container)->find(*static_cast<const typename T::key_type*>(p))); }
+ QT_WARNING_PUSH
+ QT_WARNING_DISABLE_DEPRECATED // Hits on the deprecated QHash::iterator::operator--()
template<class T>
static void advanceImpl(void **p, int step)
{ std::advance(*static_cast<typename T::const_iterator*>(*p), step); }
+ QT_WARNING_POP
template<class T>
static void beginImpl(const void *container, void **iterator)
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 9804e60119..c9c95cf6ce 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -47,9 +47,9 @@
# include <QtCore/qatomic_bootstrap.h>
// If C++11 atomics are supported, use them!
-// Note that constexpr support is sometimes disabled in QNX builds but its
-// library has <atomic>.
-#elif defined(Q_COMPILER_ATOMICS) && (defined(Q_COMPILER_CONSTEXPR) || defined(Q_OS_QNX))
+// Note that constexpr support is sometimes disabled in QNX or INTEGRITY builds,
+// but their libraries have <atomic>.
+#elif defined(Q_COMPILER_ATOMICS) && (defined(Q_COMPILER_CONSTEXPR) || defined(Q_OS_QNX) || defined(Q_OS_INTEGRITY))
# include <QtCore/qatomic_cxx11.h>
// We only support one fallback: MSVC, because even on version 2015, it lacks full constexpr support
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp
index 7cd71644a3..8f33a13b95 100644
--- a/src/gui/image/qimage_conversions.cpp
+++ b/src/gui/image/qimage_conversions.cpp
@@ -851,30 +851,6 @@ static bool convert_A2RGB30_PM_to_ARGB_inplace(QImageData *data, Qt::ImageConver
return true;
}
-static void convert_ARGB_PM_to_ARGB(QImageData *dest, const QImageData *src)
-{
- Q_ASSERT(src->format == QImage::Format_ARGB32_Premultiplied || src->format == QImage::Format_RGBA8888_Premultiplied);
- Q_ASSERT(dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_RGBA8888);
- Q_ASSERT(src->width == dest->width);
- Q_ASSERT(src->height == dest->height);
-
- const int src_pad = (src->bytes_per_line >> 2) - src->width;
- const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;
- const QRgb *src_data = (QRgb *) src->data;
- QRgb *dest_data = (QRgb *) dest->data;
-
- for (int i = 0; i < src->height; ++i) {
- const QRgb *end = src_data + src->width;
- while (src_data < end) {
- *dest_data = qUnpremultiply(*src_data);
- ++src_data;
- ++dest_data;
- }
- src_data += src_pad;
- dest_data += dest_pad;
- }
-}
-
static void convert_RGBA_to_RGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
{
Q_ASSERT(src->format == QImage::Format_RGBA8888 || src->format == QImage::Format_RGBX8888);
@@ -1541,7 +1517,7 @@ static void convert_X_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageC
static void convert_ARGB_PM_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)
{
QScopedPointer<QImageData> tmp(QImageData::create(QSize(src->width, src->height), QImage::Format_ARGB32));
- convert_ARGB_PM_to_ARGB(tmp.data(), src);
+ convert_generic(tmp.data(), src, Qt::AutoColor);
dither_to_Mono(dst, tmp.data(), flags, false);
}
@@ -1821,7 +1797,7 @@ static void convert_RGB_to_Indexed8(QImageData *dst, const QImageData *src, Qt::
static void convert_ARGB_PM_to_Indexed8(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)
{
QScopedPointer<QImageData> tmp(QImageData::create(QSize(src->width, src->height), QImage::Format_ARGB32));
- convert_ARGB_PM_to_ARGB(tmp.data(), src);
+ convert_generic(tmp.data(), src, Qt::AutoColor);
convert_RGB_to_Indexed8(dst, tmp.data(), flags);
}
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
index 011476cf13..36a94724c1 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
@@ -1069,18 +1069,16 @@ static bool addFontToDatabase(QString familyName,
QString subFamilyName;
QString subFamilyStyle;
- if (ttf) {
- // Look-up names registered in the font
- QFontNames canonicalNames = qt_getCanonicalFontNames(logFont);
- if (qt_localizedName(familyName) && !canonicalNames.name.isEmpty())
- englishName = canonicalNames.name;
- if (!canonicalNames.preferredName.isEmpty()) {
- subFamilyName = familyName;
- subFamilyStyle = styleName;
- faceName = familyName; // Remember the original name for later lookups
- familyName = canonicalNames.preferredName;
- styleName = canonicalNames.preferredStyle;
- }
+ // Look-up names registered in the font
+ QFontNames canonicalNames = qt_getCanonicalFontNames(logFont);
+ if (qt_localizedName(familyName) && !canonicalNames.name.isEmpty())
+ englishName = canonicalNames.name;
+ if (!canonicalNames.preferredName.isEmpty()) {
+ subFamilyName = familyName;
+ subFamilyStyle = styleName;
+ faceName = familyName; // Remember the original name for later lookups
+ familyName = canonicalNames.preferredName;
+ styleName = canonicalNames.preferredStyle;
}
QSupportedWritingSystems writingSystems;
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
index a6b7fcf31e..5c2742d295 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
@@ -215,17 +215,15 @@ static bool addFontToDatabase(QString familyName,
QString subFamilyName;
QString subFamilyStyle;
- if (ttf) {
- // Look-up names registered in the font
- QFontNames canonicalNames = qt_getCanonicalFontNames(logFont);
- if (qt_localizedName(familyName) && !canonicalNames.name.isEmpty())
- englishName = canonicalNames.name;
- if (!canonicalNames.preferredName.isEmpty()) {
- subFamilyName = familyName;
- subFamilyStyle = styleName;
- familyName = canonicalNames.preferredName;
- styleName = canonicalNames.preferredStyle;
- }
+ // Look-up names registered in the font
+ QFontNames canonicalNames = qt_getCanonicalFontNames(logFont);
+ if (qt_localizedName(familyName) && !canonicalNames.name.isEmpty())
+ englishName = canonicalNames.name;
+ if (!canonicalNames.preferredName.isEmpty()) {
+ subFamilyName = familyName;
+ subFamilyStyle = styleName;
+ familyName = canonicalNames.preferredName;
+ styleName = canonicalNames.preferredStyle;
}
QSupportedWritingSystems writingSystems;
diff --git a/src/plugins/platforms/eglfs/api/qeglfscontext.cpp b/src/plugins/platforms/eglfs/api/qeglfscontext.cpp
index c5cef34d8e..c10b6facbb 100644
--- a/src/plugins/platforms/eglfs/api/qeglfscontext.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfscontext.cpp
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
QEglFSContext::QEglFSContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display,
EGLConfig *config, const QVariant &nativeHandle)
: QEGLPlatformContext(format, share, display, config, nativeHandle,
- qt_egl_device_integration()->supportsSurfacelessContexts() ? Flags(0) : QEGLPlatformContext::NoSurfaceless),
+ qt_egl_device_integration()->supportsSurfacelessContexts() ? Flags() : QEGLPlatformContext::NoSurfaceless),
m_tempWindow(0)
{
}
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
index e6b25c02fd..3457be116a 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
@@ -66,8 +66,7 @@ QEglFSWindow::QEglFSWindow(QWindow *w)
#endif
m_winId(0),
m_surface(EGL_NO_SURFACE),
- m_window(0),
- m_flags(0)
+ m_window(0)
{
}
diff --git a/src/plugins/platforms/vnc/qvncclient.cpp b/src/plugins/platforms/vnc/qvncclient.cpp
index 3a373a5e4b..2450f7dad5 100644
--- a/src/plugins/platforms/vnc/qvncclient.cpp
+++ b/src/plugins/platforms/vnc/qvncclient.cpp
@@ -65,7 +65,6 @@ QVncClient::QVncClient(QTcpSocket *clientSocket, QVncServer *server)
, m_cutTextPending(0)
, m_supportHextile(false)
, m_wantUpdate(false)
- , m_keymod(0)
, m_dirtyCursor(false)
, m_updatePending(false)
, m_protocolVersion(V3_3)
diff --git a/tests/auto/gui/text/qfontdatabase/testdata.qrc b/tests/auto/gui/text/qfontdatabase/testdata.qrc
index 224e845601..a590099b20 100644
--- a/tests/auto/gui/text/qfontdatabase/testdata.qrc
+++ b/tests/auto/gui/text/qfontdatabase/testdata.qrc
@@ -4,5 +4,6 @@
<file alias="testfont.ttf">../../../shared/resources/testfont.ttf</file>
<file alias="testfont_condensed.ttf">../../../shared/resources/testfont_condensed.ttf</file>
<file alias="testfont_italic.ttf">../../../shared/resources/testfont_italic.ttf</file>
+ <file alias="testfont_open.otf">../../../shared/resources/testfont_open.otf</file>
</qresource>
</RCC>
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
index 2b69801b59..12e8083622 100644
--- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
@@ -76,6 +76,9 @@ private slots:
void rasterFonts();
void smoothFonts();
+ void registerOpenTypePreferredNamesSystem();
+ void registerOpenTypePreferredNamesApplication();
+
private:
QString m_ledFont;
QString m_testFont;
@@ -440,5 +443,31 @@ void tst_QFontDatabase::smoothFonts()
QVERIFY(!QFontDatabase().isBitmapScalable(font.family()));
}
+void tst_QFontDatabase::registerOpenTypePreferredNamesSystem()
+{
+ QFontDatabase db;
+ // This font family was picked because it was the only one I had installed which showcased the
+ // problem
+ if (!db.hasFamily(QString::fromLatin1("Source Code Pro ExtraLight")))
+ QSKIP("Source Code Pro ExtraLight is not installed");
+
+ QStringList styles = db.styles(QString::fromLatin1("Source Code Pro"));
+ QVERIFY(styles.contains(QLatin1String("ExtraLight")));
+}
+
+void tst_QFontDatabase::registerOpenTypePreferredNamesApplication()
+{
+ QFontDatabase db;
+
+ int id = QFontDatabase::addApplicationFont(QString::fromLatin1(":/testfont_open.otf"));
+ if (id == -1)
+ QSKIP("Skip the test since app fonts are not supported on this system");
+
+ QStringList styles = db.styles(QString::fromLatin1("QtBidiTestFont"));
+ QVERIFY(styles.contains(QLatin1String("Open")));
+
+ QFontDatabase::removeApplicationFont(id);
+}
+
QTEST_MAIN(tst_QFontDatabase)
#include "tst_qfontdatabase.moc"
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 215a4c2a29..7430c93a8e 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -230,9 +230,9 @@ void PaintCommands::staticInit()
"begin_block <blockName>",
"begin_block blockName");
DECL_PAINTCOMMAND("end_block", command_end_block,
- "^end_block$",
- "end_block",
- "end_block");
+ "^end_block\\s*(\\w*)$",
+ "end_block [blockName]",
+ "end_block blockName");
DECL_PAINTCOMMAND("repeat_block", command_repeat_block,
"^repeat_block\\s+(\\w*)$",
"repeat_block <blockName>",
@@ -744,6 +744,13 @@ void PaintCommands::runCommands()
if (height <= 0)
height = 800;
+ m_pathMap.clear();
+ m_imageMap.clear();
+ m_pixmapMap.clear();
+ m_regionMap.clear();
+ m_gradientStops.clear();
+ m_blockMap.clear();
+
// paint background
if (m_checkers_background) {
QPixmap pm(20, 20);
@@ -901,6 +908,8 @@ void PaintCommands::command_begin_block(QRegularExpressionMatch re)
const QString &blockName = re.captured(1);
if (m_verboseMode)
printf(" -(lance) begin_block (%s)\n", qPrintable(blockName));
+ if (m_blockMap.contains(blockName))
+ qFatal("Two blocks named (%s)", qPrintable(blockName));
m_commands[m_currentCommandIndex] = QLatin1String("# begin block (") + blockName + QLatin1Char(')');
QStringList newBlock;
diff --git a/tests/auto/other/lancelot/scripts/filltest.qps b/tests/auto/other/lancelot/scripts/filltest.qps
index 2eeba2ecf6..112ffc85be 100644
--- a/tests/auto/other/lancelot/scripts/filltest.qps
+++ b/tests/auto/other/lancelot/scripts/filltest.qps
@@ -133,7 +133,7 @@ setPen nopen
translate 50 0
-begin_block rects
+begin_block rects2
drawPath rect
drawRect 0 20 10 10
drawImage img 0 40
@@ -154,59 +154,59 @@ translate 10 20
rotate 90
drawRect 0 0 10 10
restore
-end_block rects
+end_block rects2
setPen red
drawText -5 -10 "0.0"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "0.1"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "0.2"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "0.3"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "0.4"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "0.5"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "0.6"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "0.7"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "0.8"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "0.9"
setPen nopen
translate 40 0.1
-repeat_block rects
+repeat_block rects2
setPen red
drawText -5 -10 "1.0"
setPen nopen
@@ -410,4 +410,4 @@ drawText 0 0 "outline/fill consistency"
setPen red
setBrush green
translate 80 -30
-drawPolygon [13.6965 -99.1837 -71.4767 13.823 32.4596 -33.1847] \ No newline at end of file
+drawPolygon [13.6965 -99.1837 -71.4767 13.823 32.4596 -33.1847]
diff --git a/tests/auto/other/lancelot/scripts/perspectives2.qps b/tests/auto/other/lancelot/scripts/perspectives2.qps
index 2f6d1d653c..6762e21af4 100644
--- a/tests/auto/other/lancelot/scripts/perspectives2.qps
+++ b/tests/auto/other/lancelot/scripts/perspectives2.qps
@@ -8,7 +8,7 @@ image_convertToFormat zebra_png zebra ARGB32_Premultiplied
translate 75 100
# standard draw
-begin_block row
+begin_block row1
drawImage zebra -50 -50
translate 90 0
@@ -136,12 +136,12 @@ save
rotate_y 180
drawImage zebra -50 -50
restore
-end_block
+end_block row1
resetMatrix
translate 75 280
setRenderHint SmoothPixmapTransform
-repeat_block row
+repeat_block row1
resetMatrix
setPen black
@@ -162,7 +162,7 @@ setRenderHint SmoothPixmapTransform false
translate 75 100
# standard draw
-begin_block row
+begin_block row2
drawImage dome -50 -50
translate 90 0
@@ -290,13 +290,13 @@ save
rotate_y 180
drawImage dome -50 -50
restore
-end_block
+end_block row2
resetMatrix
translate 0 400
translate 75 280
setRenderHint SmoothPixmapTransform
-repeat_block row
+repeat_block row2
resetMatrix
setPen black
@@ -306,4 +306,4 @@ drawText 0 0 "Fast Pixmap Transform"
resetMatrix
translate 0 400
translate 300 210
-drawText 0 0 "Smooth Pixmap Transform" \ No newline at end of file
+drawText 0 0 "Smooth Pixmap Transform"
diff --git a/tests/auto/shared/resources/testfont_open.otf b/tests/auto/shared/resources/testfont_open.otf
new file mode 100644
index 0000000000..0f7950f2dd
--- /dev/null
+++ b/tests/auto/shared/resources/testfont_open.otf
Binary files differ
diff --git a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp
index d26ac016b9..bd0889bf4a 100644
--- a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp
+++ b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp
@@ -305,17 +305,17 @@ void tst_LanceBench::runTestSuite(GraphicsEngine engine, QImage::Format format,
void tst_LanceBench::paint(QPaintDevice *device, GraphicsEngine engine, QImage::Format format, const QStringList &script, const QString &filePath)
{
+ PaintCommands pcmd(script, 800, 800, format);
+ switch (engine) {
+ case OpenGL:
+ pcmd.setType(OpenGLBufferType); // version/profile is communicated through the context's format()
+ break;
+ case Raster:
+ pcmd.setType(ImageType);
+ break;
+ }
+ pcmd.setFilePath(filePath);
QBENCHMARK {
- PaintCommands pcmd(script, 800, 800, format);
- switch (engine) {
- case OpenGL:
- pcmd.setType(OpenGLBufferType); // version/profile is communicated through the context's format()
- break;
- case Raster:
- pcmd.setType(ImageType);
- break;
- }
- pcmd.setFilePath(filePath);
QPainter p(device);
pcmd.setPainter(&p);
pcmd.runCommands();