backends/x11: Make render backend naming consistent

This commit is contained in:
Vlad Zahorodnii 2022-07-14 15:51:23 +03:00
parent a0c8d4b24d
commit 8dd719e4e2
3 changed files with 28 additions and 28 deletions

View file

@ -21,26 +21,26 @@
namespace KWin namespace KWin
{ {
EglX11Output::EglX11Output(EglX11Backend *backend, Output *output, EGLSurface surface) X11WindowedEglOutput::X11WindowedEglOutput(X11WindowedEglBackend *backend, Output *output, EGLSurface surface)
: m_eglSurface(surface) : m_eglSurface(surface)
, m_output(output) , m_output(output)
, m_backend(backend) , m_backend(backend)
{ {
} }
EglX11Output::~EglX11Output() X11WindowedEglOutput::~X11WindowedEglOutput()
{ {
eglDestroySurface(m_backend->eglDisplay(), m_eglSurface); eglDestroySurface(m_backend->eglDisplay(), m_eglSurface);
} }
void EglX11Output::ensureFbo() void X11WindowedEglOutput::ensureFbo()
{ {
if (!m_fbo || m_fbo->size() != m_output->pixelSize()) { if (!m_fbo || m_fbo->size() != m_output->pixelSize()) {
m_fbo.reset(new GLFramebuffer(0, m_output->pixelSize())); m_fbo.reset(new GLFramebuffer(0, m_output->pixelSize()));
} }
} }
OutputLayerBeginFrameInfo EglX11Output::beginFrame() OutputLayerBeginFrameInfo X11WindowedEglOutput::beginFrame()
{ {
eglMakeCurrent(m_backend->eglDisplay(), m_eglSurface, m_eglSurface, m_backend->context()); eglMakeCurrent(m_backend->eglDisplay(), m_eglSurface, m_eglSurface, m_backend->context());
ensureFbo(); ensureFbo();
@ -51,7 +51,7 @@ OutputLayerBeginFrameInfo EglX11Output::beginFrame()
}; };
} }
bool EglX11Output::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) bool X11WindowedEglOutput::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion)
{ {
Q_UNUSED(renderedRegion) Q_UNUSED(renderedRegion)
m_lastDamage = damagedRegion; m_lastDamage = damagedRegion;
@ -59,25 +59,25 @@ bool EglX11Output::endFrame(const QRegion &renderedRegion, const QRegion &damage
return true; return true;
} }
EGLSurface EglX11Output::surface() const EGLSurface X11WindowedEglOutput::surface() const
{ {
return m_eglSurface; return m_eglSurface;
} }
QRegion EglX11Output::lastDamage() const QRegion X11WindowedEglOutput::lastDamage() const
{ {
return m_lastDamage; return m_lastDamage;
} }
EglX11Backend::EglX11Backend(X11WindowedBackend *backend) X11WindowedEglBackend::X11WindowedEglBackend(X11WindowedBackend *backend)
: EglOnXBackend(backend->connection(), backend->display(), backend->rootWindow(), backend->screenNumer(), XCB_WINDOW_NONE) : EglOnXBackend(backend->connection(), backend->display(), backend->rootWindow(), backend->screenNumer(), XCB_WINDOW_NONE)
, m_backend(backend) , m_backend(backend)
{ {
} }
EglX11Backend::~EglX11Backend() = default; X11WindowedEglBackend::~X11WindowedEglBackend() = default;
void EglX11Backend::init() void X11WindowedEglBackend::init()
{ {
EglOnXBackend::init(); EglOnXBackend::init();
@ -86,12 +86,12 @@ void EglX11Backend::init()
} }
} }
void EglX11Backend::cleanupSurfaces() void X11WindowedEglBackend::cleanupSurfaces()
{ {
m_outputs.clear(); m_outputs.clear();
} }
bool EglX11Backend::createSurfaces() bool X11WindowedEglBackend::createSurfaces()
{ {
const auto &outputs = m_backend->outputs(); const auto &outputs = m_backend->outputs();
for (const auto &output : outputs) { for (const auto &output : outputs) {
@ -99,7 +99,7 @@ bool EglX11Backend::createSurfaces()
if (s == EGL_NO_SURFACE) { if (s == EGL_NO_SURFACE) {
return false; return false;
} }
m_outputs[output] = std::make_shared<EglX11Output>(this, output, s); m_outputs[output] = std::make_shared<X11WindowedEglOutput>(this, output, s);
} }
if (m_outputs.isEmpty()) { if (m_outputs.isEmpty()) {
return false; return false;
@ -108,7 +108,7 @@ bool EglX11Backend::createSurfaces()
return true; return true;
} }
void EglX11Backend::present(Output *output) void X11WindowedEglBackend::present(Output *output)
{ {
static_cast<X11WindowedOutput *>(output)->vsyncMonitor()->arm(); static_cast<X11WindowedOutput *>(output)->vsyncMonitor()->arm();
@ -116,7 +116,7 @@ void EglX11Backend::present(Output *output)
presentSurface(renderOutput->surface(), renderOutput->lastDamage(), output->geometry()); presentSurface(renderOutput->surface(), renderOutput->lastDamage(), output->geometry());
} }
void EglX11Backend::presentSurface(EGLSurface surface, const QRegion &damage, const QRect &screenGeometry) void X11WindowedEglBackend::presentSurface(EGLSurface surface, const QRegion &damage, const QRect &screenGeometry)
{ {
if (damage.isEmpty()) { if (damage.isEmpty()) {
return; return;
@ -134,17 +134,17 @@ void EglX11Backend::presentSurface(EGLSurface surface, const QRegion &damage, co
} }
} }
OutputLayer *EglX11Backend::primaryLayer(Output *output) OutputLayer *X11WindowedEglBackend::primaryLayer(Output *output)
{ {
return m_outputs[output].get(); return m_outputs[output].get();
} }
std::unique_ptr<SurfaceTexture> EglX11Backend::createSurfaceTextureWayland(SurfacePixmapWayland *pixmap) std::unique_ptr<SurfaceTexture> X11WindowedEglBackend::createSurfaceTextureWayland(SurfacePixmapWayland *pixmap)
{ {
return std::make_unique<BasicEGLSurfaceTextureWayland>(this, pixmap); return std::make_unique<BasicEGLSurfaceTextureWayland>(this, pixmap);
} }
std::unique_ptr<SurfaceTexture> EglX11Backend::createSurfaceTextureInternal(SurfacePixmapInternal *pixmap) std::unique_ptr<SurfaceTexture> X11WindowedEglBackend::createSurfaceTextureInternal(SurfacePixmapInternal *pixmap)
{ {
return std::make_unique<BasicEGLSurfaceTextureInternal>(this, pixmap); return std::make_unique<BasicEGLSurfaceTextureInternal>(this, pixmap);
} }

View file

@ -18,13 +18,13 @@ namespace KWin
{ {
class X11WindowedBackend; class X11WindowedBackend;
class EglX11Backend; class X11WindowedEglBackend;
class EglX11Output : public OutputLayer class X11WindowedEglOutput : public OutputLayer
{ {
public: public:
EglX11Output(EglX11Backend *backend, Output *output, EGLSurface surface); X11WindowedEglOutput(X11WindowedEglBackend *backend, Output *output, EGLSurface surface);
~EglX11Output(); ~X11WindowedEglOutput();
OutputLayerBeginFrameInfo beginFrame() override; OutputLayerBeginFrameInfo beginFrame() override;
bool endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) override; bool endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) override;
@ -39,19 +39,19 @@ private:
QRegion m_lastDamage; QRegion m_lastDamage;
Output *const m_output; Output *const m_output;
EglX11Backend *const m_backend; X11WindowedEglBackend *const m_backend;
}; };
/** /**
* @brief OpenGL Backend using Egl windowing system over an X overlay window. * @brief OpenGL Backend using Egl windowing system over an X overlay window.
*/ */
class EglX11Backend : public EglOnXBackend class X11WindowedEglBackend : public EglOnXBackend
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit EglX11Backend(X11WindowedBackend *backend); explicit X11WindowedEglBackend(X11WindowedBackend *backend);
~EglX11Backend() override; ~X11WindowedEglBackend() override;
std::unique_ptr<SurfaceTexture> createSurfaceTextureInternal(SurfacePixmapInternal *pixmap) override; std::unique_ptr<SurfaceTexture> createSurfaceTextureInternal(SurfacePixmapInternal *pixmap) override;
std::unique_ptr<SurfaceTexture> createSurfaceTextureWayland(SurfacePixmapWayland *pixmap) override; std::unique_ptr<SurfaceTexture> createSurfaceTextureWayland(SurfacePixmapWayland *pixmap) override;
@ -67,7 +67,7 @@ protected:
private: private:
void presentSurface(EGLSurface surface, const QRegion &damage, const QRect &screenGeometry); void presentSurface(EGLSurface surface, const QRegion &damage, const QRect &screenGeometry);
QMap<Output *, std::shared_ptr<EglX11Output>> m_outputs; QMap<Output *, std::shared_ptr<X11WindowedEglOutput>> m_outputs;
X11WindowedBackend *m_backend; X11WindowedBackend *m_backend;
}; };

View file

@ -664,7 +664,7 @@ X11WindowedInputDevice *X11WindowedBackend::touchDevice() const
OpenGLBackend *X11WindowedBackend::createOpenGLBackend() OpenGLBackend *X11WindowedBackend::createOpenGLBackend()
{ {
return new EglX11Backend(this); return new X11WindowedEglBackend(this);
} }
QPainterBackend *X11WindowedBackend::createQPainterBackend() QPainterBackend *X11WindowedBackend::createQPainterBackend()