From 4b98c1a4a7a40f8a2373c9a961841fa06d99848e Mon Sep 17 00:00:00 2001 From: "stefan.bruens@rwth-aachen.de" Date: Tue, 9 Jun 2020 17:34:39 +0200 Subject: [PATCH] [PATCH] Remove duplicate check for QOpenGLFunctions_3_2_Core* The return value is already checked in QVTKRenderWindowAdapter::blit(), no need to do it twice. Gbp-Pq: Name 80_allow_gles_platforms.patch --- GUISupport/Qt/QVTKOpenGLNativeWidget.cxx | 13 +++------- GUISupport/Qt/QVTKOpenGLWindow.cxx | 32 ++++++++++-------------- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx index 6afd6c1e..f0973fab 100644 --- a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx +++ b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -237,14 +236,10 @@ void QVTKOpenGLNativeWidget::paintGL() // before proceeding with blit-ing. this->makeCurrent(); - QOpenGLFunctions_3_2_Core* f = - QOpenGLContext::currentContext()->versionFunctions(); - if (f) - { - const QSize deviceSize = this->size() * this->devicePixelRatioF(); - this->RenderWindowAdapter->blit( - this->defaultFramebufferObject(), GL_COLOR_ATTACHMENT0, QRect(QPoint(0, 0), deviceSize)); - } + const QSize deviceSize = this->size() * this->devicePixelRatioF(); + this->RenderWindowAdapter->blit( + this->defaultFramebufferObject(), GL_COLOR_ATTACHMENT0, QRect(QPoint(0, 0), deviceSize)); + } else { diff --git a/GUISupport/Qt/QVTKOpenGLWindow.cxx b/GUISupport/Qt/QVTKOpenGLWindow.cxx index 3bddc198..335feb58 100644 --- a/GUISupport/Qt/QVTKOpenGLWindow.cxx +++ b/GUISupport/Qt/QVTKOpenGLWindow.cxx @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -230,25 +229,20 @@ void QVTKOpenGLWindow::paintGL() // before proceeding with blit-ing. this->makeCurrent(); - QOpenGLFunctions_3_2_Core* f = - QOpenGLContext::currentContext()->versionFunctions(); - if (f) + const QSize deviceSize = this->size() * this->devicePixelRatioF(); + const auto fmt = this->context()->format(); + if (fmt.stereo() && this->RenderWindow->GetStereoRender() && + this->RenderWindow->GetStereoType() == VTK_STEREO_CRYSTAL_EYES) { - const QSize deviceSize = this->size() * this->devicePixelRatioF(); - const auto fmt = this->context()->format(); - if (fmt.stereo() && this->RenderWindow->GetStereoRender() && - this->RenderWindow->GetStereoType() == VTK_STEREO_CRYSTAL_EYES) - { - this->RenderWindowAdapter->blitLeftEye( - this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize)); - this->RenderWindowAdapter->blitRightEye( - this->defaultFramebufferObject(), GL_BACK_RIGHT, QRect(QPoint(0, 0), deviceSize)); - } - else - { - this->RenderWindowAdapter->blit( - this->defaultFramebufferObject(), GL_BACK, QRect(QPoint(0, 0), deviceSize)); - } + this->RenderWindowAdapter->blitLeftEye( + this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize)); + this->RenderWindowAdapter->blitRightEye( + this->defaultFramebufferObject(), GL_BACK_RIGHT, QRect(QPoint(0, 0), deviceSize)); + } + else + { + this->RenderWindowAdapter->blit( + this->defaultFramebufferObject(), GL_BACK, QRect(QPoint(0, 0), deviceSize)); } } else -- 2.30.2