diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index c0e530aa50..b4503b9f18 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -377,7 +377,7 @@ static ChipClass detectIntelClass(const QByteArray &chipset) return UnknownIntel; } -static QString versionToString(qint64 version) +QString GLPlatform::versionToString(qint64 version) { int major = (version >> 32); int minor = (version >> 16) & 0xffff; @@ -390,7 +390,7 @@ static QString versionToString(qint64 version) return string; } -static QString driverToString(Driver driver) +QString GLPlatform::driverToString(Driver driver) { switch(driver) { case Driver_R100: @@ -425,7 +425,7 @@ static QString driverToString(Driver driver) } } -static QString chipClassToString(ChipClass chipClass) +QString GLPlatform::chipClassToString(ChipClass chipClass) { switch(chipClass) { case R100: @@ -887,5 +887,35 @@ bool GLPlatform::isSoftwareEmulation() const return m_driver == Driver_Softpipe || m_driver == Driver_Swrast || m_driver == Driver_Llvmpipe; } +const QByteArray &GLPlatform::glRendererString() const +{ + return m_renderer; +} + +const QByteArray &GLPlatform::glVendorString() const +{ + return m_vendor; +} + +const QByteArray &GLPlatform::glVersionString() const +{ + return m_version; +} + +const QByteArray &GLPlatform::glShadingLanguageVersionString() const +{ + return m_glsl_version; +} + +bool GLPlatform::isDirectRendering() const +{ + return m_directRendering; +} + +bool GLPlatform::isLooseBinding() const +{ + return m_looseBinding; +} + } // namespace KWin diff --git a/libkwineffects/kwinglplatform.h b/libkwineffects/kwinglplatform.h index beabc66966..14555a2bd4 100644 --- a/libkwineffects/kwinglplatform.h +++ b/libkwineffects/kwinglplatform.h @@ -241,6 +241,63 @@ public: **/ bool isSoftwareEmulation() const; + /** + * @returns the GL_VERSION string as provided by the driver. + * @since 4.9 + **/ + const QByteArray &glVersionString() const; + /** + * @returns the GL_RENDERER string as provided by the driver. + * @since 4.9 + **/ + const QByteArray &glRendererString() const; + /** + * @returns the GL_VENDOR string as provided by the driver. + * @since 4.9 + **/ + const QByteArray &glVendorString() const; + /** + * @returns the GL_SHADING_LANGUAGE_VERSION string as provided by the driver. + * If the driver does not support the OpenGL Shading Language a null bytearray is returned. + * @since 4.9 + **/ + const QByteArray &glShadingLanguageVersionString() const; + /** + * @returns Whether a direct rendering OpenGL context is used. + * @since 4.9 + **/ + bool isDirectRendering() const; + /** + * @returns Whether the driver supports loose texture binding. + * @since 4.9 + **/ + bool isLooseBinding() const; + + /** + * @returns a human readable form of the @p version. + * @since 4.9 + * @see glVersion + * @see glslVersion + * @see driverVersion + * @see mesaVersion + * @see galliumVersion + * @see kernelVersion + * @see serverVersion + **/ + static QString versionToString(qint64 version); + /** + * @returns a human readable form for the @p driver. + * @since 4.9 + * @see driver + **/ + static QString driverToString(Driver driver); + /** + * @returns a human readable form for the @p chipClass. + * @since 4.9 + * @see chipClass + **/ + static QString chipClassToString(ChipClass chipClass); + private: GLPlatform();