[plugins/qpa] Drop unused variable AbstractPlatformContext::m_integration
Credits to clang for finding unused private variable. This allowed to similify the ctor and remove a const_cast.
This commit is contained in:
parent
f5845fec02
commit
e713df1886
5 changed files with 10 additions and 12 deletions
|
@ -96,9 +96,8 @@ static QSurfaceFormat formatFromConfig(EGLDisplay dpy, EGLConfig config)
|
|||
return format;
|
||||
}
|
||||
|
||||
AbstractPlatformContext::AbstractPlatformContext(QOpenGLContext *context, Integration *integration, EGLDisplay display, EGLConfig config)
|
||||
AbstractPlatformContext::AbstractPlatformContext(QOpenGLContext *context, EGLDisplay display, EGLConfig config)
|
||||
: QPlatformOpenGLContext()
|
||||
, m_integration(integration)
|
||||
, m_eglDisplay(display)
|
||||
, m_config(config ? config :configFromGLFormat(m_eglDisplay, context->format()))
|
||||
, m_format(formatFromConfig(m_eglDisplay, m_config))
|
||||
|
|
|
@ -33,7 +33,7 @@ class Integration;
|
|||
class AbstractPlatformContext : public QPlatformOpenGLContext
|
||||
{
|
||||
public:
|
||||
explicit AbstractPlatformContext(QOpenGLContext *context, Integration *integration, EGLDisplay display, EGLConfig config = nullptr);
|
||||
explicit AbstractPlatformContext(QOpenGLContext *context, EGLDisplay display, EGLConfig config = nullptr);
|
||||
virtual ~AbstractPlatformContext();
|
||||
|
||||
void doneCurrent() override;
|
||||
|
@ -55,7 +55,6 @@ protected:
|
|||
void createContext(EGLContext shareContext = EGL_NO_CONTEXT);
|
||||
|
||||
private:
|
||||
Integration *m_integration;
|
||||
EGLDisplay m_eglDisplay;
|
||||
EGLConfig m_config;
|
||||
EGLContext m_context = EGL_NO_CONTEXT;
|
||||
|
|
|
@ -185,13 +185,13 @@ QPlatformNativeInterface *Integration::nativeInterface() const
|
|||
QPlatformOpenGLContext *Integration::createPlatformOpenGLContext(QOpenGLContext *context) const
|
||||
{
|
||||
if (kwinApp()->platform()->supportsQpaContext()) {
|
||||
return new SharingPlatformContext(context, const_cast<Integration*>(this));
|
||||
return new SharingPlatformContext(context);
|
||||
}
|
||||
if (kwinApp()->platform()->sceneEglDisplay() != EGL_NO_DISPLAY) {
|
||||
auto s = kwinApp()->platform()->sceneEglSurface();
|
||||
if (s != EGL_NO_SURFACE) {
|
||||
// try a SharingPlatformContext with a created surface
|
||||
return new SharingPlatformContext(context, const_cast<Integration*>(this), s, kwinApp()->platform()->sceneEglConfig());
|
||||
return new SharingPlatformContext(context, s, kwinApp()->platform()->sceneEglConfig());
|
||||
}
|
||||
}
|
||||
if (m_eglDisplay == EGL_NO_DISPLAY) {
|
||||
|
|
|
@ -33,13 +33,13 @@ namespace KWin
|
|||
namespace QPA
|
||||
{
|
||||
|
||||
SharingPlatformContext::SharingPlatformContext(QOpenGLContext *context, Integration *integration)
|
||||
: SharingPlatformContext(context, integration, EGL_NO_SURFACE)
|
||||
SharingPlatformContext::SharingPlatformContext(QOpenGLContext *context)
|
||||
: SharingPlatformContext(context, EGL_NO_SURFACE)
|
||||
{
|
||||
}
|
||||
|
||||
SharingPlatformContext::SharingPlatformContext(QOpenGLContext *context, Integration *integration, const EGLSurface &surface, EGLConfig config)
|
||||
: AbstractPlatformContext(context, integration, kwinApp()->platform()->sceneEglDisplay(), config)
|
||||
SharingPlatformContext::SharingPlatformContext(QOpenGLContext *context, const EGLSurface &surface, EGLConfig config)
|
||||
: AbstractPlatformContext(context, kwinApp()->platform()->sceneEglDisplay(), config)
|
||||
, m_surface(surface)
|
||||
{
|
||||
create();
|
||||
|
|
|
@ -31,8 +31,8 @@ class Integration;
|
|||
class SharingPlatformContext : public AbstractPlatformContext
|
||||
{
|
||||
public:
|
||||
explicit SharingPlatformContext(QOpenGLContext *context, Integration *integration);
|
||||
explicit SharingPlatformContext(QOpenGLContext *context, Integration *integration, const EGLSurface &surface, EGLConfig config = nullptr);
|
||||
explicit SharingPlatformContext(QOpenGLContext *context);
|
||||
explicit SharingPlatformContext(QOpenGLContext *context, const EGLSurface &surface, EGLConfig config = nullptr);
|
||||
|
||||
void swapBuffers(QPlatformSurface *surface) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue