From a2fc6f8edaef58aae73160b8e5244760cc1b7760 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Mon, 13 Apr 2020 22:35:09 -0400 Subject: [PATCH] Fix fullRepaints loop The method paintSimpleScreen is responsible for redrawing the parts of the back-buffer that need updating using the buffer_age extension. The method fails to set correctly the damaged_region if, for some reason, one frame needs a repaint of the whole screen. In this case the backbuffer will request a full-screen repaint at some future frame, so the dirty region will be extended to full-screen. However, in this case the repaintRegion is not subtracted from the damaged_region (as it is done for the non fullRepaints case below --see the comment below--) and the damaged_region is reported to be the full screen again. This causes all the subsequent frames to be reported with a full screen damage, which causes some penalty, until paintGenericScreen is invoked for some reason and then the damage gets reset correctly. We now set the correct damage and prevent falling into the fullRepaint loop. --- scene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene.cpp b/scene.cpp index f7117d5dd1..af4e520b39 100644 --- a/scene.cpp +++ b/scene.cpp @@ -370,7 +370,7 @@ void Scene::paintSimpleScreen(int orig_mask, const QRegion ®ion) if (fullRepaint) { painted_region = displayRegion; - damaged_region = displayRegion; + damaged_region = displayRegion - repaintClip; } else { painted_region |= paintedArea;