Don't flush in SurfaceInterface::frameRendered()

Frame callbacks only indicate when the client can start rendering a new
frame, it's not meant to be precise. If the client wants to do some
black magic with frame scheduling and so on, it needs to use a protocol
such as presentation_time. This change removes the pointless flush to
prevent over-flushing client connections.
This commit is contained in:
Vlad Zahorodnii 2020-07-27 13:05:27 +03:00
parent 5efebc3a38
commit 3cf004b68e

View file

@ -426,7 +426,6 @@ QList<SurfaceInterface *> SurfaceInterface::surfaces()
void SurfaceInterface::frameRendered(quint32 msec) void SurfaceInterface::frameRendered(quint32 msec)
{ {
// notify all callbacks // notify all callbacks
const bool needsFlush = !d->current.frameCallbacks.isEmpty();
while (!d->current.frameCallbacks.isEmpty()) { while (!d->current.frameCallbacks.isEmpty()) {
KWaylandFrameCallback *frameCallback = d->current.frameCallbacks.takeFirst(); KWaylandFrameCallback *frameCallback = d->current.frameCallbacks.takeFirst();
frameCallback->send_done(msec); frameCallback->send_done(msec);
@ -439,9 +438,6 @@ void SurfaceInterface::frameRendered(quint32 msec)
} }
subSurface->d_func()->surface->frameRendered(msec); subSurface->d_func()->surface->frameRendered(msec);
} }
if (needsFlush) {
client()->flush();
}
} }
QMatrix4x4 SurfaceInterfacePrivate::buildSurfaceToBufferMatrix(const State *state) QMatrix4x4 SurfaceInterfacePrivate::buildSurfaceToBufferMatrix(const State *state)