diff --git a/debug_console.cpp b/debug_console.cpp --- a/debug_console.cpp +++ b/debug_console.cpp @@ -22,7 +22,7 @@ #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,16 +528,16 @@ 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("")); 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 --- a/platform.cpp +++ b/platform.cpp @@ -19,15 +19,14 @@ *********************************************************************/ #include "platform.h" #include -#include "abstract_egl_backend.h" #include "composite.h" #include "cursor.h" #include "effects.h" #include "input.h" #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 @@ 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.h b/scene.h --- a/scene.h +++ b/scene.h @@ -175,6 +175,15 @@ **/ 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.cpp b/scene.cpp --- a/scene.cpp +++ b/scene.cpp @@ -671,6 +671,11 @@ return nullptr; } +QVector Scene::openGLPlatformInterfaceExtensions() const +{ + return QVector{}; +} + //**************************************** // Scene::Window //**************************************** diff --git a/scene_opengl.h b/scene_opengl.h --- a/scene_opengl.h +++ b/scene_opengl.h @@ -82,6 +82,8 @@ return m_backend; } + QVector openGLPlatformInterfaceExtensions() const override; + /** * Copy a region of pixels from the current read to the current draw buffer */ diff --git a/scene_opengl.cpp b/scene_opengl.cpp --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1021,6 +1021,11 @@ return !GLPlatform::instance()->isSoftwareEmulation(); } +QVector SceneOpenGL::openGLPlatformInterfaceExtensions() const +{ + return m_backend->extensions().toVector(); +} + //**************************************** // SceneOpenGL2 //****************************************