Skip to content

Commit

Permalink
Cull GUI elements not in current screen draw area
Browse files Browse the repository at this point in the history
  • Loading branch information
Portisch committed Jan 23, 2025
1 parent f297f67 commit cc83ca0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xbmc/guilib/GUIControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ void CGUIControl::DoRender()
!m_renderRegion.Intersects(CServiceBroker::GetWinSystem()->GetGfxContext().GetScissors()))
return;

CRect hitRect(m_hitRect);
hitRect.Intersect(CServiceBroker::GetWinSystem()->GetGfxContext().GetScissors());

if (IsVisible() && !m_isCulled)
{
bool hasStereo =
Expand All @@ -204,7 +207,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 cc83ca0

Please sign in to comment.