From a4d6273de069bc3dd0c0c9ef05298339e9eac9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 27 Nov 2006 15:13:10 +0000 Subject: [PATCH] Do glFinish()/XSync() to make sure all painting has been also processed. svn path=/branches/work/kwin_composite/; revision=608430 --- effects/showfps.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/effects/showfps.cpp b/effects/showfps.cpp index 03c066cbcd..5d29428e84 100644 --- a/effects/showfps.cpp +++ b/effects/showfps.cpp @@ -74,9 +74,15 @@ void ShowFpsEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data if( fps > MAX_TIME ) fps = MAX_TIME; // keep it the same height if( dynamic_cast< SceneOpenGL* >( scene )) + { paintGL( fps ); + glFinish(); // make sure all rendering is done + } else + { paintX( fps ); + XSync( display(), False ); // make sure all rendering is done + } } void ShowFpsEffect::paintGL( int fps ) @@ -208,8 +214,6 @@ void ShowFpsEffect::paintX( int fps ) void ShowFpsEffect::postPaintScreen() { effects->postPaintScreen(); - if( dynamic_cast< SceneXrender* >( scene )) - XSync( display(), False ); // make sure all rendering is done paints[ paints_pos ] = t.elapsed(); if( ++paints_pos == NUM_PAINTS ) paints_pos = 0;