summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qopenglwindow.cpp
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-02-25 12:41:35 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-03-13 17:00:31 +0000
commita3def2869da8ad9c17d44005c0d1fd70a903f855 (patch)
tree78a0a18223d8d6f9544c80f29dd9a6fcd06d9949 /src/gui/kernel/qopenglwindow.cpp
parent434f2b8968b7c41969cef06931bf6f09305550aa (diff)
QtGui: de-duplicate calls and cache results
Change-Id: Iaf232c31d6780b49dc6a3d0faafb9717f3c36e65 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/gui/kernel/qopenglwindow.cpp')
-rw-r--r--src/gui/kernel/qopenglwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qopenglwindow.cpp b/src/gui/kernel/qopenglwindow.cpp
index 37db608430..8ab5c08442 100644
--- a/src/gui/kernel/qopenglwindow.cpp
+++ b/src/gui/kernel/qopenglwindow.cpp
@@ -252,9 +252,10 @@ void QOpenGLWindowPrivate::beginPaint(const QRegion &region)
if (!fbo || fbo->size() != deviceSize) {
QOpenGLFramebufferObjectFormat fboFormat;
fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
- if (q->requestedFormat().samples() > 0) {
+ const int samples = q->requestedFormat().samples();
+ if (samples > 0) {
if (updateBehavior != QOpenGLWindow::PartialUpdateBlend)
- fboFormat.setSamples(q->requestedFormat().samples());
+ fboFormat.setSamples(samples);
else
qWarning("QOpenGLWindow: PartialUpdateBlend does not support multisampling");
}