surface-state: remove more subsurface specific paths

weston_subsurface_commit_to_cache and weston_subsurface_commit are
trivial functions with single call sites. Eliminate them.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2025-07-15 15:48:34 -05:00
parent f322b41b3d
commit 8966ea79fe

View file

@ -514,36 +514,23 @@ weston_surface_state_merge_from(struct weston_surface_state *dst,
src->status = WESTON_SURFACE_CLEAN;
}
static void
weston_subsurface_commit_to_cache(struct weston_subsurface *sub)
{
struct weston_surface *surface = sub->surface;
weston_surface_state_merge_from(&sub->cached,
&surface->pending,
surface);
}
static enum weston_surface_status
weston_subsurface_commit(struct weston_subsurface *sub)
{
weston_subsurface_commit_to_cache(sub);
if (sub->effectively_synchronized)
return WESTON_SURFACE_CLEAN;
return weston_surface_apply(sub->surface, &sub->cached);
}
enum weston_surface_status
weston_surface_commit(struct weston_surface *surface)
{
struct weston_subsurface *sub = weston_surface_to_subsurface(surface);
enum weston_surface_status status;
if (sub)
status = weston_subsurface_commit(sub);
else
if (sub) {
weston_surface_state_merge_from(&sub->cached,
&surface->pending,
surface);
if (sub->effectively_synchronized)
return WESTON_SURFACE_CLEAN;
status = weston_surface_apply(sub->surface, &sub->cached);
} else {
status = weston_surface_apply(surface, &surface->pending);
}
return status;
}