kwineffects: Forbid most of operations with invalid render targets

This simplifies a lot of things.
This commit is contained in:
Vlad Zahorodnii 2022-02-06 14:09:03 +02:00
parent 383a5cee0b
commit d92afc849e

View file

@ -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);