[wayland] Invoke frame rendered callback on damaged windows
Introduces a new time counter on Compositor to indicate the elapsed time sine the compositor started.
This commit is contained in:
parent
659c416879
commit
fafa22d0c6
2 changed files with 17 additions and 0 deletions
|
@ -42,6 +42,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#endif
|
||||
#include "decorations/decoratedclient.h"
|
||||
|
||||
#if HAVE_WAYLAND
|
||||
#include <KWayland/Server/surface_interface.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <QtConcurrentRun>
|
||||
|
@ -667,6 +671,7 @@ void Compositor::performCompositing()
|
|||
if (repaints_region.isEmpty() && !windowRepaintsPending()) {
|
||||
m_scene->idle();
|
||||
m_timeSinceLastVBlank = fpsInterval - (options->vBlankTime() + 1); // means "start now"
|
||||
m_timeSinceStart += m_timeSinceLastVBlank;
|
||||
// Note: It would seem here we should undo suspended unredirect, but when scenes need
|
||||
// it for some reason, e.g. transformations or translucency, the next pass that does not
|
||||
// need this anymore and paints normally will also reset the suspended unredirect.
|
||||
|
@ -688,6 +693,17 @@ void Compositor::performCompositing()
|
|||
repaints_region = QRegion();
|
||||
|
||||
m_timeSinceLastVBlank = m_scene->paint(repaints, windows);
|
||||
m_timeSinceStart += m_timeSinceLastVBlank;
|
||||
|
||||
#if HAVE_WAYLAND
|
||||
if (kwinApp()->shouldUseWaylandForCompositing()) {
|
||||
for (Toplevel *win : damaged) {
|
||||
if (auto surface = win->surface()) {
|
||||
surface->frameRendered(m_timeSinceStart);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
compositeTimer.stop(); // stop here to ensure *we* cause the next repaint schedule - not some effect through m_scene->paint()
|
||||
|
||||
|
|
|
@ -239,6 +239,7 @@ private:
|
|||
bool m_finishing; // finish() sets this variable while shutting down
|
||||
bool m_starting; // start() sets this variable while starting
|
||||
qint64 m_timeSinceLastVBlank;
|
||||
qint64 m_timeSinceStart = 0;
|
||||
Scene *m_scene;
|
||||
bool m_bufferSwapPending;
|
||||
bool m_composeAtSwapCompletion;
|
||||
|
|
Loading…
Reference in a new issue