wayland/surface: Make ensure_cached_state() static
There is no reason for it to be public or have a return value. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2232>
This commit is contained in:
parent
e3f0efa065
commit
dea9f8bbfe
@ -966,10 +966,18 @@ cleanup:
|
|||||||
meta_wayland_surface_state_reset (state);
|
meta_wayland_surface_state_reset (state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ensure_cached_state (MetaWaylandSurface *surface)
|
||||||
|
{
|
||||||
|
if (!surface->cached_state)
|
||||||
|
surface->cached_state = g_object_new (META_TYPE_WAYLAND_SURFACE_STATE,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_surface_apply_cached_state (MetaWaylandSurface *surface)
|
meta_wayland_surface_apply_cached_state (MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
meta_wayland_surface_ensure_cached_state (surface);
|
ensure_cached_state (surface);
|
||||||
meta_wayland_surface_apply_state (surface, surface->cached_state);
|
meta_wayland_surface_apply_state (surface, surface->cached_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -979,15 +987,6 @@ meta_wayland_surface_get_pending_state (MetaWaylandSurface *surface)
|
|||||||
return surface->pending_state;
|
return surface->pending_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaWaylandSurfaceState *
|
|
||||||
meta_wayland_surface_ensure_cached_state (MetaWaylandSurface *surface)
|
|
||||||
{
|
|
||||||
if (!surface->cached_state)
|
|
||||||
surface->cached_state = g_object_new (META_TYPE_WAYLAND_SURFACE_STATE,
|
|
||||||
NULL);
|
|
||||||
return surface->cached_state;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_wayland_surface_commit (MetaWaylandSurface *surface)
|
meta_wayland_surface_commit (MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
@ -1010,17 +1009,15 @@ meta_wayland_surface_commit (MetaWaylandSurface *surface)
|
|||||||
*/
|
*/
|
||||||
if (meta_wayland_surface_should_cache_state (surface))
|
if (meta_wayland_surface_should_cache_state (surface))
|
||||||
{
|
{
|
||||||
MetaWaylandSurfaceState *cached_state;
|
ensure_cached_state (surface);
|
||||||
|
|
||||||
cached_state = meta_wayland_surface_ensure_cached_state (surface);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A new commit indicates a new content update, so any previous
|
* A new commit indicates a new content update, so any previous
|
||||||
* cached content update did not go on screen and needs to be discarded.
|
* cached content update did not go on screen and needs to be discarded.
|
||||||
*/
|
*/
|
||||||
meta_wayland_surface_state_discard_presentation_feedback (cached_state);
|
meta_wayland_surface_state_discard_presentation_feedback (surface->cached_state);
|
||||||
|
|
||||||
meta_wayland_surface_state_merge_into (pending, cached_state);
|
meta_wayland_surface_state_merge_into (pending, surface->cached_state);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -262,9 +262,6 @@ MetaWaylandSurface *meta_wayland_surface_create (MetaWaylandCompositor *composit
|
|||||||
MetaWaylandSurfaceState *
|
MetaWaylandSurfaceState *
|
||||||
meta_wayland_surface_get_pending_state (MetaWaylandSurface *surface);
|
meta_wayland_surface_get_pending_state (MetaWaylandSurface *surface);
|
||||||
|
|
||||||
MetaWaylandSurfaceState *
|
|
||||||
meta_wayland_surface_ensure_cached_state (MetaWaylandSurface *surface);
|
|
||||||
|
|
||||||
void meta_wayland_surface_apply_cached_state (MetaWaylandSurface *surface);
|
void meta_wayland_surface_apply_cached_state (MetaWaylandSurface *surface);
|
||||||
|
|
||||||
gboolean meta_wayland_surface_is_effectively_synchronized (MetaWaylandSurface *surface);
|
gboolean meta_wayland_surface_is_effectively_synchronized (MetaWaylandSurface *surface);
|
||||||
|
Loading…
Reference in New Issue
Block a user