From 73af8e75534732f64b606131d53460bd22d212de Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 6 Sep 2018 11:18:38 +0200 Subject: Add optimized fetch ARGB32 routines for NEON After convert and fetch were split, only convert was still NEON vectorized, while fetch is the more commonly used version. Change-Id: Iea2af7ccee6589b3d6e9908afeaae2d1ad2753be Reviewed-by: Eirik Aavitsland --- src/gui/painting/qdrawhelper.cpp | 6 ++++++ src/gui/painting/qdrawhelper_neon.cpp | 14 ++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'src/gui') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 582e403e4c..4b1031daaf 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6499,7 +6499,13 @@ static void qInitDrawhelperFunctions() #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN extern void QT_FASTCALL convertARGB32ToARGB32PM_neon(uint *buffer, int count, const QVector *); extern void QT_FASTCALL convertRGBA8888ToARGB32PM_neon(uint *buffer, int count, const QVector *); + extern const uint *QT_FASTCALL fetchARGB32ToARGB32PM_neon(uint *buffer, const uchar *src, int index, int count, + const QVector *, QDitherInfo *); + extern const uint *QT_FASTCALL fetchRGBA8888ToARGB32PM_neon(uint *buffer, const uchar *src, int index, int count, + const QVector *, QDitherInfo *); + qPixelLayouts[QImage::Format_ARGB32].fetchToARGB32PM = fetchARGB32ToARGB32PM_neon; qPixelLayouts[QImage::Format_ARGB32].convertToARGB32PM = convertARGB32ToARGB32PM_neon; + qPixelLayouts[QImage::Format_RGBA8888].fetchToARGB32PM = fetchRGBA8888ToARGB32PM_neon; qPixelLayouts[QImage::Format_RGBA8888].convertToARGB32PM = convertRGBA8888ToARGB32PM_neon; #endif diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp index 44d4037c0d..98995f485a 100644 --- a/src/gui/painting/qdrawhelper_neon.cpp +++ b/src/gui/painting/qdrawhelper_neon.cpp @@ -1163,6 +1163,20 @@ void QT_FASTCALL convertRGBA8888ToARGB32PM_neon(uint *buffer, int count, const Q convertARGBToARGB32PM_neon(buffer, buffer, count); } +const uint *QT_FASTCALL fetchARGB32ToARGB32PM_neon(uint *buffer, const uchar *src, int index, int count, + const QVector *, QDitherInfo *) +{ + convertARGBToARGB32PM_neon(buffer, reinterpret_cast(src) + index, count); + return buffer; +} + +const uint *QT_FASTCALL fetchRGBA8888ToARGB32PM_neon(uint *buffer, const uchar *src, int index, int count, + const QVector *, QDitherInfo *) +{ + convertARGBToARGB32PM_neon(buffer, reinterpret_cast(src) + index, count); + return buffer; +} + #endif // Q_BYTE_ORDER == Q_LITTLE_ENDIAN QT_END_NAMESPACE -- cgit v1.2.3