From 3ca0b5000c793d2f82c215abe5c97089b73eef18 Mon Sep 17 00:00:00 2001 From: Portisch Date: Wed, 22 Jan 2025 15:24:02 +0100 Subject: [PATCH] Cull GUI elements not in current screen draw area or if empty --- xbmc/guilib/GUIControl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xbmc/guilib/GUIControl.cpp b/xbmc/guilib/GUIControl.cpp index 624df972796..7d88f122d60 100644 --- a/xbmc/guilib/GUIControl.cpp +++ b/xbmc/guilib/GUIControl.cpp @@ -184,6 +184,12 @@ void CGUIControl::DoRender() !m_renderRegion.Intersects(CServiceBroker::GetWinSystem()->GetGfxContext().GetScissors())) return; + CRect hitRect(m_hitRect); + hitRect.Intersect(CServiceBroker::GetWinSystem()->GetGfxContext().GetScissors()); + + if (hitRect.IsEmpty()) + return; + if (IsVisible() && !m_isCulled) { bool hasStereo = @@ -204,7 +210,7 @@ void CGUIControl::DoRender() { KODI::UTILS::COLOR::Color color = CServiceBroker::GetWinSystem()->GetGfxContext().MergeAlpha(m_hitColor); - CGUITexture::DrawQuad(CServiceBroker::GetWinSystem()->GetGfxContext().GenerateAABB(m_hitRect), color); + CGUITexture::DrawQuad(CServiceBroker::GetWinSystem()->GetGfxContext().GenerateAABB(hitRect), color); } Render();