wayland: Rename DoubleBufferedState to PendingState
I was talking with other people and they became confused at the term "double-buffered", since we were also talking about double-buffering in general, e.g. swapping between two buffers. Instead, we'll adapt the "pending state" nomenclature that we already use for the field / variable names.
This commit is contained in:
parent
f92c1af24a
commit
db56a7cecb
@ -146,7 +146,7 @@ ensure_buffer_texture (MetaWaylandBuffer *buffer)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cursor_surface_commit (MetaWaylandSurface *surface,
|
cursor_surface_commit (MetaWaylandSurface *surface,
|
||||||
MetaWaylandDoubleBufferedState *pending)
|
MetaWaylandPendingState *pending)
|
||||||
{
|
{
|
||||||
if (pending->newly_attached)
|
if (pending->newly_attached)
|
||||||
meta_wayland_seat_update_cursor_surface (surface->compositor->seat);
|
meta_wayland_seat_update_cursor_surface (surface->compositor->seat);
|
||||||
@ -154,7 +154,7 @@ cursor_surface_commit (MetaWaylandSurface *surface,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
toplevel_surface_commit (MetaWaylandSurface *surface,
|
toplevel_surface_commit (MetaWaylandSurface *surface,
|
||||||
MetaWaylandDoubleBufferedState *pending)
|
MetaWaylandPendingState *pending)
|
||||||
{
|
{
|
||||||
if (pending->newly_attached)
|
if (pending->newly_attached)
|
||||||
{
|
{
|
||||||
@ -185,14 +185,13 @@ toplevel_surface_commit (MetaWaylandSurface *surface,
|
|||||||
static void
|
static void
|
||||||
surface_handle_pending_buffer_destroy (struct wl_listener *listener, void *data)
|
surface_handle_pending_buffer_destroy (struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
MetaWaylandDoubleBufferedState *state =
|
MetaWaylandPendingState *state = wl_container_of (listener, state, buffer_destroy_listener);
|
||||||
wl_container_of (listener, state, buffer_destroy_listener);
|
|
||||||
|
|
||||||
state->buffer = NULL;
|
state->buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
double_buffered_state_init (MetaWaylandDoubleBufferedState *state)
|
pending_state_init (MetaWaylandPendingState *state)
|
||||||
{
|
{
|
||||||
state->newly_attached = FALSE;
|
state->newly_attached = FALSE;
|
||||||
state->buffer = NULL;
|
state->buffer = NULL;
|
||||||
@ -208,7 +207,7 @@ double_buffered_state_init (MetaWaylandDoubleBufferedState *state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
double_buffered_state_destroy (MetaWaylandDoubleBufferedState *state)
|
pending_state_destroy (MetaWaylandPendingState *state)
|
||||||
{
|
{
|
||||||
MetaWaylandFrameCallback *cb, *next;
|
MetaWaylandFrameCallback *cb, *next;
|
||||||
|
|
||||||
@ -223,15 +222,15 @@ double_buffered_state_destroy (MetaWaylandDoubleBufferedState *state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
double_buffered_state_reset (MetaWaylandDoubleBufferedState *state)
|
pending_state_reset (MetaWaylandPendingState *state)
|
||||||
{
|
{
|
||||||
double_buffered_state_destroy (state);
|
pending_state_destroy (state);
|
||||||
double_buffered_state_init (state);
|
pending_state_init (state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
move_double_buffered_state (MetaWaylandDoubleBufferedState *from,
|
move_pending_state (MetaWaylandPendingState *from,
|
||||||
MetaWaylandDoubleBufferedState *to)
|
MetaWaylandPendingState *to)
|
||||||
{
|
{
|
||||||
if (from->buffer)
|
if (from->buffer)
|
||||||
wl_list_remove (&from->buffer_destroy_listener.link);
|
wl_list_remove (&from->buffer_destroy_listener.link);
|
||||||
@ -265,7 +264,7 @@ move_double_buffered_state (MetaWaylandDoubleBufferedState *from,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
subsurface_surface_commit (MetaWaylandSurface *surface,
|
subsurface_surface_commit (MetaWaylandSurface *surface,
|
||||||
MetaWaylandDoubleBufferedState *pending)
|
MetaWaylandPendingState *pending)
|
||||||
{
|
{
|
||||||
if (pending->newly_attached)
|
if (pending->newly_attached)
|
||||||
{
|
{
|
||||||
@ -295,8 +294,8 @@ parent_surface_committed (gpointer data, gpointer user_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
commit_double_buffered_state (MetaWaylandSurface *surface,
|
commit_pending_state (MetaWaylandSurface *surface,
|
||||||
MetaWaylandDoubleBufferedState *pending)
|
MetaWaylandPendingState *pending)
|
||||||
{
|
{
|
||||||
MetaWaylandCompositor *compositor = surface->compositor;
|
MetaWaylandCompositor *compositor = surface->compositor;
|
||||||
|
|
||||||
@ -308,7 +307,7 @@ commit_double_buffered_state (MetaWaylandSurface *surface,
|
|||||||
*/
|
*/
|
||||||
if (surface->sub.synchronous)
|
if (surface->sub.synchronous)
|
||||||
{
|
{
|
||||||
move_double_buffered_state (pending, &surface->sub.pending_surface_state);
|
move_pending_state (pending, &surface->sub.pending_surface_state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,13 +342,13 @@ commit_double_buffered_state (MetaWaylandSurface *surface,
|
|||||||
wl_list_insert_list (&compositor->frame_callbacks, &pending->frame_callback_list);
|
wl_list_insert_list (&compositor->frame_callbacks, &pending->frame_callback_list);
|
||||||
wl_list_init (&pending->frame_callback_list);
|
wl_list_init (&pending->frame_callback_list);
|
||||||
|
|
||||||
double_buffered_state_reset (pending);
|
pending_state_reset (pending);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_wayland_surface_commit (MetaWaylandSurface *surface)
|
meta_wayland_surface_commit (MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
commit_double_buffered_state (surface, &surface->pending);
|
commit_pending_state (surface, &surface->pending);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -581,7 +580,7 @@ wl_surface_destructor (struct wl_resource *resource)
|
|||||||
compositor->surfaces = g_list_remove (compositor->surfaces, surface);
|
compositor->surfaces = g_list_remove (compositor->surfaces, surface);
|
||||||
|
|
||||||
surface_set_buffer (surface, NULL);
|
surface_set_buffer (surface, NULL);
|
||||||
double_buffered_state_destroy (&surface->pending);
|
pending_state_destroy (&surface->pending);
|
||||||
|
|
||||||
g_object_unref (surface->surface_actor);
|
g_object_unref (surface->surface_actor);
|
||||||
|
|
||||||
@ -608,7 +607,7 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
|
|||||||
surface->buffer_destroy_listener.notify = surface_handle_buffer_destroy;
|
surface->buffer_destroy_listener.notify = surface_handle_buffer_destroy;
|
||||||
surface->surface_actor = g_object_ref_sink (meta_surface_actor_wayland_new (surface));
|
surface->surface_actor = g_object_ref_sink (meta_surface_actor_wayland_new (surface));
|
||||||
|
|
||||||
double_buffered_state_init (&surface->pending);
|
pending_state_init (&surface->pending);
|
||||||
return surface;
|
return surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1384,7 +1383,7 @@ bind_gtk_shell (struct wl_client *client,
|
|||||||
static void
|
static void
|
||||||
subsurface_parent_surface_committed (MetaWaylandSurface *surface)
|
subsurface_parent_surface_committed (MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
MetaWaylandDoubleBufferedState *pending_surface_state = &surface->sub.pending_surface_state;
|
MetaWaylandPendingState *pending_surface_state = &surface->sub.pending_surface_state;
|
||||||
|
|
||||||
if (surface->sub.pending_pos)
|
if (surface->sub.pending_pos)
|
||||||
{
|
{
|
||||||
@ -1433,7 +1432,7 @@ subsurface_parent_surface_committed (MetaWaylandSurface *surface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (surface->sub.synchronous)
|
if (surface->sub.synchronous)
|
||||||
commit_double_buffered_state (surface, pending_surface_state);
|
commit_pending_state (surface, pending_surface_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1458,7 +1457,7 @@ wl_subsurface_destructor (struct wl_resource *resource)
|
|||||||
surface->sub.parent = NULL;
|
surface->sub.parent = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
double_buffered_state_destroy (&surface->sub.pending_surface_state);
|
pending_state_destroy (&surface->sub.pending_surface_state);
|
||||||
destroy_surface_extension (&surface->subsurface);
|
destroy_surface_extension (&surface->subsurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1636,7 +1635,7 @@ wl_subcompositor_get_subsurface (struct wl_client *client,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double_buffered_state_init (&surface->sub.pending_surface_state);
|
pending_state_init (&surface->sub.pending_surface_state);
|
||||||
surface->sub.parent = parent;
|
surface->sub.parent = parent;
|
||||||
surface->sub.parent_destroy_listener.notify =
|
surface->sub.parent_destroy_listener.notify =
|
||||||
surface_handle_parent_surface_destroyed;
|
surface_handle_parent_surface_destroyed;
|
||||||
|
@ -61,7 +61,7 @@ typedef struct
|
|||||||
|
|
||||||
gboolean frame_extents_changed;
|
gboolean frame_extents_changed;
|
||||||
GtkBorder frame_extents;
|
GtkBorder frame_extents;
|
||||||
} MetaWaylandDoubleBufferedState;
|
} MetaWaylandPendingState;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ struct _MetaWaylandSurface
|
|||||||
struct wl_listener parent_destroy_listener;
|
struct wl_listener parent_destroy_listener;
|
||||||
|
|
||||||
gboolean synchronous;
|
gboolean synchronous;
|
||||||
MetaWaylandDoubleBufferedState pending_surface_state;
|
MetaWaylandPendingState pending_surface_state;
|
||||||
|
|
||||||
int32_t pending_x;
|
int32_t pending_x;
|
||||||
int32_t pending_y;
|
int32_t pending_y;
|
||||||
@ -100,8 +100,8 @@ struct _MetaWaylandSurface
|
|||||||
|
|
||||||
uint32_t state_changed_serial;
|
uint32_t state_changed_serial;
|
||||||
|
|
||||||
/* All the pending state, that wl_surface.commit will apply. */
|
/* All the pending state that wl_surface.commit will apply. */
|
||||||
MetaWaylandDoubleBufferedState pending;
|
MetaWaylandPendingState pending;
|
||||||
};
|
};
|
||||||
|
|
||||||
void meta_wayland_init_shell (MetaWaylandCompositor *compositor);
|
void meta_wayland_init_shell (MetaWaylandCompositor *compositor);
|
||||||
|
Loading…
Reference in New Issue
Block a user