diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/meson.build | 1 | ||||
-rw-r--r-- | render/pixel_format.c | 22 | ||||
-rw-r--r-- | render/shm_format.c | 24 | ||||
-rw-r--r-- | render/wlr_renderer.c | 2 |
4 files changed, 23 insertions, 26 deletions
diff --git a/render/meson.build b/render/meson.build index 0b75c5e1..3779e9e0 100644 --- a/render/meson.build +++ b/render/meson.build @@ -4,7 +4,6 @@ wlr_files += files( 'egl.c', 'drm_format_set.c', 'gbm_allocator.c', - 'shm_format.c', 'pixel_format.c', 'swapchain.c', 'wlr_renderer.c', diff --git a/render/pixel_format.c b/render/pixel_format.c index 4c4df3bc..05df2ba4 100644 --- a/render/pixel_format.c +++ b/render/pixel_format.c @@ -28,3 +28,25 @@ const struct wlr_pixel_format_info *drm_get_pixel_format_info(uint32_t fmt) { return NULL; } + +uint32_t convert_wl_shm_format_to_drm(enum wl_shm_format fmt) { + switch (fmt) { + case WL_SHM_FORMAT_XRGB8888: + return DRM_FORMAT_XRGB8888; + case WL_SHM_FORMAT_ARGB8888: + return DRM_FORMAT_ARGB8888; + default: + return (uint32_t)fmt; + } +} + +enum wl_shm_format convert_drm_format_to_wl_shm(uint32_t fmt) { + switch (fmt) { + case DRM_FORMAT_XRGB8888: + return WL_SHM_FORMAT_XRGB8888; + case DRM_FORMAT_ARGB8888: + return WL_SHM_FORMAT_ARGB8888; + default: + return (enum wl_shm_format)fmt; + } +} diff --git a/render/shm_format.c b/render/shm_format.c deleted file mode 100644 index cb3f7c01..00000000 --- a/render/shm_format.c +++ /dev/null @@ -1,24 +0,0 @@ -#include <drm_fourcc.h> -#include "render/shm_format.h" - -uint32_t convert_wl_shm_format_to_drm(enum wl_shm_format fmt) { - switch (fmt) { - case WL_SHM_FORMAT_XRGB8888: - return DRM_FORMAT_XRGB8888; - case WL_SHM_FORMAT_ARGB8888: - return DRM_FORMAT_ARGB8888; - default: - return (uint32_t)fmt; - } -} - -enum wl_shm_format convert_drm_format_to_wl_shm(uint32_t fmt) { - switch (fmt) { - case DRM_FORMAT_XRGB8888: - return WL_SHM_FORMAT_XRGB8888; - case DRM_FORMAT_ARGB8888: - return WL_SHM_FORMAT_ARGB8888; - default: - return (enum wl_shm_format)fmt; - } -} diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 7e62cad1..027c5cf9 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -9,7 +9,7 @@ #include <wlr/types/wlr_matrix.h> #include <wlr/util/log.h> #include "util/signal.h" -#include "render/shm_format.h" +#include "render/pixel_format.h" #include "render/wlr_renderer.h" #include "backend/backend.h" |