diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-05-26 12:07:18 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-07-04 14:03:46 +0200 |
commit | 3acd4b546ded7523f65d60cee6f3809113a91a16 (patch) | |
tree | ac526a90c4b39229ea5ec4c80b779ca8a4b66c24 /src/gui/painting | |
parent | 715b41ce48c9dd78eec3223606e9ca5193cf5bad (diff) |
QImage support for RGB30 formats
Adds basic support for 10-bit per color channel formats to QImage
and the XCB plugin. This will make it possible to paint to and from
these formats, but only at 8-bit per color channel accuracy.
This also fixes Qt5 applications on X11 with native 30bit depth.
[ChangeLog][QtGui][QImage] Added support for 10-bit per color channel image formats.
Task-number: QTBUG-25998
Change-Id: I93ccd3c74bfbb0bd94b352476e5fe58a94119e1f
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qblendfunctions.cpp | 809 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 147 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper_p.h | 117 | ||||
-rw-r--r-- | src/gui/painting/qmemrotate.cpp | 5 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 6 |
5 files changed, 1006 insertions, 78 deletions
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index f22c37aecc..438eb6f34f 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -403,7 +403,168 @@ void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl, } } +template<QtPixelOrder PixelOrder> +static void qt_blend_argb32pm_on_a2rgb30pm(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) +{ +#ifdef QT_DEBUG_DRAW + fprintf(stdout, "qt_blend_argb32pm_on_a2rgb30pm: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", + destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + fflush(stdout); +#endif + + const uint *src = (const uint *) srcPixels; + uint *dst = (uint *) destPixels; + if (const_alpha == 256) { + for (int y=0; y<h; ++y) { + for (int x=0; x<w; ++x) { + uint s = src[x]; + dst[x] = qConvertArgb32ToA2rgb30<PixelOrder>(s) + BYTE_MUL_RGB30(dst[x], 255 - qAlpha(s)); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } else if (const_alpha != 0) { + const_alpha = (const_alpha * 255) >> 8; + for (int y=0; y<h; ++y) { + for (int x=0; x<w; ++x) { + uint s = BYTE_MUL(src[x], const_alpha); + dst[x] = qConvertArgb32ToA2rgb30<PixelOrder>(s) + BYTE_MUL_RGB30(dst[x], 255 - qAlpha(s)); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } +} + +template<QtPixelOrder PixelOrder> +void qt_blend_rgb32_on_rgb30(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) +{ +#ifdef QT_DEBUG_DRAW + fprintf(stdout, "qt_blend_rgb32_on_rgb30: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", + destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + fflush(stdout); +#endif + + if (const_alpha != 256) { + qt_blend_argb32pm_on_a2rgb30pm<PixelOrder>(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + return; + } + + const uint *src = (const uint *) srcPixels; + uint *dst = (uint *) destPixels; + for (int y = 0; y < h; ++y) { + for (int x = 0; x < w; ++x) { + dst[x] = qConvertRgb32ToRgb30<PixelOrder>(src[x]); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } +} + +static void qt_blend_a2rgb30pm_on_a2rgb30pm(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) +{ +#ifdef QT_DEBUG_DRAW + fprintf(stdout, "qt_blend_a2rgb30pm_on_a2rgb30pm: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", + destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + fflush(stdout); +#endif + + const uint *src = (const uint *) srcPixels; + uint *dst = (uint *) destPixels; + if (const_alpha == 256) { + for (int y=0; y<h; ++y) { + for (int x=0; x<w; ++x) { + uint s = src[x]; + dst[x] = s + BYTE_MUL_RGB30(dst[x], 255 - qAlphaRgb30(s)); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } else if (const_alpha != 0) { + const uint const_alpha255 = (const_alpha * 255) >> 8; + for (int y=0; y<h; ++y) { + for (int x=0; x<w; ++x) { + uint a = (qAlphaRgb30(src[x]) * const_alpha) >> 8; + uint s = BYTE_MUL_RGB30(src[x], const_alpha255); + dst[x] = s + BYTE_MUL_RGB30(dst[x], 255 - a); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } +} + + +void qt_blend_rgb30_on_rgb30(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) +{ +#ifdef QT_DEBUG_DRAW + fprintf(stdout, "qt_blend_rgb30_on_rgb30: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", + destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + fflush(stdout); +#endif + + if (const_alpha != 256) { + qt_blend_a2rgb30pm_on_a2rgb30pm(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + return; + } + + const uint *src = (const uint *) srcPixels; + uint *dst = (uint *) destPixels; + int len = w * 4; + for (int y=0; y<h; ++y) { + memcpy(dst, src, len); + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } +} +static void qt_blend_a2bgr30pm_on_a2rgb30pm(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) +{ +#ifdef QT_DEBUG_DRAW + fprintf(stdout, "qt_blend_a2bgr30pm_on_a2rgb32pm: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", + destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + fflush(stdout); +#endif + + const uint *src = (const uint *) srcPixels; + uint *dst = (uint *) destPixels; + if (const_alpha == 256) { + for (int y=0; y<h; ++y) { + for (int x=0; x<w; ++x) { + uint s = qRgbSwapRgb30(src[x]); + dst[x] = s + BYTE_MUL_RGB30(dst[x], 255 - qAlphaRgb30(s)); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } else if (const_alpha != 0) { + const uint const_alpha255 = (const_alpha * 255) >> 8; + for (int y=0; y<h; ++y) { + for (int x=0; x<w; ++x) { + uint a = (qAlphaRgb30(src[x]) * const_alpha) >> 8; + uint s = BYTE_MUL_RGB30(src[x], const_alpha255); + dst[x] = qRgbSwapRgb30(s) + BYTE_MUL_RGB30(dst[x], 255 - a); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } +} struct Blend_RGB32_on_RGB32_NoAlpha { inline void write(quint32 *dst, quint32 src) { *dst = src; } @@ -607,7 +768,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGRs30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_Mono 0, // Format_Invalid, @@ -628,7 +793,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_MonoLSB 0, // Format_Invalid, @@ -649,7 +818,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_Indexed8 0, // Format_Invalid, @@ -670,7 +843,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB32 0, // Format_Invalid, @@ -691,7 +868,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB32 0, // Format_Invalid, @@ -712,7 +893,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB32_Premultiplied 0, // Format_Invalid, @@ -733,7 +918,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB16 0, // Format_Invalid, @@ -754,7 +943,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB8565_Premultiplied 0, // Format_Invalid, @@ -775,7 +968,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB666 0, // Format_Invalid, @@ -796,7 +993,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB6666_Premultiplied 0, // Format_Invalid, @@ -817,7 +1018,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB555 0, // Format_Invalid, @@ -838,7 +1043,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB8555_Premultiplied 0, // Format_Invalid, @@ -859,7 +1068,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB888 0, // Format_Invalid, @@ -880,7 +1093,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB444 0, // Format_Invalid, @@ -901,7 +1118,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB4444_Premultiplied 0, // Format_Invalid, @@ -922,7 +1143,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGBX8888 0, // Format_Invalid, @@ -948,8 +1173,12 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = #else 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, #endif + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGBA8888 0, // Format_Invalid, @@ -970,7 +1199,11 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGBA8888_Premultiplied 0, // Format_Invalid, @@ -996,9 +1229,113 @@ SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = #else 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, #endif - } + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, + { // Format_BGR30 + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + 0, // Format_RGB32, + 0, // Format_ARGB32, + 0, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, + { // Format_A2BGR30_Premultiplied + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + 0, // Format_RGB32, + 0, // Format_ARGB32, + 0, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, + { // Format_RGB30 + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + 0, // Format_RGB32, + 0, // Format_ARGB32, + 0, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, + { // Format_A2RGB30_Premultiplied + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + 0, // Format_RGB32, + 0, // Format_ARGB32, + 0, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, }; @@ -1022,7 +1359,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_Mono 0, // Format_Invalid, @@ -1043,7 +1384,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_MonoLSB 0, // Format_Invalid, @@ -1064,7 +1409,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_Indexed8 0, // Format_Invalid, @@ -1085,7 +1434,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB32 0, // Format_Invalid, @@ -1106,7 +1459,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB32 0, // Format_Invalid, @@ -1127,7 +1484,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB32_Premultiplied 0, // Format_Invalid, @@ -1148,7 +1509,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB16 0, // Format_Invalid, @@ -1169,7 +1534,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB8565_Premultiplied 0, // Format_Invalid, @@ -1190,7 +1559,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB666 0, // Format_Invalid, @@ -1211,7 +1584,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB6666_Premultiplied 0, // Format_Invalid, @@ -1232,7 +1609,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB555 0, // Format_Invalid, @@ -1253,7 +1634,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB8555_Premultiplied 0, // Format_Invalid, @@ -1274,7 +1659,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB888 0, // Format_Invalid, @@ -1295,7 +1684,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB444 0, // Format_Invalid, @@ -1316,7 +1709,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB4444_Premultiplied 0, // Format_Invalid, @@ -1337,7 +1734,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGBX8888 0, // Format_Invalid, @@ -1363,8 +1764,12 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = #else 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, #endif + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGBA8888 0, // Format_Invalid, @@ -1385,7 +1790,11 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGBA8888_Premultiplied 0, // Format_Invalid, @@ -1411,9 +1820,113 @@ SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = #else 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, #endif - } + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0, // Format_A2RGB30_Premultiplied, + }, + { // Format_BGR30 + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + qt_blend_rgb32_on_rgb30<PixelOrderBGR>, // Format_RGB32, + 0, // Format_ARGB32, + qt_blend_argb32pm_on_a2rgb30pm<PixelOrderBGR>, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + qt_blend_rgb30_on_rgb30, // Format_RGB30, + qt_blend_a2rgb30pm_on_a2rgb30pm, // Format_A2RGB30_Premultiplied, + qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_RGB30, + qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_A2RGB30_Premultiplied, + }, + { // Format_A2BGR30_Premultiplied + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + qt_blend_rgb32_on_rgb30<PixelOrderBGR>, // Format_RGB32, + 0, // Format_ARGB32, + qt_blend_argb32pm_on_a2rgb30pm<PixelOrderBGR>, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + qt_blend_rgb30_on_rgb30, // Format_BGR30, + qt_blend_a2rgb30pm_on_a2rgb30pm, // Format_A2BGR30_Premultiplied, + qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_RGB30, + qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_A2RGB30_Premultiplied, + }, + { // Format_RGB30 + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + qt_blend_rgb32_on_rgb30<PixelOrderRGB>, // Format_RGB32, + 0, // Format_ARGB32, + qt_blend_argb32pm_on_a2rgb30pm<PixelOrderRGB>, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_BGR30, + qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_A2BGR30_Premultiplied, + qt_blend_rgb30_on_rgb30, // Format_RGB30, + qt_blend_a2rgb30pm_on_a2rgb30pm, // Format_A2RGB30_Premultiplied, + }, + { // Format_A2RGB30_Premultiplied + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + qt_blend_rgb32_on_rgb30<PixelOrderRGB>, // Format_RGB32, + 0, // Format_ARGB32, + qt_blend_argb32pm_on_a2rgb30pm<PixelOrderRGB>, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_BGR30, + qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_A2BGR30_Premultiplied, + qt_blend_rgb30_on_rgb30, // Format_RGB30, + qt_blend_a2rgb30pm_on_a2rgb30pm // Format_A2RGB30_Premultiplied, + }, }; SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats] = { @@ -1436,7 +1949,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_Mono 0, // Format_Invalid, @@ -1457,7 +1974,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_MonoLSB 0, // Format_Invalid, @@ -1478,7 +1999,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_Indexed8 0, // Format_Invalid, @@ -1499,7 +2024,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB32 0, // Format_Invalid, @@ -1520,7 +2049,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB32 0, // Format_Invalid, @@ -1541,7 +2074,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB32_Premultiplied 0, // Format_Invalid, @@ -1562,7 +2099,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB16 0, // Format_Invalid, @@ -1583,7 +2124,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB8565_Premultiplied 0, // Format_Invalid, @@ -1604,7 +2149,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB666 0, // Format_Invalid, @@ -1625,7 +2174,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB6666_Premultiplied 0, // Format_Invalid, @@ -1646,7 +2199,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB555 0, // Format_Invalid, @@ -1667,7 +2224,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB8555_Premultiplied 0, // Format_Invalid, @@ -1688,7 +2249,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB888 0, // Format_Invalid, @@ -1709,7 +2274,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGB444 0, // Format_Invalid, @@ -1730,7 +2299,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_ARGB4444_Premultiplied 0, // Format_Invalid, @@ -1751,7 +2324,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGBX8888 0, // Format_Invalid, @@ -1777,8 +2354,12 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo #else 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, #endif + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGBA8888 0, // Format_Invalid, @@ -1799,7 +2380,11 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo 0, // Format_ARGB4444_Premultiplied, 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, }, { // Format_RGBA8888_Premultiplied 0, // Format_Invalid, @@ -1825,9 +2410,113 @@ SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFo #else 0, // Format_RGBX8888, 0, // Format_RGBA8888, - 0 // Format_RGBA8888_Premultiplied, + 0, // Format_RGBA8888_Premultiplied, #endif - } + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, + { // Format_BGR30 + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + 0, // Format_RGB32, + 0, // Format_ARGB32, + 0, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, + { // Format_A2BGR30_Premultiplied + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + 0, // Format_RGB32, + 0, // Format_ARGB32, + 0, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, + { // Format_RGB30 + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + 0, // Format_RGB32, + 0, // Format_ARGB32, + 0, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, + { // Format_A2RGB30_Premultiplied + 0, // Format_Invalid, + 0, // Format_Mono, + 0, // Format_MonoLSB, + 0, // Format_Indexed8, + 0, // Format_RGB32, + 0, // Format_ARGB32, + 0, // Format_ARGB32_Premultiplied, + 0, // Format_RGB16, + 0, // Format_ARGB8565_Premultiplied, + 0, // Format_RGB666, + 0, // Format_ARGB6666_Premultiplied, + 0, // Format_RGB555, + 0, // Format_ARGB8555_Premultiplied, + 0, // Format_RGB888, + 0, // Format_RGB444, + 0, // Format_ARGB4444_Premultiplied, + 0, // Format_RGBX8888, + 0, // Format_RGBA8888, + 0, // Format_RGBA8888_Premultiplied, + 0, // Format_BGR30, + 0, // Format_A2BGR30_Premultiplied, + 0, // Format_RGB30, + 0 // Format_A2RGB30_Premultiplied, + }, }; QT_END_NAMESPACE diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 44b38dcf1c..ffb952bce4 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -575,6 +575,42 @@ static const uint *QT_FASTCALL convertRGBXFromARGB32PM(uint *buffer, const uint return buffer; } +template<QtPixelOrder PixelOrder> +static const uint *QT_FASTCALL convertA2RGB30PMToARGB32PM(uint *buffer, const uint *src, int count, + const QPixelLayout *, const QRgb *) +{ + for (int i = 0; i < count; ++i) + buffer[i] = qConvertA2rgb30ToArgb32<PixelOrder>(src[i]); + return buffer; +} + +template<QtPixelOrder PixelOrder> +static const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM(uint *buffer, const uint *src, int count, + const QPixelLayout *, const QRgb *) +{ + for (int i = 0; i < count; ++i) + buffer[i] = qConvertArgb32ToA2rgb30<PixelOrder>(src[i]); + return buffer; +} + +template<QtPixelOrder PixelOrder> +static const uint *QT_FASTCALL convertRGB30FromRGB32(uint *buffer, const uint *src, int count, + const QPixelLayout *, const QRgb *) +{ + for (int i = 0; i < count; ++i) + buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(src[i]); + return buffer; +} + +template<QtPixelOrder PixelOrder> +static const uint *QT_FASTCALL convertRGB30FromARGB32PM(uint *buffer, const uint *src, int count, + const QPixelLayout *, const QRgb *) +{ + for (int i = 0; i < count; ++i) + buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(qUnpremultiply(src[i])); + return buffer; +} + template <QPixelLayout::BPP bpp> static uint QT_FASTCALL fetchPixel(const uchar *src, int index); @@ -722,8 +758,12 @@ QPixelLayout qPixelLayouts[QImage::NImageFormats] = { #else { 8, 0, 8, 8, 8, 16, 0, 24, false, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBXFromARGB32PM, convertRGBXFromRGB32 }, // Format_RGBX8888 { 8, 0, 8, 8, 8, 16, 8, 24, false, QPixelLayout::BPP32, convertRGBA8888ToARGB32PM, convertRGBA8888FromARGB32PM, 0 }, // Format_RGBA8888 (ABGR32) - { 8, 0, 8, 8, 8, 16, 8, 24, true, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBA8888PMFromARGB32PM, 0 } // Format_RGBA8888_Premultiplied + { 8, 0, 8, 8, 8, 16, 8, 24, true, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBA8888PMFromARGB32PM, 0 }, // Format_RGBA8888_Premultiplied #endif + { 10, 20, 10, 10, 10, 0, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertRGB30FromARGB32PM<PixelOrderBGR>, convertRGB30FromRGB32<PixelOrderBGR> }, // Format_BGR30 + { 10, 20, 10, 10, 10, 0, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertA2RGB30PMFromARGB32PM<PixelOrderBGR>, 0 }, // Format_A2BGR30_Premultiplied + { 10, 0, 10, 10, 10, 20, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertRGB30FromARGB32PM<PixelOrderRGB>, convertRGB30FromRGB32<PixelOrderRGB> }, // Format_RGB30 + { 10, 0, 10, 10, 10, 20, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertA2RGB30PMFromARGB32PM<PixelOrderRGB>, 0 }, // Format_A2RGB30_Premultiplied }; FetchPixelsFunc qFetchPixels[QPixelLayout::BPPCount] = { @@ -831,6 +871,10 @@ static DestFetchProc destFetchProc[QImage::NImageFormats] = destFetch, // Format_RGBX8888 destFetch, // Format_RGBA8888 destFetch, // Format_RGBA8888_Premultiplied + destFetch, // Format_BGR30 + destFetch, // Format_A2BGR30_Premultiplied + destFetch, // Format_RGB30 + destFetch, // Format_A2RGB30_Premultiplied }; /* @@ -970,7 +1014,11 @@ static DestStoreProc destStoreProc[QImage::NImageFormats] = destStore, // Format_ARGB4444_Premultiplied destStore, // Format_RGBX8888 destStore, // Format_RGBA8888 - destStore // Format_RGBA8888_Premultiplied + destStore, // Format_RGBA8888_Premultiplied + destStore, // Format_BGR30 + destStore, // Format_A2BGR30_Premultiplied + destStore, // Format_RGB30 + destStore, // Format_A2RGB30_Premultiplied }; /* @@ -2221,7 +2269,11 @@ static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = { fetchUntransformed, // ARGB4444_Premultiplied fetchUntransformed, // RGBX8888 fetchUntransformed, // RGBA8888 - fetchUntransformed // RGBA8888_Premultiplied + fetchUntransformed, // RGBA8888_Premultiplied + fetchUntransformed, // Format_BGR30 + fetchUntransformed, // Format_A2BGR30_Premultiplied + fetchUntransformed, // Format_RGB30 + fetchUntransformed, // Format_A2RGB30_Premultiplied }, // Tiled { @@ -2243,7 +2295,11 @@ static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = { fetchUntransformed, // ARGB4444_Premultiplied fetchUntransformed, // RGBX8888 fetchUntransformed, // RGBA8888 - fetchUntransformed // RGBA8888_Premultiplied + fetchUntransformed, // RGBA8888_Premultiplied + fetchUntransformed, // BGR30 + fetchUntransformed, // A2BGR30_Premultiplied + fetchUntransformed, // RGB30 + fetchUntransformed // A2RGB30_Premultiplied }, // Transformed { @@ -2266,6 +2322,10 @@ static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = { fetchTransformed<BlendTransformed>, // RGBX8888 fetchTransformed<BlendTransformed>, // RGBA8888 fetchTransformed<BlendTransformed>, // RGBA8888_Premultiplied + fetchTransformed<BlendTransformed>, // BGR30 + fetchTransformed<BlendTransformed>, // A2BGR30_Premultiplied + fetchTransformed<BlendTransformed>, // RGB30 + fetchTransformed<BlendTransformed>, // A2RGB30_Premultiplied }, { 0, // TransformedTiled @@ -2287,6 +2347,10 @@ static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = { fetchTransformed<BlendTransformedTiled>, // RGBX8888 fetchTransformed<BlendTransformedTiled>, // RGBA8888 fetchTransformed<BlendTransformedTiled>, // RGBA8888_Premultiplied + fetchTransformed<BlendTransformedTiled>, // BGR30 + fetchTransformed<BlendTransformedTiled>, // A2BGR30_Premultiplied + fetchTransformed<BlendTransformedTiled>, // RGB30 + fetchTransformed<BlendTransformedTiled>, // A2RGB30_Premultiplied }, { 0, // Bilinear @@ -2307,7 +2371,11 @@ static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = { fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB4444_Premultiplied fetchTransformedBilinear<BlendTransformedBilinear>, // RGBX8888 fetchTransformedBilinear<BlendTransformedBilinear>, // RGBA8888 - fetchTransformedBilinear<BlendTransformedBilinear> // RGBA8888_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinear>, // RGBA8888_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinear>, // BGR30 + fetchTransformedBilinear<BlendTransformedBilinear>, // A2BGR30_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinear>, // RGB30 + fetchTransformedBilinear<BlendTransformedBilinear>, // A2RGB30_Premultiplied }, { 0, // BilinearTiled @@ -2328,7 +2396,11 @@ static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = { fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB4444_Premultiplied fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGBX8888 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGBA8888 - fetchTransformedBilinear<BlendTransformedBilinearTiled> // RGBA8888_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGBA8888_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinearTiled>, // BGR30 + fetchTransformedBilinear<BlendTransformedBilinearTiled>, // A2BGR30_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB30 + fetchTransformedBilinear<BlendTransformedBilinearTiled> // A2RGB30_Premultiplied }, }; @@ -5749,6 +5821,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_untransformed_generic, blend_untransformed_generic, blend_untransformed_generic, + blend_untransformed_generic, + blend_untransformed_generic, + blend_untransformed_generic, + blend_untransformed_generic, }, // Tiled { @@ -5771,6 +5847,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_tiled_generic, blend_tiled_generic, blend_tiled_generic, + blend_tiled_generic, + blend_tiled_generic, + blend_tiled_generic, + blend_tiled_generic, }, // Transformed { @@ -5793,6 +5873,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, blend_src_generic, blend_src_generic, + blend_src_generic, + blend_src_generic, + blend_src_generic, + blend_src_generic, }, // TransformedTiled { @@ -5814,6 +5898,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, blend_src_generic, blend_src_generic, + blend_src_generic, + blend_src_generic, + blend_src_generic, + blend_src_generic, blend_src_generic }, // Bilinear @@ -5837,6 +5925,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, blend_src_generic, blend_src_generic, + blend_src_generic, + blend_src_generic, + blend_src_generic, + blend_src_generic, }, // BilinearTiled { @@ -5859,6 +5951,10 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, // RGBX8888 blend_src_generic, // RGBA8888 blend_src_generic, // RGBA8888_Premultiplied + blend_src_generic, // BGR30 + blend_src_generic, // A2BGR30_Premultiplied + blend_src_generic, // RGB30 + blend_src_generic, // A2RGB30_Premultiplied } }; @@ -6379,7 +6475,6 @@ static void qt_rectfill_nonpremul_rgba(QRasterBuffer *rasterBuffer, ARGB2RGBA(qUnpremultiply(color)), x, y, width, height, rasterBuffer->bytesPerLine()); } - // Map table for destination image format. Contains function pointers // for blends of various types unto the destination @@ -6527,7 +6622,43 @@ DrawHelper qDrawHelper[QImage::NImageFormats] = #endif 0, qt_rectfill_rgba - } + }, + // Format_BGR30 + { + blend_color_generic, + blend_src_generic, + 0, + 0, + 0, + 0 + }, + // Format_A2BGR30_Premultiplied + { + blend_color_generic, + blend_src_generic, + 0, + 0, + 0, + 0 + }, + // Format_RGB30 + { + blend_color_generic, + blend_src_generic, + 0, + 0, + 0, + 0 + }, + // Format_A2RGB30_Premultiplied + { + blend_color_generic, + blend_src_generic, + 0, + 0, + 0, + 0 + }, }; #if defined(Q_CC_MSVC) && !defined(_MIPS_) diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 1c05fc305a..d6b557af01 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -672,6 +672,36 @@ static Q_ALWAYS_INLINE uint BYTE_MUL_RGB16_32(uint x, uint a) { return t; } +#if defined(Q_CC_RVCT) +# pragma push +# pragma arm +#endif +static Q_ALWAYS_INLINE int qt_div_255(int x) { return (x + (x>>8) + 0x80) >> 8; } +#if defined(Q_CC_RVCT) +# pragma pop +#endif + +static Q_ALWAYS_INLINE uint BYTE_MUL_RGB30(uint x, uint a) { + uint xa = x >> 30; + uint xr = (x >> 20) & 0x3ff; + uint xg = (x >> 10) & 0x3ff; + uint xb = x & 0x3ff; + xa = qt_div_255(xa * a); + xr = qt_div_255(xr * a); + xg = qt_div_255(xg * a); + xb = qt_div_255(xb * a); + return (xa << 30) | (xr << 20) | (xg << 10) | xb; +} + +static Q_ALWAYS_INLINE uint qAlphaRgb30(uint c) +{ + uint a = c >> 30; + a |= a << 2; + a |= a << 4; + return a; +} + + // FIXME: Remove when all Qt modules have stopped using PREMUL and INV_PREMUL #define PREMUL(x) qPremultiply(x) #define INV_PREMUL(p) qUnpremultiply(p) @@ -795,15 +825,6 @@ do { \ } \ } while (0) -#if defined(Q_CC_RVCT) -# pragma push -# pragma arm -#endif -static Q_ALWAYS_INLINE int qt_div_255(int x) { return (x + (x>>8) + 0x80) >> 8; } -#if defined(Q_CC_RVCT) -# pragma pop -#endif - inline ushort qConvertRgb32To16(uint c) { return (((c) >> 3) & 0x001f) @@ -819,6 +840,84 @@ inline QRgb qConvertRgb16To32(uint c) | ((((c) << 8) & 0xf80000) | (((c) << 3) & 0x70000)); } +enum QtPixelOrder { + PixelOrderRGB, + PixelOrderBGR +}; + +template<enum QtPixelOrder> inline uint qConvertArgb32ToA2rgb30(QRgb); + +template<enum QtPixelOrder> inline uint qConvertRgb32ToRgb30(QRgb); + +template<enum QtPixelOrder> inline QRgb qConvertA2rgb30ToArgb32(uint c); + +template<> +inline uint qConvertArgb32ToA2rgb30<PixelOrderBGR>(QRgb c) +{ + return (c & 0xc0000000) + | (((c << 22) & 0x3fc00000) | ((c << 14) & 0x00300000)) + | (((c << 4) & 0x000ff000) | ((c >> 4) & 0x00000c00)) + | (((c >> 14) & 0x000003fc) | ((c >> 22) & 0x00000003)); +} + +template<> +inline uint qConvertArgb32ToA2rgb30<PixelOrderRGB>(QRgb c) +{ + return (c & 0xc0000000) + | (((c << 6) & 0x3fc00000) | ((c >> 2) & 0x00300000)) + | (((c << 4) & 0x000ff000) | ((c >> 4) & 0x00000c00)) + | (((c << 2) & 0x000003fc) | ((c >> 6) & 0x00000003)); +} + +template<> +inline uint qConvertRgb32ToRgb30<PixelOrderBGR>(QRgb c) +{ + return 0xc0000000 + | (((c << 22) & 0x3fc00000) | ((c << 14) & 0x00300000)) + | (((c << 4) & 0x000ff000) | ((c >> 4) & 0x00000c00)) + | (((c >> 14) & 0x000003fc) | ((c >> 22) & 0x00000003)); +} + +template<> +inline uint qConvertRgb32ToRgb30<PixelOrderRGB>(QRgb c) +{ + return 0xc0000000 + | (((c << 6) & 0x3fc00000) | ((c >> 2) & 0x00300000)) + | (((c << 4) & 0x000ff000) | ((c >> 4) & 0x00000c00)) + | (((c << 2) & 0x000003fc) | ((c >> 6) & 0x00000003)); +} + +template<> +inline QRgb qConvertA2rgb30ToArgb32<PixelOrderBGR>(uint c) +{ + uint a = c >> 30; + a |= a << 2; + a |= a << 4; + return (a << 24) + | ((c << 14) & 0x00ff0000) + | ((c >> 4) & 0x0000ff00) + | ((c >> 22) & 0x000000ff); +} + +template<> +inline QRgb qConvertA2rgb30ToArgb32<PixelOrderRGB>(uint c) +{ + uint a = c >> 30; + a |= a << 2; + a |= a << 4; + return (a << 24) + | ((c >> 6) & 0x00ff0000) + | ((c >> 4) & 0x0000ff00) + | ((c >> 2) & 0x000000ff); +} + +inline uint qRgbSwapRgb30(uint c) +{ + const uint ag = c & 0xc00ffc00; + const uint rb = c & 0x3ff003ff; + return ag | (rb << 20) | (rb >> 20); +} + inline int qRed565(quint16 rgb) { const int r = (rgb & 0xf800); return (r >> 8) | (r >> 13); diff --git a/src/gui/painting/qmemrotate.cpp b/src/gui/painting/qmemrotate.cpp index 087231df43..e5eb7cf22d 100644 --- a/src/gui/painting/qmemrotate.cpp +++ b/src/gui/painting/qmemrotate.cpp @@ -532,7 +532,10 @@ MemRotateFunc qMemRotateFunctions[QImage::NImageFormats][3] = { 0, 0, 0 }, // Format_ARGB4444_Premultiplied, { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 }, // Format_RGBX8888, { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 }, // Format_RGBA8888, - { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 } // Format_RGBA8888_Premultiplied, + { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 }, // Format_RGBA8888_Premultiplied, + { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 }, // Format_RGB30, + { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 }, // Format_A2RGB30, + { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 } // Format_A2RGB30_Premultiplied, }; QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index a004428fab..2e340219b9 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -423,6 +423,8 @@ void QRasterPaintEngine::init() case QImage::Format_ARGB32: case QImage::Format_RGBA8888_Premultiplied: case QImage::Format_RGBA8888: + case QImage::Format_A2BGR30_Premultiplied: + case QImage::Format_A2RGB30_Premultiplied: gccaps |= PorterDuff; break; case QImage::Format_RGB32: @@ -432,6 +434,8 @@ void QRasterPaintEngine::init() case QImage::Format_RGB888: case QImage::Format_RGB16: case QImage::Format_RGBX8888: + case QImage::Format_BGR30: + case QImage::Format_RGB30: break; default: break; @@ -2243,6 +2247,8 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe case QImage::Format_ARGB8555_Premultiplied: case QImage::Format_ARGB4444_Premultiplied: case QImage::Format_RGBA8888_Premultiplied: + case QImage::Format_A2BGR30_Premultiplied: + case QImage::Format_A2RGB30_Premultiplied: // Combine premultiplied color with the opacity set on the painter. d->solid_color_filler.solid.color = ((((color & 0x00ff00ff) * s->intOpacity) >> 8) & 0x00ff00ff) |