summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-11-24 23:48:18 +0000
committerGitHub <noreply@github.com>2025-11-24 23:48:18 +0000
commitfe6a855bbbef1f9f38b0f2c316a920c7e75bea10 (patch)
treea5afa5a6a5f2b7ee7c452f149dc503ed27075d1a /src/render/Renderer.cpp
parent475e87b35173ee1439035a072e7c70e94cb4ad56 (diff)
renderer: stop looping over null texture surfaces (#12446)
fixes #12445
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp48
1 files changed, 46 insertions, 2 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 0e322284..c8c44ad0 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -612,6 +612,12 @@ void CHyprRenderer::renderWindow(PHLWINDOW pWindow, PHLMONITOR pMonitor, const T
renderdata.surfaceCounter = 0;
pWindow->m_wlSurface->resource()->breadthfirst(
[this, &renderdata, &pWindow](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
+ if (!s->m_current.texture)
+ return;
+
+ if (s->m_current.size.x < 1 || s->m_current.size.y < 1)
+ return;
+
renderdata.localPos = offset;
renderdata.texture = s->m_current.texture;
renderdata.surface = s;
@@ -685,6 +691,12 @@ void CHyprRenderer::renderWindow(PHLWINDOW pWindow, PHLMONITOR pMonitor, const T
popup->m_wlSurface->resource()->breadthfirst(
[this, &renderdata](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
+ if (!s->m_current.texture)
+ return;
+
+ if (s->m_current.size.x < 1 || s->m_current.size.y < 1)
+ return;
+
renderdata.localPos = offset;
renderdata.texture = s->m_current.texture;
renderdata.surface = s;
@@ -765,6 +777,12 @@ void CHyprRenderer::renderLayer(PHLLS pLayer, PHLMONITOR pMonitor, const Time::s
if (!popups)
pLayer->m_surface->resource()->breadthfirst(
[this, &renderdata, &pLayer](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
+ if (!s->m_current.texture)
+ return;
+
+ if (s->m_current.size.x < 1 || s->m_current.size.y < 1)
+ return;
+
renderdata.localPos = offset;
renderdata.texture = s->m_current.texture;
renderdata.surface = s;
@@ -785,10 +803,18 @@ void CHyprRenderer::renderLayer(PHLLS pLayer, PHLMONITOR pMonitor, const Time::s
if (!popup->m_wlSurface || !popup->m_wlSurface->resource() || !popup->m_mapped)
return;
+ const auto SURF = popup->m_wlSurface->resource();
+
+ if (!SURF->m_current.texture)
+ return;
+
+ if (SURF->m_current.size.x < 1 || SURF->m_current.size.y < 1)
+ return;
+
Vector2D pos = popup->coordsRelativeToParent();
renderdata.localPos = pos;
- renderdata.texture = popup->m_wlSurface->resource()->m_current.texture;
- renderdata.surface = popup->m_wlSurface->resource();
+ renderdata.texture = SURF->m_current.texture;
+ renderdata.surface = SURF;
renderdata.mainSurface = false;
m_renderPass.add(makeUnique<CSurfacePassElement>(renderdata));
renderdata.surfaceCounter++;
@@ -821,6 +847,12 @@ void CHyprRenderer::renderIMEPopup(CInputPopup* pPopup, PHLMONITOR pMonitor, con
SURF->breadthfirst(
[this, &renderdata, &SURF](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
+ if (!s->m_current.texture)
+ return;
+
+ if (s->m_current.size.x < 1 || s->m_current.size.y < 1)
+ return;
+
renderdata.localPos = offset;
renderdata.texture = s->m_current.texture;
renderdata.surface = s;
@@ -842,6 +874,12 @@ void CHyprRenderer::renderSessionLockSurface(WP<SSessionLockSurface> pSurface, P
renderdata.surface->breadthfirst(
[this, &renderdata, &pSurface](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
+ if (!s->m_current.texture)
+ return;
+
+ if (s->m_current.size.x < 1 || s->m_current.size.y < 1)
+ return;
+
renderdata.localPos = offset;
renderdata.texture = s->m_current.texture;
renderdata.surface = s;
@@ -2534,6 +2572,12 @@ void CHyprRenderer::makeSnapshot(WP<CPopup> popup) {
popup->m_wlSurface->resource()->breadthfirst(
[this, &renderdata](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
+ if (!s->m_current.texture)
+ return;
+
+ if (s->m_current.size.x < 1 || s->m_current.size.y < 1)
+ return;
+
renderdata.localPos = offset;
renderdata.texture = s->m_current.texture;
renderdata.surface = s;