mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-08 13:29:45 -05:00
render/pixel_format: make wlr_pixel_format_info part of the public API
This commit is contained in:
parent
4a4c8ca320
commit
ae43cf93dd
16 changed files with 67 additions and 59 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#include <drm_fourcc.h>
|
||||
#include "render/pixel_format.h"
|
||||
#include <wlr/render/pixel_format.h>
|
||||
|
||||
static const struct wlr_pixel_format_info pixel_format_info[] = {
|
||||
{
|
||||
|
|
@ -133,7 +133,8 @@ static const struct wlr_pixel_format_info pixel_format_info[] = {
|
|||
static const size_t pixel_format_info_size =
|
||||
sizeof(pixel_format_info) / sizeof(pixel_format_info[0]);
|
||||
|
||||
const struct wlr_pixel_format_info *drm_get_pixel_format_info(uint32_t fmt) {
|
||||
const struct wlr_pixel_format_info *wlr_pixel_format_info_from_drm(
|
||||
uint32_t fmt) {
|
||||
for (size_t i = 0; i < pixel_format_info_size; ++i) {
|
||||
if (pixel_format_info[i].drm_format == fmt) {
|
||||
return &pixel_format_info[i];
|
||||
|
|
@ -143,7 +144,7 @@ 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) {
|
||||
uint32_t wlr_convert_wl_shm_format_to_drm(enum wl_shm_format fmt) {
|
||||
switch (fmt) {
|
||||
case WL_SHM_FORMAT_XRGB8888:
|
||||
return DRM_FORMAT_XRGB8888;
|
||||
|
|
@ -154,7 +155,7 @@ 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) {
|
||||
enum wl_shm_format wlr_convert_drm_format_to_wl_shm(uint32_t fmt) {
|
||||
switch (fmt) {
|
||||
case DRM_FORMAT_XRGB8888:
|
||||
return WL_SHM_FORMAT_XRGB8888;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue