diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp index 774808b873d..f34849f0589 100644 --- a/xbmc/guilib/GUIWindowManager.cpp +++ b/xbmc/guilib/GUIWindowManager.cpp @@ -1368,12 +1368,6 @@ 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); @@ -1381,7 +1375,7 @@ bool CGUIWindowManager::Render() 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) { @@ -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; }