[mutter] wayland: return from toplevel commit early if no new buffer



commit acd50508dcaccd42759b493924e04f19ce8a4938
Author: Ray Strode <rstrode redhat com>
Date:   Tue Feb 16 15:42:59 2016 -0500

    wayland: return from toplevel commit early if no new buffer
    
    meta_wayland_surface_toplevel_commit has a lot of logic to handle
    a new buffer getting attached as part of the commit.  None of
    that code needs to run if there is no new buffer attached.
    
    This commit short-circuits that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761613

 src/wayland/meta-wayland-surface.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 129486c..aa98246 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -345,6 +345,12 @@ toplevel_surface_commit (MetaWaylandSurfaceRole  *surface_role,
 
   queue_surface_actor_frame_callbacks (surface, pending);
 
+  /* If there's no new buffer pending, then there's nothing else to
+   * do
+   */
+  if (!pending->newly_attached)
+    return;
+
   if (META_IS_WAYLAND_SURFACE_ROLE_WL_SHELL_SURFACE (surface->role))
     {
       /* For wl_shell, it's equivalent to an unmap. Semantics


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]