summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper/qwlcompositor.cpp
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-01-24 12:10:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-05 14:27:37 +0100
commita237778666666ab77c4e8e6b501cf0fbe7c9223e (patch)
treef5a435d3ccc8e49b4cbc696d0341a6ac831d3c1d /src/compositor/wayland_wrapper/qwlcompositor.cpp
parentc7d146428d0de9a19abe834a7bd0ae54c5b30327 (diff)
Improve the frame callbacks handling
Improve the way wl_surface's frame callbacks are handled. The sooner they are sent the better is for the clients, as they have more time to render the next frame, but reducing the time for the compositor to render its frame. The best compromise is probably to send them out after the compositor has issued its GL calls but before calling eglSwapBuffers(), and before the GPU actually draws anything. Rename the function to send the callbacks to only reflect its purpose, leaving the compositors free to choose when they want to send them. Change-Id: Ifcdfcad9e54b4d07d5c087898123ac724395a194 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/qwlcompositor.cpp')
-rw-r--r--src/compositor/wayland_wrapper/qwlcompositor.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp
index 8a7b1617d..7d5cd35f1 100644
--- a/src/compositor/wayland_wrapper/qwlcompositor.cpp
+++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp
@@ -242,16 +242,10 @@ Compositor::~Compositor()
delete m_display;
}
-void Compositor::frameFinished(Surface *surface)
-{
- if (surface && m_dirty_surfaces.contains(surface)) {
- m_dirty_surfaces.remove(surface);
- surface->sendFrameCallback();
- } else if (!surface) {
- QSet<Surface *> dirty = m_dirty_surfaces;
- m_dirty_surfaces.clear();
- foreach (Surface *surface, dirty)
- surface->sendFrameCallback();
+void Compositor::sendFrameCallbacks(QList<QWaylandSurface *> visibleSurfaces)
+{
+ foreach (QWaylandSurface *surface, visibleSurfaces) {
+ surface->handle()->sendFrameCallback();
}
}
@@ -294,7 +288,6 @@ void Compositor::destroySurface(Surface *surface)
dev->setKeyboardFocus(0);
m_surfaces.removeOne(surface);
- m_dirty_surfaces.remove(surface);
waylandCompositor()->surfaceAboutToBeDestroyed(surface->waylandSurface());
@@ -312,11 +305,6 @@ void Compositor::cleanupGraphicsResources()
m_destroyed_surfaces.clear();
}
-void Compositor::markSurfaceAsDirty(QtWayland::Surface *surface)
-{
- m_dirty_surfaces.insert(surface);
-}
-
void Compositor::destroyClient(WaylandClient *c)
{
wl_client *client = static_cast<wl_client *>(c);