summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsglcontext.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-04-15 09:09:23 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-04-15 09:09:24 +0200
commit605617b5dce6ccd8826d07aabe2db781ae3aa9b4 (patch)
tree9b014020fce4f53e92442c6914e5bc6f6264e879 /src/plugins/platforms/windows/qwindowsglcontext.cpp
parentd370878aa0510e1e51eb9014965f505e395f3f81 (diff)
parentd238f7e0190c49c0f07c24f2f4ef9a50577c389b (diff)
Merge remote-tracking branch 'origin/5.4' into 5.5
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsglcontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 7a17942b27..d9eec9f603 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -601,6 +601,14 @@ static int choosePixelFormat(HDC hdc,
break;
if (iAttributes[samplesValuePosition] > 1) {
iAttributes[samplesValuePosition] /= 2;
+ } else if (iAttributes[samplesValuePosition] == 1) {
+ // Fallback in case it is unable to initialize with any
+ // samples to avoid falling back to the GDI path
+ // NB: The sample attributes needs to be at the end for this
+ // to work correctly
+ iAttributes[samplesValuePosition - 1] = FALSE;
+ iAttributes[samplesValuePosition] = 0;
+ iAttributes[samplesValuePosition + 1] = 0;
} else {
break;
}