Skip to content

Commit

Permalink
Cull GUI elements not in current screen draw area or if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Portisch committed Jan 22, 2025
1 parent 17382c6 commit 3ca0b50
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xbmc/guilib/GUIControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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();
Expand Down

0 comments on commit 3ca0b50

Please sign in to comment.