summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-02-10 10:18:03 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-10 16:24:40 +0100
commit7dca7c3c571ec595b792bbc2d2d448aac587886a (patch)
tree00852e04d53fa8c82a58520f18d070068769f1a3
parenta541fd4d7133618a3748b952196dd69dae786e95 (diff)
More graceful handling of QSurfaceFormat::samples() with GLX.
Earlier, if we asked for say 16 and the implementation only handled 4, we defaulted to 0 (no antialiasing). Now, we instead try a progressively lower number until we find a match. Task-number: QTBUG-22669 Change-Id: I3d89f2a302f9c6195e2d43827006fd015d981ce7 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
-rw-r--r--src/platformsupport/glxconvenience/qglxconvenience.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp
index 5acb2d0b65..11d8a5901f 100644
--- a/src/platformsupport/glxconvenience/qglxconvenience.cpp
+++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp
@@ -264,7 +264,7 @@ QSurfaceFormat qglx_reduceSurfaceFormat(const QSurfaceFormat &format, bool *redu
} else if (retFormat.blueBufferSize() > 1) {
retFormat.setBlueBufferSize(1);
} else if (retFormat.samples() > 1) {
- retFormat.setSamples(0);
+ retFormat.setSamples(qMin(retFormat.samples() / 2, 16));
} else if (retFormat.stereo()) {
retFormat.setStereo(false);
}else if (retFormat.stencilBufferSize() > 0) {