diff options
author | Simon Ser <contact@emersion.fr> | 2020-03-09 11:26:56 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-03-09 15:26:28 +0100 |
commit | a71649dde9d5a4ee772e6b6b3b65f3aba28bd18f (patch) | |
tree | c49e593f8960b0871342837c6febb2eb797d681b | |
parent | e7f8cc6801bc28ccc8aac8aabd2896cbeec8e369 (diff) |
render/gles2: remove duplicated format list
-rw-r--r-- | render/gles2/pixel_format.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/render/gles2/pixel_format.c b/render/gles2/pixel_format.c index a4b4c101..1258d8bc 100644 --- a/render/gles2/pixel_format.c +++ b/render/gles2/pixel_format.c @@ -41,13 +41,6 @@ static const struct wlr_gles2_pixel_format formats[] = { }, }; -static const enum wl_shm_format wl_formats[] = { - WL_SHM_FORMAT_ARGB8888, - WL_SHM_FORMAT_XRGB8888, - WL_SHM_FORMAT_ABGR8888, - WL_SHM_FORMAT_XBGR8888, -}; - // TODO: more pixel formats const struct wlr_gles2_pixel_format *get_gles2_format_from_wl( @@ -73,6 +66,10 @@ const struct wlr_gles2_pixel_format *get_gles2_format_from_gl( } const enum wl_shm_format *get_gles2_wl_formats(size_t *len) { - *len = sizeof(wl_formats) / sizeof(wl_formats[0]); + static enum wl_shm_format wl_formats[sizeof(formats) / sizeof(formats[0])]; + *len = sizeof(formats) / sizeof(formats[0]); + for (size_t i = 0; i < sizeof(formats) / sizeof(formats[0]); i++) { + wl_formats[i] = formats[i].wl_format; + } return wl_formats; } |