From 55cc93e9d68a8851163f16dfa8a25a817c2e129e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 1 Mar 2019 14:39:25 +0100 Subject: Prefer BGRA uploading to swizzling The older BGRA extension is more likely to have stable driver support. Fixes: QTBUG-74150 Change-Id: If321b3024fbdeb9e199880744b9ee915b3b2bf6c Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopengltextureuploader.cpp | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'src/gui') diff --git a/src/gui/opengl/qopengltextureuploader.cpp b/src/gui/opengl/qopengltextureuploader.cpp index 42e309b733..03b5cb6eb5 100644 --- a/src/gui/opengl/qopengltextureuploader.cpp +++ b/src/gui/opengl/qopengltextureuploader.cpp @@ -114,6 +114,18 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag externalFormat = GL_BGRA; internalFormat = GL_RGBA; pixelType = GL_UNSIGNED_INT_8_8_8_8_REV; +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN + // Without GL_UNSIGNED_INT_8_8_8_8_REV, BGRA only matches ARGB on little endian: + } else if (funcs->hasOpenGLExtension(QOpenGLExtensions::BGRATextureFormat) && !sRgbBinding) { + // The GL_EXT_texture_format_BGRA8888 extension requires the internal format to match the external. + externalFormat = internalFormat = GL_BGRA; + pixelType = GL_UNSIGNED_BYTE; + } else if (context->isOpenGLES() && context->hasExtension(QByteArrayLiteral("GL_APPLE_texture_format_BGRA8888"))) { + // Is only allowed as an external format like OpenGL. + externalFormat = GL_BGRA; + internalFormat = GL_RGBA; + pixelType = GL_UNSIGNED_BYTE; +#endif } else if (funcs->hasOpenGLExtension(QOpenGLExtensions::TextureSwizzle)) { #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN GLint swizzle[4] = { GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA }; @@ -125,25 +137,8 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag externalFormat = internalFormat = GL_RGBA; pixelType = GL_UNSIGNED_BYTE; } else { -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - // Without GL_UNSIGNED_INT_8_8_8_8_REV, BGRA only matches ARGB on little endian. - if (funcs->hasOpenGLExtension(QOpenGLExtensions::BGRATextureFormat) && !sRgbBinding) { - // The GL_EXT_texture_format_BGRA8888 extension requires the internal format to match the external. - externalFormat = internalFormat = GL_BGRA; - pixelType = GL_UNSIGNED_BYTE; - } else if (context->isOpenGLES() && context->hasExtension(QByteArrayLiteral("GL_APPLE_texture_format_BGRA8888"))) { - // Is only allowed as an external format like OpenGL. - externalFormat = GL_BGRA; - internalFormat = GL_RGBA; - pixelType = GL_UNSIGNED_BYTE; - } else { - // No support for direct ARGB32 upload. - break; - } -#else - // Big endian requires GL_UNSIGNED_INT_8_8_8_8_REV for ARGB to match BGRA + // No support for direct ARGB32 upload. break; -#endif } targetFormat = image.format(); break; -- cgit v1.2.3 From 1270aeb0f96547ad32512c92ee2e69adb1f27011 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 22 Feb 2019 15:53:01 +0100 Subject: Fix typos in deprecation messages, noticed during code review Missing Q on the front of RegularExpression. Poor wording in QPixmap::fill() messages; and stray spaces at their starts. Task-number: QTBUG-73484 Change-Id: Ib953114c047afc37f0a903fcaaebfbc172079cbc Reviewed-by: Shawn Rutledge --- src/gui/image/qpixmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index 2a7393225e..13c81f18d0 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -95,9 +95,9 @@ public: void fill(const QColor &fillColor = Qt::white); #if QT_DEPRECATED_SINCE(5, 13) - QT_DEPRECATED_X(" Use QPainter or the fill(QColor)") + QT_DEPRECATED_X("Use QPainter or fill(QColor)") void fill(const QPaintDevice *device, const QPoint &ofs); - QT_DEPRECATED_X(" Use QPainter or the fill(QColor)") + QT_DEPRECATED_X("Use QPainter or fill(QColor)") void fill(const QPaintDevice *device, int xofs, int yofs); #endif -- cgit v1.2.3 From 17a51c4e0d0a4c16b800b7d932961c017ed2ea3a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 4 Mar 2019 14:32:09 +0100 Subject: Don't split bezier curves that are already just a line Otherwise we can end up in an infinite loop of splitting the curve and then discarding the half of the new curve, etc. Fixes: QTBUG-74172 Change-Id: I1984b7fd33cd98f65866f1c57c6ab20114615803 Reviewed-by: Eirik Aavitsland --- src/gui/painting/qbezier.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp index a3dcb02e07..ddd1d997f2 100644 --- a/src/gui/painting/qbezier.cpp +++ b/src/gui/painting/qbezier.cpp @@ -333,7 +333,9 @@ static ShiftResult shift(const QBezier *orig, QBezier *shifted, qreal offset, qr *shifted = QBezier::fromPoints(points_shifted[map[0]], points_shifted[map[1]], points_shifted[map[2]], points_shifted[map[3]]); - return good_offset(orig, shifted, offset, threshold); + if (np > 2) + return good_offset(orig, shifted, offset, threshold); + return Ok; } // This value is used to determine the length of control point vectors @@ -432,7 +434,6 @@ redo: } else if (res == Ok) { ++o; --b; - continue; } else if (res == Circle && maxSegments - (o - curveSegments) >= 2) { // add semi circle if (addCircle(b, offset, o)) -- cgit v1.2.3 From 131c760af60734a85cb136d2f6dadb2e43c42368 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 14 Feb 2019 03:09:59 +0100 Subject: Fix generation of the Qt5::GLESv2 target on ARM Since 5.12.1 the library name provided is an absolute path. We need to take the case into account, otherwise it just fails to build if the target is used. Fixes QTBUG-72903 Change-Id: I96407e5fe1831487da77cbe7b24b64dae59b22ff Reviewed-by: Kevin Funk --- src/gui/Qt5GuiConfigExtras.cmake.in | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index 07869efd7d..84dbbfebd4 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -91,16 +91,29 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) endforeach() !!ENDIF foreach(_lib ${Libs}) - string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _cmake_lib_name ${_lib}) + if (IS_ABSOLUTE ${_lib}) + get_filename_component(_libFile ${_lib} NAME_WE) + if (_libFile MATCHES \"^${CMAKE_SHARED_LIBRARY_PREFIX}(.*)\") + set(_libFile ${CMAKE_MATCH_1}) + endif() + else() + set(_libFile ${_lib}) + endif() + + string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _cmake_lib_name ${_libFile}) if (NOT TARGET Qt5::Gui_${_cmake_lib_name} AND NOT _Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE) - find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib} + if (IS_ABSOLUTE ${_lib}) + set(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib}) + else() + find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib} !!IF !isEmpty(CROSS_COMPILE) - PATHS \"${LibDir}\" + PATHS \"${LibDir}\" !!IF !mac - NO_DEFAULT_PATH + NO_DEFAULT_PATH !!ENDIF !!ENDIF - ) + ) + endif() !!IF mac set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}") if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}") -- cgit v1.2.3 From 859f837d46a2e7f00a2f43d654a01c5de1b61b1f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 7 Mar 2019 09:08:55 +0100 Subject: Fix some qdoc warnings src/corelib/itemmodels/qtransposeproxymodel.cpp:166: (qdoc) warning: Unknown command '\details' src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:102: (qdoc) warning: '\brief' statement does not end with a full stop. src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:233: (qdoc) warning: Undocumented parameter 'index' in QConcatenateTablesProxyModel::flags() src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:165: (qdoc) warning: Undocumented parameter 'proxyIndex' in QConcatenateTablesProxyModel::mapToSource() src/corelib/io/qresource.cpp:275: (qdoc) warning: Can't link to 'isCopressed()' src/corelib/io/qresource.cpp:555: (qdoc) warning: Can't link to 'compressionType()' src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: '\brief' statement does not end with a full stop. src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: Can't link to 'QSslSocket::ocspResponse()' src/gui/image/qimage.cpp:2247: (qdoc) warning: Undocumented parameter 'f' in QImage::convertTo() src/gui/image/qimage.cpp:2247: (qdoc) warning: No such parameter 'format' in QImage::convertTo() src/gui/text/qtextformat.cpp:1420: (qdoc) warning: Undocumented parameter 'styleName' in QTextCharFormat::setFontStyleName() src/gui/text/qtextformat.cpp:1420: (qdoc) warning: No such parameter 'style' in QTextCharFormat::setFontStyleName() src/widgets/dialogs/qdialog.cpp:151: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:168: (qdoc) warning: Unknown command '\p' Change-Id: Ide52b70f8e72d53767d489ce1a413cf4c2dce7df Reviewed-by: Leena Miettinen --- src/gui/image/qimage.cpp | 8 ++++---- src/gui/text/qtextformat.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 97123bfec2..18e94cf256 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2255,16 +2255,16 @@ bool QImage::reinterpretAsFormat(Format format) \sa convertToFormat() */ -void QImage::convertTo(Format f, Qt::ImageConversionFlags flags) +void QImage::convertTo(Format format, Qt::ImageConversionFlags flags) { - if (!d || f == QImage::Format_Invalid) + if (!d || format == QImage::Format_Invalid) return; detach(); - if (convertToFormat_inplace(f, flags)) + if (convertToFormat_inplace(format, flags)) return; - *this = convertToFormat_helper(f, flags); + *this = convertToFormat_helper(format, flags); } /*! diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 3bae6d4eb7..4a2985f74c 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -1421,7 +1421,7 @@ QTextCharFormat::QTextCharFormat(const QTextFormat &fmt) \fn void QTextCharFormat::setFontStyleName(const QString &styleName) \since 5.13 - Sets the text format's font \a style name. + Sets the text format's font \a styleName. \sa setFont(), QFont::setStyleName() */ -- cgit v1.2.3