diff --git a/composite.cpp b/composite.cpp index 00e088ab62..12bb75a8df 100644 --- a/composite.cpp +++ b/composite.cpp @@ -392,8 +392,8 @@ void Workspace::timerEvent(QTimerEvent *te) } else QObject::timerEvent(te); } + static bool s_pending = false; -QElapsedTimer profiler; void Workspace::performCompositing() { if (!scene->overlayWindow()->isVisible()) @@ -408,7 +408,6 @@ void Workspace::performCompositing() // Otherwise the window would not be painted normally anyway. return; } - profiler.start(); s_pending = pending; // create a list of all windows in the stacking order ToplevelList windows = xStackingOrder(); diff --git a/scene_opengl_glx.cpp b/scene_opengl_glx.cpp index 5f4dc58210..b016bba932 100644 --- a/scene_opengl_glx.cpp +++ b/scene_opengl_glx.cpp @@ -514,18 +514,19 @@ void SceneOpenGL::waitSync() // but this only leads to waiting for two frames??!? glXGetVideoSync(&sync); glXWaitVideoSync(2, (sync + 1) % 2, &sync); -#endif +#else glXWaitVideoSync(1, 0, &sync); +#endif #if VSYNC_DEBUG - static int waitTime = 0, waitCounter = 0, crapCounter = 0; + static int waitTime = 0, waitCounter = 0, doubleSyncCounter = 0; if (m_renderTimer.elapsed() > 11) - ++crapCounter; + ++doubleSyncCounter; waitTime += m_renderTimer.elapsed(); ++waitCounter; if (waitCounter > 99) { - qDebug() << "mean vsync wait time:" << float((float)waitTime / (float)waitCounter) << crapCounter << "/100"; - crapCounter = waitTime = waitCounter = 0; + qDebug() << "mean vsync wait time:" << float((float)waitTime / (float)waitCounter) << doubleSyncCounter << "/100"; + doubleSyncCounter = waitTime = waitCounter = 0; } #endif } @@ -590,7 +591,7 @@ void SceneOpenGL::flushBuffer(int mask, QRegion damage) } } else { if (glXSwapInterval) { - glXSwapInterval(1); + glXSwapInterval(options->isGlVSync() ? 1 : 0); glXSwapBuffers(display(), glxbuffer); glXSwapInterval(0); m_renderTimer.start(); // this is important so we don't assume to be loosing frames in the compositor timing calculation