weston_buffer: Change y_inverted to explicit origin enum

y_inverted meant that the buffer's origin was (0,0), and non-inverted
meant that the buffer's origin was (0,height). In practice, every buffer
was 'inverted' into our natural co-ordinate space that we use
everywhere.

Switch to using an explicit origin enum to make this more clear.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone
2022-01-15 17:36:02 +00:00
parent 6dcf3eac1f
commit 4f88b2655e
3 changed files with 18 additions and 9 deletions
+4 -1
View File
@@ -1191,7 +1191,10 @@ struct weston_buffer {
int32_t width, height;
uint32_t busy_count;
int y_inverted;
enum {
ORIGIN_TOP_LEFT, /* buffer content starts at (0,0) */
ORIGIN_BOTTOM_LEFT, /* buffer content starts at (0, height) */
} buffer_origin;
void *backend_private;
const struct pixel_format_info *pixel_format;