From d92afc849e6ac8690bd4fe1d227455ec3c4ff161 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sun, 6 Feb 2022 14:09:03 +0200 Subject: [PATCH] kwineffects: Forbid most of operations with invalid render targets This simplifies a lot of things. --- src/libkwineffects/kwinglutils.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/libkwineffects/kwinglutils.cpp b/src/libkwineffects/kwinglutils.cpp index 4350663832..c39fdb13f3 100644 --- a/src/libkwineffects/kwinglutils.cpp +++ b/src/libkwineffects/kwinglutils.cpp @@ -1008,10 +1008,6 @@ GLRenderTarget::~GLRenderTarget() bool GLRenderTarget::enable() { - if (!mValid) { - initFBO(); - } - if (!valid()) { qCCritical(LIBKWINGLUTILS) << "Can't enable invalid render target!"; return false; @@ -1026,10 +1022,6 @@ bool GLRenderTarget::enable() bool GLRenderTarget::disable() { - if (!mValid) { - initFBO(); - } - if (!valid()) { qCCritical(LIBKWINGLUTILS) << "Can't disable invalid render target!"; return false; @@ -1131,14 +1123,10 @@ void GLRenderTarget::initFBO() void GLRenderTarget::blitFromFramebuffer(const QRect &source, const QRect &destination, GLenum filter) { - if (!GLRenderTarget::blitSupported()) { + if (!valid()) { return; } - if (!mValid) { - initFBO(); - } - GLRenderTarget::pushRenderTarget(this); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mFramebuffer); glBindFramebuffer(GL_READ_FRAMEBUFFER, s_kwinFramebuffer);