diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-03-09 01:00:54 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-03-09 01:00:55 +0100 |
commit | 261c0dedac1d97b5960d27eedaa017d45050b654 (patch) | |
tree | f91c8e2a770f4c456f6465f28aecefc8c2bbeccf /src/gui | |
parent | 830e06a3f8173621a99426e7da6ad9704eb701b3 (diff) | |
parent | caa74f16d41ebe65e1edbea219f799cf246d6067 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I056b658ffe9390dfcbe2787e2bddc7f4e9b389dd
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/Qt5GuiConfigExtras.cmake.in | 23 | ||||
-rw-r--r-- | src/gui/image/qimage.cpp | 8 | ||||
-rw-r--r-- | src/gui/image/qpixmap.h | 4 | ||||
-rw-r--r-- | src/gui/opengl/qopengltextureuploader.cpp | 31 | ||||
-rw-r--r-- | src/gui/painting/qbezier.cpp | 5 | ||||
-rw-r--r-- | src/gui/text/qtextformat.cpp | 2 |
6 files changed, 41 insertions, 32 deletions
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}") diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index e508cc9413..18125460c7 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2259,16 +2259,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/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 diff --git a/src/gui/opengl/qopengltextureuploader.cpp b/src/gui/opengl/qopengltextureuploader.cpp index 90253546c8..b8b532b3d0 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; 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)) 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() */ |