Skip to content

Commit

Permalink
support building with Qt built for OpenGL ES
Browse files Browse the repository at this point in the history
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 mixxxdj#12802
  • Loading branch information
Be-ing committed Feb 12, 2024
1 parent 06b7c4c commit e51ea2d
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions src/waveform/renderers/glslwaveformrenderersignal.cpp
Original file line number Diff line number Diff line change
@@ -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 <QOpenGLFramebufferObject>
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions src/waveform/renderers/glslwaveformrenderersignal.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -111,4 +111,4 @@ class GLSLWaveformRendererStackedSignal : public GLSLWaveformRendererSignal {
}
};

#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2
#endif // QT_NO_OPENGL
4 changes: 2 additions & 2 deletions src/waveform/renderers/glvsynctestrenderer.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions src/waveform/renderers/glvsynctestrenderer.h
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -15,4 +15,4 @@ class GLVSyncTestRenderer : public GLWaveformRendererSignal {
int m_drawcount;
};

#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2
#endif // QT_NO_OPENGL
2 changes: 1 addition & 1 deletion src/waveform/renderers/glwaveformrenderbackground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(m_backgroundColor.redF()),
Expand Down
6 changes: 3 additions & 3 deletions src/waveform/renderers/glwaveformrenderbackground.h
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/waveform/renderers/glwaveformrenderer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#if !defined(QT_NO_OPENGL)

#include <QOpenGLFunctions>

Expand All @@ -11,4 +11,4 @@ class GLWaveformRenderer : protected QOpenGLFunctions {
}
};

#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#endif // !defined(QT_NO_OPENGL)
4 changes: 2 additions & 2 deletions src/waveform/renderers/glwaveformrendererfilteredsignal.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "glwaveformrendererfilteredsignal.h"
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#if !defined(QT_NO_OPENGL)

#include <QDomNode>

Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions src/waveform/renderers/glwaveformrendererfilteredsignal.h
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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
4 changes: 2 additions & 2 deletions src/waveform/renderers/glwaveformrendererrgb.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions src/waveform/renderers/glwaveformrendererrgb.h
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
4 changes: 2 additions & 2 deletions src/waveform/renderers/glwaveformrenderersignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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)
4 changes: 2 additions & 2 deletions src/waveform/renderers/glwaveformrenderersimplesignal.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions src/waveform/renderers/glwaveformrenderersimplesignal.h
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion src/waveform/waveformwidgetfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/waveform/widgets/glrgbwaveformwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ GLRGBWaveformWidget::GLRGBWaveformWidget(const QString& group, QWidget* parent)
addRenderer<WaveformRendererEndOfTrack>();
addRenderer<WaveformRendererPreroll>();
addRenderer<WaveformRenderMarkRange>();
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#if !defined(QT_NO_OPENGL)
addRenderer<GLWaveformRendererRGB>();
#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#endif // !defined(QT_NO_OPENGL)
addRenderer<WaveformRenderBeat>();
addRenderer<WaveformRenderMark>();

Expand Down
4 changes: 2 additions & 2 deletions src/waveform/widgets/glsimplewaveformwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ GLSimpleWaveformWidget::GLSimpleWaveformWidget(const QString& group, QWidget* pa
addRenderer<WaveformRendererEndOfTrack>();
addRenderer<WaveformRendererPreroll>();
addRenderer<WaveformRenderMarkRange>();
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#if !defined(QT_NO_OPENGL)
addRenderer<GLWaveformRendererSimpleSignal>();
#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#endif // !defined(QT_NO_OPENGL)
addRenderer<WaveformRenderBeat>();
addRenderer<WaveformRenderMark>();

Expand Down
4 changes: 2 additions & 2 deletions src/waveform/widgets/glslwaveformwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ GLSLWaveformWidget::GLSLWaveformWidget(
addRenderer<WaveformRendererEndOfTrack>();
addRenderer<WaveformRendererPreroll>();
addRenderer<WaveformRenderMarkRange>();
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#if !defined(QT_NO_OPENGL)
if (type == GlslType::Filtered) {
addRenderer<GLSLWaveformRendererFilteredSignal>();
} else if (type == GlslType::RGB) {
Expand All @@ -52,7 +52,7 @@ GLSLWaveformWidget::GLSLWaveformWidget(
}
#else
Q_UNUSED(type);
#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2
#endif // QT_NO_OPENGL
addRenderer<WaveformRenderBeat>();
addRenderer<WaveformRenderMark>();

Expand Down
2 changes: 1 addition & 1 deletion src/waveform/widgets/glvsynctestwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GLVSyncTestWidget::GLVSyncTestWidget(const QString& group, QWidget* parent)
// addRenderer<WaveformRendererPreroll>(); // 652 µs 2034 µs (active)
// addRenderer<WaveformRenderMarkRange>(); // 793 µs

#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#if !defined(QT_NO_OPENGL)
addRenderer<GLVSyncTestRenderer>(); // 841 µs // 2271 µs
#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2

Expand Down
4 changes: 2 additions & 2 deletions src/waveform/widgets/glwaveformwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ GLWaveformWidget::GLWaveformWidget(const QString& group, QWidget* parent)
addRenderer<WaveformRendererEndOfTrack>();
addRenderer<WaveformRendererPreroll>();
addRenderer<WaveformRenderMarkRange>();
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#if !defined(QT_NO_OPENGL)
addRenderer<GLWaveformRendererFilteredSignal>();
#endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#endif // !defined(QT_NO_OPENGL)
addRenderer<WaveformRenderBeat>();
addRenderer<WaveformRenderMark>();

Expand Down
4 changes: 2 additions & 2 deletions src/waveform/widgets/glwaveformwidgetabstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down

0 comments on commit e51ea2d

Please sign in to comment.