Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Icbb60f8c1891ec2779575276495199ace9d3d6c3
This commit is contained in:
commit
4c89005ebe
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
|
@ -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]
|
||||
drawPolygon [13.6965 -99.1837 -71.4767 13.823 32.4596 -33.1847]
|
||||
|
@ -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"
|
||||
drawText 0 0 "Smooth Pixmap Transform"
|
||||
|
BIN
tests/auto/shared/resources/testfont_open.otf
Normal file
BIN
tests/auto/shared/resources/testfont_open.otf
Normal file
Binary file not shown.
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user