diff options
author | Simon Ser <contact@emersion.fr> | 2022-09-17 14:37:52 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-11-15 16:30:00 +0000 |
commit | 6e88eeadebe5bed0210158124a3c498a8f8a47cb (patch) | |
tree | 83edd18ab44ea8fb34a4e8ad3a6c09d9c488a17f /include | |
parent | 8cfd44980baae8fdc3eb64461378cadd3362878b (diff) |
render/pixel_format: import pixel_format_info_check_stride()
We'll use this function from wlr_shm too.
Add some assertions, use int32_t (since the wire protocol uses that,
and we don't want to use 16-bit integers on exotic systems) and
switch the stride check to be overflow-safe.
Diffstat (limited to 'include')
-rw-r--r-- | include/render/pixel_format.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/render/pixel_format.h b/include/render/pixel_format.h index 471fa106..f5b67d03 100644 --- a/include/render/pixel_format.h +++ b/include/render/pixel_format.h @@ -19,6 +19,8 @@ struct wlr_pixel_format_info { }; const struct wlr_pixel_format_info *drm_get_pixel_format_info(uint32_t fmt); +bool pixel_format_info_check_stride(const struct wlr_pixel_format_info *info, + int32_t stride, int32_t width); uint32_t convert_wl_shm_format_to_drm(enum wl_shm_format fmt); enum wl_shm_format convert_drm_format_to_wl_shm(uint32_t fmt); |