Skip to content

Draft: compositor: add state transactions

Kirill Primak requested to merge vyivel/wlroots:surface-transactions into master

Rough overview:

  • A state group is a group of cached states which must be committed at the same time
  • A transaction is a short-lived set of cached states
    • Constructed by merging multiple state locks, right before committing
    • Committed alongside an optional pending state
      • An optimization to allow applying the pending state directly
    • Committing is optimized to avoid creating a state group when possible
      • An empty transaction
      • A transaction with only one state
      • A transaction which can be applied immediately
    • Uses an external array of surface pointers to avoid excessive reallocations

TODO:

  • Transaction API documentation
  • transaction_commit() documentation
  • More testing

Breaking changes

  • wlr_surface_lock_pending() and wlr_surface_unlock_cached() have been removed. Instead, a new state lock API is introduced.

randfall branch for debugging: https://gitlab.freedesktop.org/vyivel/randfall/-/tree/dbg-txn

Edited by Kirill Primak

Merge request reports