diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-10 07:58:06 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-10 07:58:06 +0100 |
commit | 015002fec9abff6a4c1bb3fa4b9de87279a079c3 (patch) | |
tree | ad93af535a503d0a49d6c6367e990a8fbca163d3 /src/gui/painting | |
parent | f1e00262321cc8daa3c7506153653453e2779886 (diff) | |
parent | b9547af45ea2bbbc634722c1ef41afdb54216ce2 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
doc/global/template/style/online.css
mkspecs/android-g++/qmake.conf
Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
Diffstat (limited to 'src/gui/painting')
-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 |