Commit 8681a69f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Remove redundant usesOverlayWindow() method

Whether an overlay window is used for compositing can be determined by
checking the return value of overlayWindow().
parent 8209cca8
......@@ -825,7 +825,7 @@ void X11Compositor::start()
}
void X11Compositor::handleFrameRequested(RenderLoop *renderLoop)
{
if (scene()->usesOverlayWindow() && !isOverlayWindowVisible()) {
if (scene()->overlayWindow() && !isOverlayWindowVisible()) {
// Return since nothing is visible.
return;
}
......
......@@ -58,7 +58,6 @@ public:
virtual void aboutToStartPainting(int screenId, const QRegion &damage);
virtual bool makeCurrent() = 0;
virtual void doneCurrent() = 0;
virtual bool usesOverlayWindow() const = 0;
virtual QRegion beginFrame(int screenId) = 0;
virtual void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) = 0;
......
......@@ -42,7 +42,6 @@ public:
* @return :OverlayWindow*
*/
virtual OverlayWindow *overlayWindow();
virtual bool usesOverlayWindow() const = 0;
/**
* @brief Shows the Overlay Window
*
......
......@@ -33,8 +33,3 @@ void AbstractEglDrmBackend::screenGeometryChanged(const QSize &size)
{
Q_UNUSED(size)
}
bool AbstractEglDrmBackend::usesOverlayWindow() const
{
return false;
}
......@@ -24,7 +24,6 @@ class AbstractEglDrmBackend : public AbstractEglBackend
public:
~AbstractEglDrmBackend();
bool usesOverlayWindow() const override;
void screenGeometryChanged(const QSize &size) override;
virtual int screenCount() const = 0;
......
......@@ -99,11 +99,6 @@ QSharedPointer<GLTexture> EglMultiBackend::textureForOutput(AbstractOutput *requ
return {};
}
bool EglMultiBackend::usesOverlayWindow() const
{
return false;
}
void EglMultiBackend::screenGeometryChanged(const QSize &size)
{
Q_UNUSED(size)
......
......@@ -32,8 +32,6 @@ public:
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
QSharedPointer<GLTexture> textureForOutput(AbstractOutput *requestedOutput) const override;
bool usesOverlayWindow() const override;
void screenGeometryChanged(const QSize &size) override;
void addBackend(AbstractEglDrmBackend *backend);
......
......@@ -214,11 +214,6 @@ void EglGbmBackend::endFrame(int screenId, const QRegion &renderedRegion, const
eglSwapBuffers(eglDisplay(), surface());
}
bool EglGbmBackend::usesOverlayWindow() const
{
return false;
}
/************************************************
* EglTexture
************************************************/
......
......@@ -28,7 +28,6 @@ public:
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
QRegion beginFrame(int screenId) override;
void endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) override;
bool usesOverlayWindow() const override;
void init() override;
private:
......
......@@ -388,11 +388,6 @@ void EglWaylandBackend::endFrame(int screenId, const QRegion &renderedRegion, co
}
}
bool EglWaylandBackend::usesOverlayWindow() const
{
return false;
}
/************************************************
* EglTexture
************************************************/
......
......@@ -71,7 +71,6 @@ public:
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
QRegion beginFrame(int screenId) override;
void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override;
bool usesOverlayWindow() const override;
void init() override;
bool havePlatformBase() const {
......
......@@ -26,7 +26,6 @@ EglOnXBackend::EglOnXBackend(Display *display)
: AbstractEglBackend()
, m_overlayWindow(kwinApp()->platform()->createOverlayWindow())
, surfaceHasSubPost(0)
, m_usesOverlayWindow(true)
, m_connection(connection())
, m_x11Display(display)
, m_rootWindow(rootWindow())
......@@ -40,7 +39,6 @@ EglOnXBackend::EglOnXBackend(xcb_connection_t *connection, Display *display, xcb
: AbstractEglBackend()
, m_overlayWindow(nullptr)
, surfaceHasSubPost(0)
, m_usesOverlayWindow(false)
, m_connection(connection)
, m_x11Display(display)
, m_rootWindow(rootWindow)
......@@ -162,7 +160,7 @@ bool EglOnXBackend::initRenderingContext()
initBufferConfigs();
if (m_usesOverlayWindow) {
if (overlayWindow()) {
if (!overlayWindow()->create()) {
qCCritical(KWIN_CORE) << "Could not get overlay window";
return false;
......@@ -275,11 +273,6 @@ bool EglOnXBackend::initBufferConfigs()
return true;
}
bool EglOnXBackend::usesOverlayWindow() const
{
return m_usesOverlayWindow;
}
OverlayWindow* EglOnXBackend::overlayWindow() const
{
return m_overlayWindow;
......
......@@ -28,7 +28,6 @@ public:
explicit EglOnXBackend(xcb_connection_t *connection, Display *display, xcb_window_t rootWindow, int screenNumber, xcb_window_t renderingWindow);
~EglOnXBackend() override;
OverlayWindow* overlayWindow() const override;
bool usesOverlayWindow() const override;
void init() override;
protected:
......@@ -53,7 +52,6 @@ private:
*/
OverlayWindow *m_overlayWindow;
int surfaceHasSubPost;
bool m_usesOverlayWindow;
xcb_connection_t *m_connection;
Display *m_x11Display;
xcb_window_t m_rootWindow;
......
......@@ -806,11 +806,6 @@ OverlayWindow* GlxBackend::overlayWindow() const
return m_overlayWindow;
}
bool GlxBackend::usesOverlayWindow() const
{
return true;
}
/********************************************************
* GlxTexture
*******************************************************/
......
......@@ -69,7 +69,6 @@ public:
bool makeCurrent() override;
void doneCurrent() override;
OverlayWindow* overlayWindow() const override;
bool usesOverlayWindow() const override;
void init() override;
private:
......
......@@ -150,9 +150,4 @@ void X11XRenderBackend::screenGeometryChanged(const QSize &size)
init(false);
}
bool X11XRenderBackend::usesOverlayWindow() const
{
return true;
}
} // namespace KWin
......@@ -32,7 +32,6 @@ public:
OverlayWindow *overlayWindow() override;
void showOverlay() override;
void screenGeometryChanged(const QSize &size) override;
bool usesOverlayWindow() const override;
private:
void init(bool createOverlay);
......
......@@ -59,11 +59,6 @@ bool EglX11Backend::createSurfaces()
return true;
}
bool EglX11Backend::usesOverlayWindow() const
{
return false;
}
QRegion EglX11Backend::beginFrame(int screenId)
{
makeContextCurrent(m_surfaces.at(screenId));
......
......@@ -26,7 +26,6 @@ public:
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
void init() override;
bool usesOverlayWindow() const override;
QRegion beginFrame(int screenId) override;
void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override;
void screenGeometryChanged(const QSize &size) override;
......
......@@ -41,7 +41,6 @@ public:
Shadow *createShadow(Toplevel *toplevel) override;
void screenGeometryChanged(const QSize &size) override;
OverlayWindow *overlayWindow() const override;
bool usesOverlayWindow() const override;
bool makeOpenGLContextCurrent() override;
void doneOpenGLContextCurrent() override;
bool supportsSurfacelessContext() const override;
......@@ -305,11 +304,6 @@ private:
QScopedPointer<GLTexture> m_texture;
};
inline bool SceneOpenGL::usesOverlayWindow() const
{
return m_backend->usesOverlayWindow();
}
inline SceneOpenGLTexture* OpenGLWindowPixmap::texture() const
{
return m_texture.data();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment