renderer: stop looping over null texture surfaces (#12446)
fixes #12445
This commit is contained in:
parent
475e87b351
commit
fe6a855bbb
1 changed files with 46 additions and 2 deletions
|
|
@ -612,6 +612,12 @@ void CHyprRenderer::renderWindow(PHLWINDOW pWindow, PHLMONITOR pMonitor, const T
|
||||||
renderdata.surfaceCounter = 0;
|
renderdata.surfaceCounter = 0;
|
||||||
pWindow->m_wlSurface->resource()->breadthfirst(
|
pWindow->m_wlSurface->resource()->breadthfirst(
|
||||||
[this, &renderdata, &pWindow](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
|
[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.localPos = offset;
|
||||||
renderdata.texture = s->m_current.texture;
|
renderdata.texture = s->m_current.texture;
|
||||||
renderdata.surface = s;
|
renderdata.surface = s;
|
||||||
|
|
@ -685,6 +691,12 @@ void CHyprRenderer::renderWindow(PHLWINDOW pWindow, PHLMONITOR pMonitor, const T
|
||||||
|
|
||||||
popup->m_wlSurface->resource()->breadthfirst(
|
popup->m_wlSurface->resource()->breadthfirst(
|
||||||
[this, &renderdata](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
|
[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.localPos = offset;
|
||||||
renderdata.texture = s->m_current.texture;
|
renderdata.texture = s->m_current.texture;
|
||||||
renderdata.surface = s;
|
renderdata.surface = s;
|
||||||
|
|
@ -765,6 +777,12 @@ void CHyprRenderer::renderLayer(PHLLS pLayer, PHLMONITOR pMonitor, const Time::s
|
||||||
if (!popups)
|
if (!popups)
|
||||||
pLayer->m_surface->resource()->breadthfirst(
|
pLayer->m_surface->resource()->breadthfirst(
|
||||||
[this, &renderdata, &pLayer](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
|
[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.localPos = offset;
|
||||||
renderdata.texture = s->m_current.texture;
|
renderdata.texture = s->m_current.texture;
|
||||||
renderdata.surface = s;
|
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)
|
if (!popup->m_wlSurface || !popup->m_wlSurface->resource() || !popup->m_mapped)
|
||||||
return;
|
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();
|
Vector2D pos = popup->coordsRelativeToParent();
|
||||||
renderdata.localPos = pos;
|
renderdata.localPos = pos;
|
||||||
renderdata.texture = popup->m_wlSurface->resource()->m_current.texture;
|
renderdata.texture = SURF->m_current.texture;
|
||||||
renderdata.surface = popup->m_wlSurface->resource();
|
renderdata.surface = SURF;
|
||||||
renderdata.mainSurface = false;
|
renderdata.mainSurface = false;
|
||||||
m_renderPass.add(makeUnique<CSurfacePassElement>(renderdata));
|
m_renderPass.add(makeUnique<CSurfacePassElement>(renderdata));
|
||||||
renderdata.surfaceCounter++;
|
renderdata.surfaceCounter++;
|
||||||
|
|
@ -821,6 +847,12 @@ void CHyprRenderer::renderIMEPopup(CInputPopup* pPopup, PHLMONITOR pMonitor, con
|
||||||
|
|
||||||
SURF->breadthfirst(
|
SURF->breadthfirst(
|
||||||
[this, &renderdata, &SURF](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
|
[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.localPos = offset;
|
||||||
renderdata.texture = s->m_current.texture;
|
renderdata.texture = s->m_current.texture;
|
||||||
renderdata.surface = s;
|
renderdata.surface = s;
|
||||||
|
|
@ -842,6 +874,12 @@ void CHyprRenderer::renderSessionLockSurface(WP<SSessionLockSurface> pSurface, P
|
||||||
|
|
||||||
renderdata.surface->breadthfirst(
|
renderdata.surface->breadthfirst(
|
||||||
[this, &renderdata, &pSurface](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
|
[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.localPos = offset;
|
||||||
renderdata.texture = s->m_current.texture;
|
renderdata.texture = s->m_current.texture;
|
||||||
renderdata.surface = s;
|
renderdata.surface = s;
|
||||||
|
|
@ -2534,6 +2572,12 @@ void CHyprRenderer::makeSnapshot(WP<CPopup> popup) {
|
||||||
|
|
||||||
popup->m_wlSurface->resource()->breadthfirst(
|
popup->m_wlSurface->resource()->breadthfirst(
|
||||||
[this, &renderdata](SP<CWLSurfaceResource> s, const Vector2D& offset, void* data) {
|
[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.localPos = offset;
|
||||||
renderdata.texture = s->m_current.texture;
|
renderdata.texture = s->m_current.texture;
|
||||||
renderdata.surface = s;
|
renderdata.surface = s;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue