summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper_sse4.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-05-06 14:23:57 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-06-03 12:01:26 +0000
commit8f760808e0fe0fe6dd89d561f118b19ed8085e7a (patch)
tree8cc259b6098d83b91b6ec8ac22745546947860c7 /src/gui/painting/qdrawhelper_sse4.cpp
parent754efa57d89c62d1796e01b407e9222e67450f52 (diff)
Fix premul conversion from ARGB32 to A2RGB30 formats.
When a premultiplied alpha changes value because it is rounded to fewer bits the premultiplied colors may need to be recalculated with the new value. Otherwise the color will both be wrong and potentially invalid. Change-Id: I9ec74a22aac73cd7ffab04e180cf2bf35bb4c315 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/painting/qdrawhelper_sse4.cpp')
-rw-r--r--src/gui/painting/qdrawhelper_sse4.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/painting/qdrawhelper_sse4.cpp b/src/gui/painting/qdrawhelper_sse4.cpp
index 43a3958997..7cc498eefc 100644
--- a/src/gui/painting/qdrawhelper_sse4.cpp
+++ b/src/gui/painting/qdrawhelper_sse4.cpp
@@ -74,6 +74,22 @@ const uint *QT_FASTCALL convertRGBXFromARGB32PM_sse4(uint *buffer, const uint *s
return buffer;
}
+template<QtPixelOrder PixelOrder>
+const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM_sse4(uint *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *)
+{
+ for (int i = 0; i < count; ++i)
+ buffer[i] = qConvertArgb32ToA2rgb30_sse4<PixelOrder>(src[i]);
+ return buffer;
+}
+
+template
+const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM_sse4<PixelOrderBGR>(uint *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *);
+template
+const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM_sse4<PixelOrderRGB>(uint *buffer, const uint *src, int count,
+ const QPixelLayout *, const QRgb *);
+
QT_END_NAMESPACE
#endif