summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-11-14 14:17:38 +0100
committerThiago Macieira <thiago.macieira@intel.com>2018-12-12 03:44:11 +0000
commit33177b0456f50a1f3eae7a37b4ecc897aaf7125e (patch)
tree07d059e3a9ed411c4b6e5a3db5909cc9dee64cb9 /src/gui/painting/qdrawhelper_p.h
parentdb0616097f8a1658a6acf5798ead495999b24b87 (diff)
Add a qt_memfill24 implementation
This function gets called from qt_rectfill_quint24, which is used by the RGB666, ARGB6666_Premultiplied, ARGB8555_Premultiplied, and RGB888 formats. Together-with: Thiago Macieira <thiago.macieira@intel.com> Change-Id: Iba4b5c183776497d8ee1fffd1564585fdee835c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/painting/qdrawhelper_p.h')
-rw-r--r--src/gui/painting/qdrawhelper_p.h41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 219734c430..4dcfbc813b 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -165,6 +165,22 @@ extern SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::N
extern DrawHelper qDrawHelper[QImage::NImageFormats];
+struct quint24 {
+ quint24() = default;
+ quint24(uint value)
+ {
+ data[0] = uchar(value >> 16);
+ data[1] = uchar(value >> 8);
+ data[2] = uchar(value);
+ }
+ operator uint() const
+ {
+ return data[2] | (data[1] << 8) | (data[0] << 16);
+ }
+
+ uchar data[3];
+};
+
void qBlendGradient(int count, const QSpan *spans, void *userData);
void qBlendTexture(int count, const QSpan *spans, void *userData);
#ifdef __SSE2__
@@ -174,6 +190,7 @@ extern void (*qt_memfill32)(quint32 *dest, quint32 value, qsizetype count);
extern void qt_memfill64(quint64 *dest, quint64 value, qsizetype count);
extern void qt_memfill32(quint32 *dest, quint32 value, qsizetype count);
#endif
+extern void qt_memfill24(quint24 *dest, quint24 value, qsizetype count);
extern void qt_memfill16(quint16 *dest, quint16 value, qsizetype count);
typedef void (QT_FASTCALL *CompositionFunction)(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha);
@@ -872,25 +889,6 @@ static Q_ALWAYS_INLINE uint qAlphaRgb30(uint c)
return a;
}
-struct quint24 {
- quint24() = default;
- quint24(uint value);
- operator uint() const;
- uchar data[3];
-};
-
-inline quint24::quint24(uint value)
-{
- data[0] = uchar(value >> 16);
- data[1] = uchar(value >> 8);
- data[2] = uchar(value);
-}
-
-inline quint24::operator uint() const
-{
- return data[2] | (data[1] << 8) | (data[0] << 16);
-}
-
template <class T> inline void qt_memfill_template(T *dest, T color, qsizetype count)
{
if (!count)
@@ -926,6 +924,11 @@ template<> inline void qt_memfill(quint32 *dest, quint32 color, qsizetype count)
qt_memfill32(dest, color, count);
}
+template<> inline void qt_memfill(quint24 *dest, quint24 color, qsizetype count)
+{
+ qt_memfill24(dest, color, count);
+}
+
template<> inline void qt_memfill(quint16 *dest, quint16 color, qsizetype count)
{
qt_memfill16(dest, color, count);