From 7a06ae733ca3b7143ea44fffad9ce0ff80a8edc1 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 15 Feb 2022 13:23:36 +0200 Subject: [PATCH] kwinglutils: Drop GLRenderTarget::isRenderTargetBound() Check whether GLRenderTarget::currentRenderTarget() returns non-null value instead. --- src/backends/virtual/egl_gbm_backend.cpp | 6 +++--- src/libkwineffects/kwinglutils.cpp | 5 ----- src/libkwineffects/kwinglutils.h | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/backends/virtual/egl_gbm_backend.cpp b/src/backends/virtual/egl_gbm_backend.cpp index 57c68a2274..96c9089eb2 100644 --- a/src/backends/virtual/egl_gbm_backend.cpp +++ b/src/backends/virtual/egl_gbm_backend.cpp @@ -40,7 +40,7 @@ EglGbmBackend::EglGbmBackend(VirtualBackend *b) EglGbmBackend::~EglGbmBackend() { - while (GLRenderTarget::isRenderTargetBound()) { + while (GLRenderTarget::currentRenderTarget()) { GLRenderTarget::popRenderTarget(); } delete m_fbo; @@ -90,7 +90,7 @@ void EglGbmBackend::init() return; } GLRenderTarget::pushRenderTarget(m_fbo); - if (!m_fbo->isRenderTargetBound()) { + if (!GLRenderTarget::currentRenderTarget()) { setFailed("Failed to bind framebuffer object"); return; } @@ -153,7 +153,7 @@ SurfaceTexture *EglGbmBackend::createSurfaceTextureWayland(SurfacePixmapWayland QRegion EglGbmBackend::beginFrame(AbstractOutput *output) { Q_UNUSED(output) - if (!GLRenderTarget::isRenderTargetBound()) { + if (!GLRenderTarget::currentRenderTarget()) { GLRenderTarget::pushRenderTarget(m_fbo); } return QRegion(0, 0, screens()->size().width(), screens()->size().height()); diff --git a/src/libkwineffects/kwinglutils.cpp b/src/libkwineffects/kwinglutils.cpp index 5f5164736a..3af77c224c 100644 --- a/src/libkwineffects/kwinglutils.cpp +++ b/src/libkwineffects/kwinglutils.cpp @@ -934,11 +934,6 @@ void GLRenderTarget::cleanup() s_blitSupported = false; } -bool GLRenderTarget::isRenderTargetBound() -{ - return !s_renderTargets.isEmpty(); -} - bool GLRenderTarget::blitSupported() { return s_blitSupported; diff --git a/src/libkwineffects/kwinglutils.h b/src/libkwineffects/kwinglutils.h index 6f6046d74a..65ef298f50 100644 --- a/src/libkwineffects/kwinglutils.h +++ b/src/libkwineffects/kwinglutils.h @@ -446,7 +446,6 @@ public: static void pushRenderTarget(GLRenderTarget *target); static GLRenderTarget *popRenderTarget(); - static bool isRenderTargetBound(); /** * Whether the GL_EXT_framebuffer_blit extension is supported. * This functionality is not available in OpenGL ES 2.0.