diff options
Diffstat (limited to 'src/gui/painting/qdrawhelper.cpp')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index a991b89f48..bd53952d1b 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6288,6 +6288,8 @@ static inline void rgbBlendPixel(quint32 *dst, int coverage, int sr, int sg, int } #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +Q_GUI_EXPORT bool qt_needs_a8_gamma_correction = false; + static inline void grayBlendPixel(quint32 *dst, int coverage, int sr, int sg, int sb, const uint *gamma, const uchar *invgamma) { // Do a gammacorrected gray alphablend... @@ -6335,6 +6337,7 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer, int sb = gamma[qBlue(color)]; bool opaque_src = (qAlpha(color) == 255); + bool doGrayBlendPixel = opaque_src && qt_needs_a8_gamma_correction; #endif if (!clip) { @@ -6349,7 +6352,7 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer, dest[i] = c; } else { #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && opaque_src + if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && doGrayBlendPixel && qAlpha(dest[i]) == 255) { grayBlendPixel(dest+i, coverage, sr, sg, sb, gamma, invgamma); } else @@ -6390,7 +6393,7 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer, dest[xp] = c; } else { #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && opaque_src + if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && doGrayBlendPixel && qAlpha(dest[xp]) == 255) { grayBlendPixel(dest+xp, coverage, sr, sg, sb, gamma, invgamma); } else |