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
|
|
@ -15,6 +15,7 @@
|
|||
#include <wayland-util.h>
|
||||
#include <wlr/backend/interface.h>
|
||||
#include <wlr/interfaces/wlr_output.h>
|
||||
#include <wlr/render/pixel_format.h>
|
||||
#include <wlr/render/wlr_renderer.h>
|
||||
#include <wlr/types/wlr_matrix.h>
|
||||
#include <wlr/util/box.h>
|
||||
|
|
@ -25,7 +26,6 @@
|
|||
#include "backend/drm/drm.h"
|
||||
#include "backend/drm/iface.h"
|
||||
#include "backend/drm/util.h"
|
||||
#include "render/pixel_format.h"
|
||||
#include "render/drm_format_set.h"
|
||||
#include "render/swapchain.h"
|
||||
#include "render/wlr_renderer.h"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <wayland-util.h>
|
||||
#include <wlr/render/pixel_format.h>
|
||||
#include <wlr/render/wlr_renderer.h>
|
||||
#include <wlr/types/wlr_matrix.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
|
@ -14,7 +15,6 @@
|
|||
#include "backend/drm/util.h"
|
||||
#include "render/drm_format_set.h"
|
||||
#include "render/allocator/allocator.h"
|
||||
#include "render/pixel_format.h"
|
||||
#include "render/swapchain.h"
|
||||
#include "render/wlr_renderer.h"
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ struct wlr_drm_format *drm_plane_pick_render_format(
|
|||
uint32_t fmt = DRM_FORMAT_ARGB8888;
|
||||
if (!wlr_drm_format_set_has(&plane->formats, fmt, DRM_FORMAT_MOD_INVALID)) {
|
||||
const struct wlr_pixel_format_info *format_info =
|
||||
drm_get_pixel_format_info(fmt);
|
||||
wlr_pixel_format_info_from_drm(fmt);
|
||||
assert(format_info != NULL &&
|
||||
format_info->opaque_substitute != DRM_FORMAT_INVALID);
|
||||
fmt = format_info->opaque_substitute;
|
||||
|
|
@ -306,7 +306,7 @@ static struct wlr_drm_fb *drm_fb_create(struct wlr_drm_backend *drm,
|
|||
// The format isn't supported by the plane. Try stripping the alpha
|
||||
// channel, if any.
|
||||
const struct wlr_pixel_format_info *info =
|
||||
drm_get_pixel_format_info(attribs.format);
|
||||
wlr_pixel_format_info_from_drm(attribs.format);
|
||||
if (info != NULL && info->opaque_substitute != DRM_FORMAT_INVALID &&
|
||||
wlr_drm_format_set_has(formats, info->opaque_substitute, attribs.modifier)) {
|
||||
attribs.format = info->opaque_substitute;
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@
|
|||
#include <wlr/backend/interface.h>
|
||||
#include <wlr/interfaces/wlr_input_device.h>
|
||||
#include <wlr/interfaces/wlr_output.h>
|
||||
#include <wlr/render/pixel_format.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
||||
#include "backend/backend.h"
|
||||
#include "backend/wayland.h"
|
||||
#include "render/drm_format_set.h"
|
||||
#include "render/pixel_format.h"
|
||||
#include "render/wlr_renderer.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ static const struct wl_drm_listener legacy_drm_listener = {
|
|||
static void shm_handle_format(void *data, struct wl_shm *shm,
|
||||
uint32_t shm_format) {
|
||||
struct wlr_wl_backend *wl = data;
|
||||
uint32_t drm_format = convert_wl_shm_format_to_drm(shm_format);
|
||||
uint32_t drm_format = wlr_convert_wl_shm_format_to_drm(shm_format);
|
||||
wlr_drm_format_set_add(&wl->shm_formats, drm_format, DRM_FORMAT_MOD_INVALID);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@
|
|||
#include <wayland-client.h>
|
||||
|
||||
#include <wlr/interfaces/wlr_output.h>
|
||||
#include <wlr/render/pixel_format.h>
|
||||
#include <wlr/render/wlr_renderer.h>
|
||||
#include <wlr/types/wlr_matrix.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
||||
#include "backend/wayland.h"
|
||||
#include "render/pixel_format.h"
|
||||
#include "render/swapchain.h"
|
||||
#include "render/wlr_renderer.h"
|
||||
#include "util/signal.h"
|
||||
|
|
@ -178,7 +178,8 @@ static struct wl_buffer *import_dmabuf(struct wlr_wl_backend *wl,
|
|||
|
||||
static struct wl_buffer *import_shm(struct wlr_wl_backend *wl,
|
||||
struct wlr_shm_attributes *shm) {
|
||||
enum wl_shm_format wl_shm_format = convert_drm_format_to_wl_shm(shm->format);
|
||||
enum wl_shm_format wl_shm_format =
|
||||
wlr_convert_drm_format_to_wl_shm(shm->format);
|
||||
uint32_t size = shm->stride * shm->height;
|
||||
struct wl_shm_pool *pool = wl_shm_create_pool(wl->shm, shm->fd, size);
|
||||
if (pool == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue