diff options
author | Simon Ser <contact@emersion.fr> | 2021-04-20 17:26:39 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-04-20 17:28:30 +0200 |
commit | 3173a4f353f990e96a49e5a24f0d8cf57b21176c (patch) | |
tree | 10a65a6621f916bd5d8791c33c3680f9b5779729 /sway | |
parent | Avoid creating zero-sized textures for titlebars (diff) | |
download | sway-3173a4f353f990e96a49e5a24f0d8cf57b21176c.tar.gz sway-3173a4f353f990e96a49e5a24f0d8cf57b21176c.tar.zst sway-3173a4f353f990e96a49e5a24f0d8cf57b21176c.zip |
Use cairo_image_surface_get_stride instead of guessing it
Diffstat (limited to 'sway')
-rw-r--r-- | sway/tree/container.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 47772b62..438ff157 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -554,7 +554,7 @@ static void update_title_texture(struct sway_container *con, | |||
554 | 554 | ||
555 | cairo_surface_flush(surface); | 555 | cairo_surface_flush(surface); |
556 | unsigned char *data = cairo_image_surface_get_data(surface); | 556 | unsigned char *data = cairo_image_surface_get_data(surface); |
557 | int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); | 557 | int stride = cairo_image_surface_get_stride(surface); |
558 | struct wlr_renderer *renderer = wlr_backend_get_renderer( | 558 | struct wlr_renderer *renderer = wlr_backend_get_renderer( |
559 | output->wlr_output->backend); | 559 | output->wlr_output->backend); |
560 | *texture = wlr_texture_from_pixels( | 560 | *texture = wlr_texture_from_pixels( |
@@ -1639,7 +1639,7 @@ static void update_marks_texture(struct sway_container *con, | |||
1639 | 1639 | ||
1640 | cairo_surface_flush(surface); | 1640 | cairo_surface_flush(surface); |
1641 | unsigned char *data = cairo_image_surface_get_data(surface); | 1641 | unsigned char *data = cairo_image_surface_get_data(surface); |
1642 | int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); | 1642 | int stride = cairo_image_surface_get_stride(surface); |
1643 | struct wlr_renderer *renderer = wlr_backend_get_renderer( | 1643 | struct wlr_renderer *renderer = wlr_backend_get_renderer( |
1644 | output->wlr_output->backend); | 1644 | output->wlr_output->backend); |
1645 | *texture = wlr_texture_from_pixels( | 1645 | *texture = wlr_texture_from_pixels( |