From 659c4bd1339ecbd8d5c264b2bed848bbc940d157 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 25 Mar 2021 19:44:09 +0100 Subject: [PATCH] surface: inline surface_commit_pending It's only used at one call-site and doesn't increase indentation. Let's just inline the function to get rid of the indirection. --- types/wlr_surface.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/types/wlr_surface.c b/types/wlr_surface.c index a472b8446..0f1261ceb 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -457,24 +457,6 @@ static void surface_commit_state(struct wlr_surface *surface, wlr_signal_emit_safe(&surface->events.commit, surface); } -static void surface_commit_pending(struct wlr_surface *surface) { - if (!surface_state_finalize(surface, &surface->pending)) { - return; - } - - if (surface->role && surface->role->precommit) { - surface->role->precommit(surface); - } - - uint32_t next_seq = surface->pending.seq + 1; - if (surface->pending.cached_state_locks > 0 || !wl_list_empty(&surface->cached)) { - surface_cache_pending(surface); - } else { - surface_commit_state(surface, &surface->pending); - } - surface->pending.seq = next_seq; -} - static bool subsurface_is_synchronized(struct wlr_subsurface *subsurface) { while (subsurface != NULL) { if (subsurface->synchronized) { @@ -538,7 +520,21 @@ static void surface_commit(struct wl_client *client, subsurface_commit(subsurface); } - surface_commit_pending(surface); + if (!surface_state_finalize(surface, &surface->pending)) { + return; + } + + if (surface->role && surface->role->precommit) { + surface->role->precommit(surface); + } + + uint32_t next_seq = surface->pending.seq + 1; + if (surface->pending.cached_state_locks > 0 || !wl_list_empty(&surface->cached)) { + surface_cache_pending(surface); + } else { + surface_commit_state(surface, &surface->pending); + } + surface->pending.seq = next_seq; wl_list_for_each(subsurface, &surface->subsurfaces, parent_link) { subsurface_parent_commit(subsurface, false);