From a3def2869da8ad9c17d44005c0d1fd70a903f855 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Thu, 25 Feb 2016 12:41:35 +0300 Subject: QtGui: de-duplicate calls and cache results Change-Id: Iaf232c31d6780b49dc6a3d0faafb9717f3c36e65 Reviewed-by: Marc Mutz Reviewed-by: Lars Knoll Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/kernel/qopenglwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qopenglwindow.cpp') 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 ®ion) 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"); } -- cgit v1.2.3