diff --git a/src/gui/painting/qcompositionfunctions.cpp b/src/gui/painting/qcompositionfunctions.cpp index 8d4ea58c39..6d2cb9aadb 100644 --- a/src/gui/painting/qcompositionfunctions.cpp +++ b/src/gui/painting/qcompositionfunctions.cpp @@ -89,11 +89,15 @@ QT_BEGIN_NAMESPACE #if defined __SSE2__ # define LOAD(ptr) _mm_loadl_epi64(reinterpret_cast(ptr)) -# define CONVERT(value) _mm_shufflelo_epi16(_mm_cvtsi32_si128(value), _MM_SHUFFLE(0, 0, 0, 0)) +#ifdef Q_PROCESSOR_X86_64 +# define CONVERT(value) _mm_cvtsi64_si128(value) +#else +# define CONVERT(value) LOAD(&value) +#endif # define STORE(ptr, value) _mm_storel_epi64(reinterpret_cast<__m128i *>(ptr), value) # define ADD(p, q) _mm_add_epi32(p, q) # define ALPHA(c) _mm_shufflelo_epi16(c, _MM_SHUFFLE(3, 3, 3, 3)) -# define CONST(n) CONVERT(n) +# define CONST(n) _mm_shufflelo_epi16(_mm_cvtsi32_si128(n), _MM_SHUFFLE(0, 0, 0, 0)) # define INVALPHA(c) _mm_sub_epi32(CONST(65535), ALPHA(c)) #elif defined __ARM_NEON__ # define LOAD(ptr) vreinterpret_u16_u64(vld1_u64(reinterpret_cast(ptr))) diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp index 0b1471c4b1..8d6886a6c6 100644 --- a/tests/auto/other/lancelot/paintcommands.cpp +++ b/tests/auto/other/lancelot/paintcommands.cpp @@ -165,7 +165,16 @@ const char *PaintCommands::imageFormatTable[] = { "Format_ARGB8555_Premultiplied", "Format_RGB888", "Format_RGB444", - "Format_ARGB4444_Premultiplied" + "Format_ARGB4444_Premultiplied", + "Format_RGBX8888", + "Format_RGBA8888", + "Format_RGBA8888_Premultiplied", + "Format_BGR30", + "Format_A2BGR30_Premultiplied", + "Format_RGB30", + "Format_A2RGB30_Premultiplied", + "Alpha8", + "Grayscale8", }; int PaintCommands::translateEnum(const char *table[], const QString &pattern, int limit) diff --git a/tests/auto/other/lancelot/tst_lancelot.cpp b/tests/auto/other/lancelot/tst_lancelot.cpp index 3f35712489..eb575a88ea 100644 --- a/tests/auto/other/lancelot/tst_lancelot.cpp +++ b/tests/auto/other/lancelot/tst_lancelot.cpp @@ -71,6 +71,10 @@ private slots: void testRasterRGB32(); void testRasterRGB16_data(); void testRasterRGB16(); + void testRasterA2RGB30PM_data(); + void testRasterA2RGB30PM(); + void testRasterBGR30_data(); + void testRasterBGR30(); #ifndef QT_NO_OPENGL void testOpenGL_data(); @@ -150,6 +154,30 @@ void tst_Lancelot::testRasterRGB16() } +void tst_Lancelot::testRasterA2RGB30PM_data() +{ + setupTestSuite(); +} + + +void tst_Lancelot::testRasterA2RGB30PM() +{ + runTestSuite(Raster, QImage::Format_A2RGB30_Premultiplied); +} + + +void tst_Lancelot::testRasterBGR30_data() +{ + setupTestSuite(); +} + + +void tst_Lancelot::testRasterBGR30() +{ + runTestSuite(Raster, QImage::Format_BGR30); +} + + #ifndef QT_NO_OPENGL bool tst_Lancelot::checkSystemGLSupport() {