diff --git a/debug_console.cpp b/debug_console.cpp
index ce1469e442..bbc8c5a9c8 100644
--- a/debug_console.cpp
+++ b/debug_console.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see .
#include "client.h"
#include "input_event.h"
#include "main.h"
-#include "scene_opengl.h"
+#include "scene.h"
#include "shell_client.h"
#include "unmanaged.h"
#include "wayland_server.h"
@@ -528,7 +528,7 @@ void DebugConsole::initGLTab()
m_ui->glVersionLabel->setText(GLPlatform::versionToString(gl->glVersion()));
m_ui->glslLabel->setText(GLPlatform::versionToString(gl->glslVersion()));
- auto extensionsString = [] (const QList &extensions) {
+ auto extensionsString = [] (const auto &extensions) {
QString text = QStringLiteral("");
for (auto extension : extensions) {
text.append(QStringLiteral("- %1
").arg(QString::fromLocal8Bit(extension)));
@@ -537,7 +537,7 @@ void DebugConsole::initGLTab()
return text;
};
- m_ui->platformExtensionsLabel->setText(extensionsString(static_cast(Compositor::self()->scene())->backend()->extensions()));
+ m_ui->platformExtensionsLabel->setText(extensionsString(Compositor::self()->scene()->openGLPlatformInterfaceExtensions()));
m_ui->openGLExtensionsLabel->setText(extensionsString(openGLExtensions()));
}
diff --git a/platform.cpp b/platform.cpp
index 04a267c3a0..68e94e2679 100644
--- a/platform.cpp
+++ b/platform.cpp
@@ -19,7 +19,6 @@ along with this program. If not, see .
*********************************************************************/
#include "platform.h"
#include
-#include "abstract_egl_backend.h"
#include "composite.h"
#include "cursor.h"
#include "effects.h"
@@ -27,7 +26,7 @@ along with this program. If not, see .
#include "overlaywindow.h"
#include "outline.h"
#include "pointer_input.h"
-#include "scene_opengl.h"
+#include "scene.h"
#include "screenedge.h"
#include "wayland_server.h"
@@ -353,9 +352,7 @@ void Platform::warpPointer(const QPointF &globalPos)
bool Platform::supportsQpaContext() const
{
if (Compositor *c = Compositor::self()) {
- if (SceneOpenGL *s = dynamic_cast(c->scene())) {
- return s->backend()->hasExtension(QByteArrayLiteral("EGL_KHR_surfaceless_context"));
- }
+ return c->scene()->openGLPlatformInterfaceExtensions().contains(QByteArrayLiteral("EGL_KHR_surfaceless_context"));
}
return false;
}
diff --git a/scene.cpp b/scene.cpp
index 1c68864e37..36a459ad68 100644
--- a/scene.cpp
+++ b/scene.cpp
@@ -671,6 +671,11 @@ QImage *Scene::qpainterRenderBuffer() const
return nullptr;
}
+QVector Scene::openGLPlatformInterfaceExtensions() const
+{
+ return QVector{};
+}
+
//****************************************
// Scene::Window
//****************************************
diff --git a/scene.h b/scene.h
index 616e9b12bb..d80217b95f 100644
--- a/scene.h
+++ b/scene.h
@@ -175,6 +175,15 @@ public:
**/
virtual QImage *qpainterRenderBuffer() const;
+ /**
+ * The backend specific extensions (e.g. EGL/GLX extensions).
+ *
+ * Not the OpenGL (ES) extension!
+ *
+ * Default implementation returns empty list
+ **/
+ virtual QVector openGLPlatformInterfaceExtensions() const;
+
Q_SIGNALS:
void frameRendered();
diff --git a/scene_opengl.cpp b/scene_opengl.cpp
index 74fa0574ac..94b5bb15c8 100644
--- a/scene_opengl.cpp
+++ b/scene_opengl.cpp
@@ -1021,6 +1021,11 @@ bool SceneOpenGL::animationsSupported() const
return !GLPlatform::instance()->isSoftwareEmulation();
}
+QVector SceneOpenGL::openGLPlatformInterfaceExtensions() const
+{
+ return m_backend->extensions().toVector();
+}
+
//****************************************
// SceneOpenGL2
//****************************************
diff --git a/scene_opengl.h b/scene_opengl.h
index f7a7de75e2..86360aca25 100644
--- a/scene_opengl.h
+++ b/scene_opengl.h
@@ -82,6 +82,8 @@ public:
return m_backend;
}
+ QVector openGLPlatformInterfaceExtensions() const override;
+
/**
* Copy a region of pixels from the current read to the current draw buffer
*/