diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-05-05 12:44:35 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-06-02 14:04:58 +0000 |
commit | b04b4ae4f618257a01132699df9858cd903f8c87 (patch) | |
tree | 7aecf38834bc15eba3d67231fd45d9673817fc63 /src/plugins/styles | |
parent | 61ea8f243e0114d57b1bf0e7c3f1dff2fa01eed3 (diff) |
QWindowsXPStyle: Do not draw some opaque theme parts directly
Drawing directly using GDI32 can produce colors that are invalid in the
premultiplied alpha format which is used for the backing store. Exclude part
ids which are known to be opaque.
Task-number: QTBUG-60571
Change-Id: I0863d030acf79f317f5e82a5ee954c9cb507c449
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r-- | src/plugins/styles/windowsvista/qwindowsxpstyle.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp index 3f59886f1d..beb8c60e3a 100644 --- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp @@ -665,6 +665,13 @@ static inline TransformType transformType(const QTransform &transform, qreal dev ? HighDpiScalingTransform : ComplexTransform; } +// QTBUG-60571: Exclude known fully opaque theme parts which produce values +// invalid in ARGB32_Premultiplied (for example, 0x00ffffff). +static inline bool isFullyOpaque(const XPThemeData &themeData) +{ + return themeData.theme == QWindowsXPStylePrivate::TaskDialogTheme && themeData.partId == TDLG_PRIMARYPANEL; +} + /*! \internal Main theme drawing function. Determines the correct lowlevel drawing method depending on several @@ -703,6 +710,7 @@ bool QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData) bool canDrawDirectly = false; if (themeData.widget && painter->opacity() == 1.0 && !themeData.rotate + && !isFullyOpaque(themeData) && tt != ComplexTransform && !themeData.mirrorVertically && !translucentToplevel) { // Draw on backing store DC only for real widgets or backing store images. |