From f92c1af24a26c8492d7bab848fdf072ca0cef1a7 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 18 Apr 2014 15:41:48 -0400 Subject: [PATCH] wayland-surface: Merge actor_surface_commit back in Since we do it unconditionally now, the code flows better if it's inline with commit_double_buffered_state. --- src/wayland/meta-wayland-surface.c | 37 ++++++++++++------------------ 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 44bdc8ce4..b14acb2b7 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -152,26 +152,6 @@ cursor_surface_commit (MetaWaylandSurface *surface, meta_wayland_seat_update_cursor_surface (surface->compositor->seat); } -static void -actor_surface_commit (MetaWaylandSurface *surface, - MetaWaylandDoubleBufferedState *pending) -{ - MetaSurfaceActor *surface_actor = surface->surface_actor; - - if (pending->newly_attached && pending->buffer) - { - ensure_buffer_texture (pending->buffer); - meta_surface_actor_wayland_set_buffer (META_SURFACE_ACTOR_WAYLAND (surface->surface_actor), pending->buffer); - } - - surface_process_damage (surface, pending->damage); - - if (pending->opaque_region) - meta_surface_actor_set_opaque_region (surface_actor, pending->opaque_region); - if (pending->input_region) - meta_surface_actor_set_input_region (surface_actor, pending->input_region); -} - static void toplevel_surface_commit (MetaWaylandSurface *surface, MetaWaylandDoubleBufferedState *pending) @@ -333,9 +313,22 @@ commit_double_buffered_state (MetaWaylandSurface *surface, } if (pending->newly_attached) - surface_set_buffer (surface, pending->buffer); + { + surface_set_buffer (surface, pending->buffer); - actor_surface_commit (surface, pending); + if (pending->buffer) + { + ensure_buffer_texture (pending->buffer); + meta_surface_actor_wayland_set_buffer (META_SURFACE_ACTOR_WAYLAND (surface->surface_actor), pending->buffer); + } + } + + surface_process_damage (surface, pending->damage); + + if (pending->opaque_region) + meta_surface_actor_set_opaque_region (surface->surface_actor, pending->opaque_region); + if (pending->input_region) + meta_surface_actor_set_input_region (surface->surface_actor, pending->input_region); if (surface == compositor->seat->pointer.cursor_surface) cursor_surface_commit (surface, pending);