From e51ea2d741d3fbbd9e68a1646be3e1d7adb19f7a Mon Sep 17 00:00:00 2001 From: Be Date: Mon, 12 Feb 2024 14:00:41 -0600 Subject: [PATCH] support building with Qt built for OpenGL ES Currently the aarch64 KDE Flatpak runtime is built with `-opengl es` passed to Qt's configure script. It's questionable whether that's necessary, but regardless, Mixxx can support Qt built with that option. https://invent.kde.org/packaging/flatpak-kde-runtime/-/issues/19 Fixes https://github.com/mixxxdj/mixxx/issues/12802 --- src/waveform/renderers/glslwaveformrenderersignal.cpp | 4 ++-- src/waveform/renderers/glslwaveformrenderersignal.h | 4 ++-- src/waveform/renderers/glvsynctestrenderer.cpp | 4 ++-- src/waveform/renderers/glvsynctestrenderer.h | 4 ++-- src/waveform/renderers/glwaveformrenderbackground.cpp | 2 +- src/waveform/renderers/glwaveformrenderbackground.h | 6 +++--- src/waveform/renderers/glwaveformrenderer.h | 4 ++-- src/waveform/renderers/glwaveformrendererfilteredsignal.cpp | 4 ++-- src/waveform/renderers/glwaveformrendererfilteredsignal.h | 4 ++-- src/waveform/renderers/glwaveformrendererrgb.cpp | 4 ++-- src/waveform/renderers/glwaveformrendererrgb.h | 4 ++-- src/waveform/renderers/glwaveformrenderersignal.h | 4 ++-- src/waveform/renderers/glwaveformrenderersimplesignal.cpp | 4 ++-- src/waveform/renderers/glwaveformrenderersimplesignal.h | 4 ++-- src/waveform/waveformwidgetfactory.cpp | 2 +- src/waveform/widgets/glrgbwaveformwidget.cpp | 4 ++-- src/waveform/widgets/glsimplewaveformwidget.cpp | 4 ++-- src/waveform/widgets/glslwaveformwidget.cpp | 4 ++-- src/waveform/widgets/glvsynctestwidget.cpp | 2 +- src/waveform/widgets/glwaveformwidget.cpp | 4 ++-- src/waveform/widgets/glwaveformwidgetabstract.h | 4 ++-- 21 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/waveform/renderers/glslwaveformrenderersignal.cpp b/src/waveform/renderers/glslwaveformrenderersignal.cpp index 0855268ef7e9..fd100de67fdd 100644 --- a/src/waveform/renderers/glslwaveformrenderersignal.cpp +++ b/src/waveform/renderers/glslwaveformrenderersignal.cpp @@ -1,5 +1,5 @@ #include "waveform/renderers/glslwaveformrenderersignal.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) #ifdef MIXXX_USE_QOPENGL #include @@ -515,4 +515,4 @@ void GLSLWaveformRendererSignal::draw(QPainter* painter, QPaintEvent* /*event*/) painter->endNativePainting(); } -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) diff --git a/src/waveform/renderers/glslwaveformrenderersignal.h b/src/waveform/renderers/glslwaveformrenderersignal.h index e4f84dc7432a..da3db9d101f3 100644 --- a/src/waveform/renderers/glslwaveformrenderersignal.h +++ b/src/waveform/renderers/glslwaveformrenderersignal.h @@ -1,7 +1,7 @@ #pragma once #include "waveform/renderers/glwaveformrenderersignal.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) #include "track/track_decl.h" #include "util/memory.h" @@ -111,4 +111,4 @@ class GLSLWaveformRendererStackedSignal : public GLSLWaveformRendererSignal { } }; -#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2 +#endif // QT_NO_OPENGL diff --git a/src/waveform/renderers/glvsynctestrenderer.cpp b/src/waveform/renderers/glvsynctestrenderer.cpp index a1d1cb7da275..d628649f504e 100644 --- a/src/waveform/renderers/glvsynctestrenderer.cpp +++ b/src/waveform/renderers/glvsynctestrenderer.cpp @@ -1,5 +1,5 @@ #include "waveform/renderers/glvsynctestrenderer.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) #include "util/performancetimer.h" #include "waveform/renderers/waveformwidgetrenderer.h" @@ -130,4 +130,4 @@ void GLVSyncTestRenderer::draw(QPainter* painter, QPaintEvent* /*event*/) { //qDebug() << timer.restart(); // 129,498 ns } -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) diff --git a/src/waveform/renderers/glvsynctestrenderer.h b/src/waveform/renderers/glvsynctestrenderer.h index ca5e264db722..6d5b69e6ea37 100644 --- a/src/waveform/renderers/glvsynctestrenderer.h +++ b/src/waveform/renderers/glvsynctestrenderer.h @@ -1,7 +1,7 @@ #pragma once #include "waveform/renderers/glwaveformrenderersignal.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) class GLVSyncTestRenderer : public GLWaveformRendererSignal { public: @@ -15,4 +15,4 @@ class GLVSyncTestRenderer : public GLWaveformRendererSignal { int m_drawcount; }; -#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2 +#endif // QT_NO_OPENGL diff --git a/src/waveform/renderers/glwaveformrenderbackground.cpp b/src/waveform/renderers/glwaveformrenderbackground.cpp index 0be777514de0..df04c19bf35d 100644 --- a/src/waveform/renderers/glwaveformrenderbackground.cpp +++ b/src/waveform/renderers/glwaveformrenderbackground.cpp @@ -5,7 +5,7 @@ GLWaveformRenderBackground::GLWaveformRenderBackground( : WaveformRenderBackground(waveformWidgetRenderer) { } -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) void GLWaveformRenderBackground::draw(QPainter* painter, QPaintEvent* /*event*/) { painter->beginNativePainting(); glClearColor(static_cast(m_backgroundColor.redF()), diff --git a/src/waveform/renderers/glwaveformrenderbackground.h b/src/waveform/renderers/glwaveformrenderbackground.h index ae58d82b7e2c..bd7c39d8473a 100644 --- a/src/waveform/renderers/glwaveformrenderbackground.h +++ b/src/waveform/renderers/glwaveformrenderbackground.h @@ -1,12 +1,12 @@ #pragma once #include "waveform/renderers/waveformrenderbackground.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) #include "waveform/renderers/glwaveformrenderer.h" #endif class GLWaveformRenderBackground : public WaveformRenderBackground -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) , public GLWaveformRenderer #endif @@ -15,7 +15,7 @@ class GLWaveformRenderBackground : public WaveformRenderBackground explicit GLWaveformRenderBackground( WaveformWidgetRenderer* waveformWidgetRenderer); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) virtual void draw(QPainter* painter, QPaintEvent* event); #endif diff --git a/src/waveform/renderers/glwaveformrenderer.h b/src/waveform/renderers/glwaveformrenderer.h index 36b843466376..0481dbc0a19a 100644 --- a/src/waveform/renderers/glwaveformrenderer.h +++ b/src/waveform/renderers/glwaveformrenderer.h @@ -1,6 +1,6 @@ #pragma once -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) #include @@ -11,4 +11,4 @@ class GLWaveformRenderer : protected QOpenGLFunctions { } }; -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) diff --git a/src/waveform/renderers/glwaveformrendererfilteredsignal.cpp b/src/waveform/renderers/glwaveformrendererfilteredsignal.cpp index 56d7060c3a22..ef1189df54d2 100644 --- a/src/waveform/renderers/glwaveformrendererfilteredsignal.cpp +++ b/src/waveform/renderers/glwaveformrendererfilteredsignal.cpp @@ -1,5 +1,5 @@ #include "glwaveformrendererfilteredsignal.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) #include @@ -251,4 +251,4 @@ void GLWaveformRendererFilteredSignal::draw(QPainter* painter, QPaintEvent* /*ev painter->endNativePainting(); } -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) diff --git a/src/waveform/renderers/glwaveformrendererfilteredsignal.h b/src/waveform/renderers/glwaveformrendererfilteredsignal.h index ac27667e9ea1..d5e84cffa675 100644 --- a/src/waveform/renderers/glwaveformrendererfilteredsignal.h +++ b/src/waveform/renderers/glwaveformrendererfilteredsignal.h @@ -1,7 +1,7 @@ #pragma once #include "waveform/renderers/glwaveformrenderersignal.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) class QDomNode; @@ -15,4 +15,4 @@ class GLWaveformRendererFilteredSignal : public GLWaveformRendererSignal { virtual void draw(QPainter* painter, QPaintEvent* event); }; -#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2 +#endif // QT_NO_OPENGL diff --git a/src/waveform/renderers/glwaveformrendererrgb.cpp b/src/waveform/renderers/glwaveformrendererrgb.cpp index 337468e03832..dca2a9395d45 100644 --- a/src/waveform/renderers/glwaveformrendererrgb.cpp +++ b/src/waveform/renderers/glwaveformrendererrgb.cpp @@ -1,5 +1,5 @@ #include "waveform/renderers/glwaveformrendererrgb.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) #include "util/math.h" #include "waveform/waveform.h" @@ -240,4 +240,4 @@ void GLWaveformRendererRGB::draw(QPainter* painter, QPaintEvent* /*event*/) { painter->endNativePainting(); } -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) diff --git a/src/waveform/renderers/glwaveformrendererrgb.h b/src/waveform/renderers/glwaveformrendererrgb.h index c96e98124822..96a6e9173a83 100644 --- a/src/waveform/renderers/glwaveformrendererrgb.h +++ b/src/waveform/renderers/glwaveformrendererrgb.h @@ -1,7 +1,7 @@ #pragma once #include "glwaveformrenderersignal.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) class GLWaveformRendererRGB : public GLWaveformRendererSignal { public: @@ -16,4 +16,4 @@ class GLWaveformRendererRGB : public GLWaveformRendererSignal { DISALLOW_COPY_AND_ASSIGN(GLWaveformRendererRGB); }; -#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2 +#endif // QT_NO_OPENGL diff --git a/src/waveform/renderers/glwaveformrenderersignal.h b/src/waveform/renderers/glwaveformrenderersignal.h index ac808d777cdc..381452cdd0e7 100644 --- a/src/waveform/renderers/glwaveformrenderersignal.h +++ b/src/waveform/renderers/glwaveformrenderersignal.h @@ -3,7 +3,7 @@ #include "waveform/renderers/glwaveformrenderer.h" #include "waveform/renderers/waveformrenderersignalbase.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) /// GLWaveformRendererSignal is a WaveformRendererAbstract which directly calls OpenGL functions. /// @@ -17,4 +17,4 @@ class GLWaveformRendererSignal : public WaveformRendererSignalBase, public GLWav } }; -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) diff --git a/src/waveform/renderers/glwaveformrenderersimplesignal.cpp b/src/waveform/renderers/glwaveformrenderersimplesignal.cpp index d12920d53d1c..c3209e9fd14d 100644 --- a/src/waveform/renderers/glwaveformrenderersimplesignal.cpp +++ b/src/waveform/renderers/glwaveformrenderersimplesignal.cpp @@ -1,5 +1,5 @@ #include "waveform/renderers/glwaveformrenderersimplesignal.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) #include "util/math.h" #include "waveform/waveform.h" @@ -173,4 +173,4 @@ void GLWaveformRendererSimpleSignal::draw(QPainter* painter, QPaintEvent* /*even painter->endNativePainting(); } -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) diff --git a/src/waveform/renderers/glwaveformrenderersimplesignal.h b/src/waveform/renderers/glwaveformrenderersimplesignal.h index 056a861d0149..f52579df440d 100644 --- a/src/waveform/renderers/glwaveformrenderersimplesignal.h +++ b/src/waveform/renderers/glwaveformrenderersimplesignal.h @@ -1,7 +1,7 @@ #pragma once #include "glwaveformrenderersignal.h" -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) class GLWaveformRendererSimpleSignal : public GLWaveformRendererSignal { public: @@ -12,4 +12,4 @@ class GLWaveformRendererSimpleSignal : public GLWaveformRendererSignal { virtual void draw(QPainter* painter, QPaintEvent* event); }; -#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2 +#endif // QT_NO_OPENGL diff --git a/src/waveform/waveformwidgetfactory.cpp b/src/waveform/waveformwidgetfactory.cpp index c3b9e2ddbbed..a11916a18e30 100644 --- a/src/waveform/waveformwidgetfactory.cpp +++ b/src/waveform/waveformwidgetfactory.cpp @@ -305,7 +305,7 @@ WaveformWidgetFactory::WaveformWidgetFactory() m_openGLVersion = QString::number(majorGlVersion) + "." + QString::number(minorGlVersion); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) if (majorGlVersion * 100 + minorGlVersion >= 201) { // Qt5 requires at least OpenGL 2.1 or OpenGL ES 2.0 m_openGlAvailable = true; diff --git a/src/waveform/widgets/glrgbwaveformwidget.cpp b/src/waveform/widgets/glrgbwaveformwidget.cpp index 5aea9e13e05b..8931a8f19cd5 100644 --- a/src/waveform/widgets/glrgbwaveformwidget.cpp +++ b/src/waveform/widgets/glrgbwaveformwidget.cpp @@ -16,9 +16,9 @@ GLRGBWaveformWidget::GLRGBWaveformWidget(const QString& group, QWidget* parent) addRenderer(); addRenderer(); addRenderer(); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) addRenderer(); -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) addRenderer(); addRenderer(); diff --git a/src/waveform/widgets/glsimplewaveformwidget.cpp b/src/waveform/widgets/glsimplewaveformwidget.cpp index fe931b04c6f4..cca9849c578a 100644 --- a/src/waveform/widgets/glsimplewaveformwidget.cpp +++ b/src/waveform/widgets/glsimplewaveformwidget.cpp @@ -18,9 +18,9 @@ GLSimpleWaveformWidget::GLSimpleWaveformWidget(const QString& group, QWidget* pa addRenderer(); addRenderer(); addRenderer(); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) addRenderer(); -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) addRenderer(); addRenderer(); diff --git a/src/waveform/widgets/glslwaveformwidget.cpp b/src/waveform/widgets/glslwaveformwidget.cpp index 1790c143ad2a..3b6e617cf2a4 100644 --- a/src/waveform/widgets/glslwaveformwidget.cpp +++ b/src/waveform/widgets/glslwaveformwidget.cpp @@ -42,7 +42,7 @@ GLSLWaveformWidget::GLSLWaveformWidget( addRenderer(); addRenderer(); addRenderer(); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) if (type == GlslType::Filtered) { addRenderer(); } else if (type == GlslType::RGB) { @@ -52,7 +52,7 @@ GLSLWaveformWidget::GLSLWaveformWidget( } #else Q_UNUSED(type); -#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2 +#endif // QT_NO_OPENGL addRenderer(); addRenderer(); diff --git a/src/waveform/widgets/glvsynctestwidget.cpp b/src/waveform/widgets/glvsynctestwidget.cpp index cbf88525cf15..90a09b28ea88 100644 --- a/src/waveform/widgets/glvsynctestwidget.cpp +++ b/src/waveform/widgets/glvsynctestwidget.cpp @@ -14,7 +14,7 @@ GLVSyncTestWidget::GLVSyncTestWidget(const QString& group, QWidget* parent) // addRenderer(); // 652 µs 2034 µs (active) // addRenderer(); // 793 µs -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) addRenderer(); // 841 µs // 2271 µs #endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2 diff --git a/src/waveform/widgets/glwaveformwidget.cpp b/src/waveform/widgets/glwaveformwidget.cpp index e1eb08d3b0b8..2448cb72fb8e 100644 --- a/src/waveform/widgets/glwaveformwidget.cpp +++ b/src/waveform/widgets/glwaveformwidget.cpp @@ -18,9 +18,9 @@ GLWaveformWidget::GLWaveformWidget(const QString& group, QWidget* parent) addRenderer(); addRenderer(); addRenderer(); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) addRenderer(); -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) addRenderer(); addRenderer(); diff --git a/src/waveform/widgets/glwaveformwidgetabstract.h b/src/waveform/widgets/glwaveformwidgetabstract.h index 7d080918c139..e56607aecc5a 100644 --- a/src/waveform/widgets/glwaveformwidgetabstract.h +++ b/src/waveform/widgets/glwaveformwidgetabstract.h @@ -22,7 +22,7 @@ class GLWaveformWidgetAbstract : public WaveformWidgetAbstract, public WGLWidget } protected: -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#if !defined(QT_NO_OPENGL) #ifdef MIXXX_USE_QOPENGL void paintGL() override { // Called by OpenGLWindow to avoid flickering on resize. @@ -40,7 +40,7 @@ class GLWaveformWidgetAbstract : public WaveformWidgetAbstract, public WGLWidget } } -#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) +#endif // !defined(QT_NO_OPENGL) private: void wheelEvent(QWheelEvent* event) override;