[PATCH] Remove duplicate check for QOpenGLFunctions_3_2_Core*
authorstefan.bruens@rwth-aachen.de <stefan.bruens@rwth-aachen.de>
Tue, 9 Jun 2020 15:34:39 +0000 (17:34 +0200)
committerAnton Gladky <gladk@debian.org>
Sun, 28 Nov 2021 22:34:47 +0000 (22:34 +0000)
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
GUISupport/Qt/QVTKOpenGLWindow.cxx

index 6afd6c1e80f642aa710eee49844b7006d0a606bf..f0973fabd9be771b89cf09edffa77575ee4e5ab6 100644 (file)
@@ -19,7 +19,6 @@
 #include <QOpenGLContext>
 #include <QOpenGLFramebufferObject>
 #include <QOpenGLFunctions>
-#include <QOpenGLFunctions_3_2_Core>
 #include <QOpenGLTexture>
 #include <QPointer>
 #include <QScopedValueRollback>
@@ -237,14 +236,10 @@ void QVTKOpenGLNativeWidget::paintGL()
     // before proceeding with blit-ing.
     this->makeCurrent();
 
-    QOpenGLFunctions_3_2_Core* f =
-      QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();
-    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
   {
index 3bddc19809009f97f7f2433495a626585c29322f..335feb581c578c99d2cde621237ac0eec7da946b 100644 (file)
@@ -19,7 +19,6 @@
 #include <QOpenGLContext>
 #include <QOpenGLFramebufferObject>
 #include <QOpenGLFunctions>
-#include <QOpenGLFunctions_3_2_Core>
 #include <QOpenGLTexture>
 #include <QPointer>
 #include <QScopedValueRollback>
@@ -230,25 +229,20 @@ void QVTKOpenGLWindow::paintGL()
     // before proceeding with blit-ing.
     this->makeCurrent();
 
-    QOpenGLFunctions_3_2_Core* f =
-      QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();
-    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