diff options
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 28 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 5 | ||||
-rw-r--r-- | src/gui/painting/qplatformbackingstore.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qregion.cpp | 33 |
4 files changed, 40 insertions, 28 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 4e40d250d3..e7b81ebdd3 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -32,11 +32,6 @@ ****************************************************************************/ #include <qglobal.h> -#ifdef Q_OS_IOS -// We don't build the NEON drawhelpers as they are implemented partly -// in GAS syntax assembly, which is not supported by the iOS toolchain. -#undef __ARM_NEON__ -#endif #include <qstylehints.h> #include <qguiapplication.h> @@ -6314,8 +6309,13 @@ void qt_memfill32(quint32 *dest, quint32 color, int count) template<QtPixelOrder> const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); #endif +extern void qInitBlendFunctions(); + static void qInitDrawhelperFunctions() { + // Set up basic blend function tables. + qInitBlendFunctions(); + #ifdef __SSE2__ qDrawHelper[QImage::Format_RGB32].bitmapBlit = qt_bitmapblit32_sse2; qDrawHelper[QImage::Format_ARGB32].bitmapBlit = qt_bitmapblit32_sse2; @@ -6411,7 +6411,7 @@ static void qInitDrawhelperFunctions() #endif // SSE2 -#if defined(__ARM_NEON__) && !defined(Q_OS_IOS) +#if defined(__ARM_NEON__) qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon; qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon; qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon; @@ -6432,7 +6432,7 @@ static void qInitDrawhelperFunctions() qt_fetch_radial_gradient = qt_fetch_radial_gradient_neon; -#if !defined(Q_PROCESSOR_ARM_64) +#if defined(ENABLE_PIXMAN_DRAWHELPERS) // The RGB16 helpers are using Arm32 assemblythat has not been ported to AArch64 qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon; qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon; @@ -6509,19 +6509,7 @@ static void qInitDrawhelperFunctions() #endif // QT_COMPILER_SUPPORTS_MIPS_DSP || QT_COMPILER_SUPPORTS_MIPS_DSPR2 } -extern void qInitBlendFunctions(); -class DrawHelperInitializer { -public: - DrawHelperInitializer() - { - // Set up basic blend function tables. - qInitBlendFunctions(); - // Set up architecture optimized methods for the current machine. - qInitDrawhelperFunctions(); - } -}; - // Ensure initialization if this object file is linked. -static DrawHelperInitializer drawHelperInitializer; +Q_CONSTRUCTOR_FUNCTION(qInitDrawhelperFunctions); QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 7f8000c856..8409481ad5 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3653,8 +3653,9 @@ QImage::Format QRasterBuffer::prepare(QImage *image) drawHelper = qDrawHelper + format; if (image->depth() == 1 && image->colorTable().size() == 2) { monoDestinationWithClut = true; - destColor0 = qPremultiply(image->colorTable()[0]); - destColor1 = qPremultiply(image->colorTable()[1]); + const QVector<QRgb> colorTable = image->colorTable(); + destColor0 = qPremultiply(colorTable[0]); + destColor1 = qPremultiply(colorTable[1]); } return format; diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index 4e26d8f741..cda2446a5e 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -301,6 +301,8 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion ®i return; } + QWindowPrivate::get(window)->lastComposeTime.start(); + QOpenGLFunctions *funcs = context->functions(); funcs->glViewport(0, 0, window->width() * window->devicePixelRatio(), window->height() * window->devicePixelRatio()); funcs->glClearColor(0, 0, 0, translucentBackground ? 0 : 1); diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index e6b777a30e..5e648eabf5 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -41,7 +41,7 @@ #include "qimage.h" #include "qbitmap.h" -#include <qdebug.h> +#include <private/qdebug_p.h> QT_BEGIN_NAMESPACE @@ -422,11 +422,32 @@ QDataStream &operator>>(QDataStream &s, QRegion &r) #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug s, const QRegion &r) { - QVector<QRect> rects = r.rects(); - s.nospace() << "QRegion(size=" << rects.size() << "), " - << "bounds = " << r.boundingRect() << '\n'; - for (int i=0; i<rects.size(); ++i) - s << "- " << i << rects.at(i) << '\n'; + QDebugStateSaver saver(s); + s.nospace(); + s << "QRegion("; + if (r.isNull()) { + s << "null"; + } else if (r.isEmpty()) { + s << "empty"; + } else { + const QVector<QRect> rects = r.rects(); + const int count = rects.size(); + if (count > 1) + s << "size=" << count << ", bounds=("; + QtDebugUtils::formatQRect(s, r.boundingRect()); + if (count > 1) { + s << ") - ["; + for (int i = 0; i < count; ++i) { + if (i) + s << ", "; + s << '('; + QtDebugUtils::formatQRect(s, rects.at(i)); + s << ')'; + } + s << ']'; + } + } + s << ')'; return s; } #endif |