mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-18 06:47:31 -04:00
compositor: wrap cached lock seq in struct
This improves type safety: the struct wlr_surface_cached_lock value can't be mixed with other integer values.
This commit is contained in:
parent
f3e1f7b2a7
commit
15b0adf59a
4 changed files with 20 additions and 13 deletions
|
|
@ -381,6 +381,13 @@ void wlr_surface_get_effective_damage(struct wlr_surface *surface,
|
|||
void wlr_surface_get_buffer_source_box(struct wlr_surface *surface,
|
||||
struct wlr_fbox *box);
|
||||
|
||||
/**
|
||||
* A lock preventing cached state from being applied.
|
||||
*/
|
||||
struct wlr_surface_cached_lock {
|
||||
uint32_t seq;
|
||||
};
|
||||
|
||||
/**
|
||||
* Acquire a lock for the pending surface state.
|
||||
*
|
||||
|
|
@ -390,7 +397,7 @@ void wlr_surface_get_buffer_source_box(struct wlr_surface *surface,
|
|||
*
|
||||
* Returns a surface commit sequence number for the cached state.
|
||||
*/
|
||||
uint32_t wlr_surface_lock_pending(struct wlr_surface *surface);
|
||||
struct wlr_surface_cached_lock wlr_surface_lock_pending(struct wlr_surface *surface);
|
||||
|
||||
/**
|
||||
* Release a lock for a cached state.
|
||||
|
|
@ -398,7 +405,7 @@ uint32_t wlr_surface_lock_pending(struct wlr_surface *surface);
|
|||
* Callers should not assume that the cached state will immediately be
|
||||
* committed. Another caller may still have an active lock.
|
||||
*/
|
||||
void wlr_surface_unlock_cached(struct wlr_surface *surface, uint32_t seq);
|
||||
void wlr_surface_unlock_cached(struct wlr_surface *surface, struct wlr_surface_cached_lock lock);
|
||||
|
||||
/**
|
||||
* Set the preferred buffer scale for the surface.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ struct wlr_subsurface {
|
|||
|
||||
struct wlr_subsurface_parent_state current, pending;
|
||||
|
||||
uint32_t cached_seq;
|
||||
struct wlr_surface_cached_lock cached_lock;
|
||||
bool has_cache;
|
||||
|
||||
bool synchronized;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue