Skip to content

Commit

Permalink
[Render] Allow buffer age of 0 by clean out after render
Browse files Browse the repository at this point in the history
  • Loading branch information
Portisch committed Jan 18, 2025
1 parent 4438e13 commit be6c1f6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions xbmc/guilib/GUIWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,20 +1368,14 @@ bool CGUIWindowManager::Render()
int bufferAge = CServiceBroker::GetWinSystem()->GetBufferAge();
bool visualizeDirtyRegions =
CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_guiVisualizeDirtyRegions;
if (visualizeDirtyRegions)
bufferAge = 20;
if (bufferAge)
m_tracker.CleanMarkedRegions(bufferAge + 1);
else
m_tracker.CleanMarkedRegions(10);

CDirtyRegionList dirtyRegions = m_tracker.GetDirtyRegions();
CServiceBroker::GetWinSystem()->SetDirtyRegions(dirtyRegions);

bool hasRendered = false;
// If we visualize the regions we will always render the entire viewport
// If the buffer age is zero, the current content is undefined and has to be rendered
if (visualizeDirtyRegions || bufferAge == 0 ||
if (visualizeDirtyRegions ||
CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_guiAlgorithmDirtyRegions ==
DIRTYREGION_SOLVER_FILL_VIEWPORT_ALWAYS)
{
Expand Down Expand Up @@ -1418,8 +1412,11 @@ bool CGUIWindowManager::Render()
CGUITexture::DrawQuad(i, 0x0fff0000);
for (const auto& i : dirtyRegions)
CGUITexture::DrawQuad(i, 0x4c00ff00);
bufferAge = 20;
}

m_tracker.CleanMarkedRegions(bufferAge);

return hasRendered;
}

Expand Down

0 comments on commit be6c1f6

Please sign in to comment.