surface: move position and scale out of wlr_surface_state

This commit is contained in:
emersion 2018-06-28 23:49:40 +01:00
parent 233bfe2f4f
commit 78555abba3
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 120 additions and 90 deletions

View file

@ -32,8 +32,6 @@ struct wlr_surface_state {
int width, height; // in surface-local coordinates
int buffer_width, buffer_height;
int sx, sy; // in surface-local coordinates
pixman_region32_t damage; // in buffer-local coordinates
struct wl_listener buffer_destroy_listener;
};
@ -48,6 +46,21 @@ struct wlr_surface {
* or something went wrong with uploading the buffer.
*/
struct wlr_buffer *buffer;
/**
* The buffer position, in surface-local units.
*/
int sx, sy;
/**
* The last commit's buffer damage, in buffer-local coordinates. This
* contains both the damage accumulated by the client via
* `wlr_surface_state.surface_damage` and `wlr_surface_state.buffer_damage`.
* If the buffer has changed its size or moved, the whole buffer is
* damaged.
*
* This region needs to be scaled and transformed into output coordinates,
* just like the buffer's texture.
*/
pixman_region32_t buffer_damage;
/**
* `current` contains the current, committed surface state. `pending`
* accumulates state changes from the client between commits and shouldn't