Export supported openGLPlatformInterfaces to the DBus interface

Allows the KCM to know which platforms are supported (e.g. glx and egl or
just egl).
icc-effect-5.14.5
Martin Gräßlin 2014-04-23 08:19:47 +02:00
parent be33c59c16
commit 8005aa8b5a
3 changed files with 28 additions and 0 deletions

View File

@ -862,6 +862,22 @@ QString Compositor::compositingType() const
}
}
QStringList Compositor::supportedOpenGLPlatformInterfaces() const
{
QStringList interfaces;
bool supportsGlx = (kwinApp()->operationMode() == Application::OperationModeX11);
#ifdef KWIN_HAVE_OPENGLES
supportsGlx = false;
#endif
if (supportsGlx) {
interfaces << QStringLiteral("glx");
}
#ifdef KWIN_HAVE_EGL
interfaces << QStringLiteral("egl");
#endif
return interfaces;
}
/*****************************************************
* Workspace
****************************************************/

View File

@ -79,6 +79,16 @@ class Compositor : public QObject {
* @li @c gles OpenGL ES 2
**/
Q_PROPERTY(QString compositingType READ compositingType)
/**
* @brief All currently supported OpenGLPlatformInterfaces.
*
* Possible values:
* @li glx
* @li egl
*
* Values depend on operation mode and compile time options.
**/
Q_PROPERTY(QStringList supportedOpenGLPlatformInterfaces READ supportedOpenGLPlatformInterfaces)
public:
enum SuspendReason { NoReasonSuspend = 0, UserSuspend = 1<<0, BlockRuleSuspend = 1<<1, ScriptSuspend = 1<<2, AllReasonSuspend = 0xff };
Q_DECLARE_FLAGS(SuspendReasons, SuspendReason)
@ -158,6 +168,7 @@ public:
QString compositingNotPossibleReason() const;
bool isOpenGLBroken() const;
QString compositingType() const;
QStringList supportedOpenGLPlatformInterfaces() const;
public Q_SLOTS:
void addRepaintFull();

View File

@ -6,6 +6,7 @@
<property name="compositingNotPossibleReason" type="s" access="read"/>
<property name="openGLIsBroken" type="b" access="read"/>
<property name="compositingType" type="s" access="read"/>
<property name="supportedOpenGLPlatformInterfaces" type="as" access="read"/>
<signal name="compositingToggled">
<arg name="active" type="b" direction="out"/>
</signal>