From fa2f9fc91b6ffc00b3e4403f96c6231bd2c3d0c9 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 7 Jun 2019 13:59:23 +0000 Subject: [PATCH] avoid qt_ColorConvert() in trivial qt_memfill() Signed-off-by: Ivailo Monev --- src/gui/painting/qdrawhelper_p.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 60c5bd4ee..1c842528f 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -1573,9 +1573,6 @@ qrgb444 qrgb444::byte_mul(quint8 a) const template inline void qt_memfill(T *dest, const T value, int count) { - if (!count) - return; - memset(dest, value, count); } @@ -1589,17 +1586,20 @@ inline void qt_memfill(DST *dest, const SRC color, int count) template<> inline void qt_memfill(quint32 *dest, const quint32 color, int count) { - qt_memfill(dest, color, count); + while (count--) + *dest++ = color; } template<> inline void qt_memfill(quint16 *dest, const quint16 color, int count) { - qt_memfill(dest, color, count); + while (count--) + *dest++ = color; } template<> inline void qt_memfill(quint8 *dest, const quint8 color, int count) { - memset(dest, color, count); + while (count--) + *dest++ = color; } template