mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
wayland/dma-buf: Move should_send_modifiers() to the top
It's very much an auxiliary method; lets move it to where it belongs, according to HACKING.md. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1959>
This commit is contained in:
parent
43161c6660
commit
4c54b36126
@ -134,6 +134,27 @@ G_DEFINE_TYPE (MetaWaylandDmaBufBuffer, meta_wayland_dma_buf_buffer, G_TYPE_OBJE
|
|||||||
G_DEFINE_TYPE (MetaWaylandDmaBufManager, meta_wayland_dma_buf_manager,
|
G_DEFINE_TYPE (MetaWaylandDmaBufManager, meta_wayland_dma_buf_manager,
|
||||||
G_TYPE_OBJECT)
|
G_TYPE_OBJECT)
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
should_send_modifiers (MetaBackend *backend)
|
||||||
|
{
|
||||||
|
MetaSettings *settings = meta_backend_get_settings (backend);
|
||||||
|
|
||||||
|
if (meta_settings_is_experimental_feature_enabled (
|
||||||
|
settings, META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
|
if (META_IS_BACKEND_NATIVE (backend))
|
||||||
|
{
|
||||||
|
MetaRenderer *renderer = meta_backend_get_renderer (backend);
|
||||||
|
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
|
||||||
|
return meta_renderer_native_use_modifiers (renderer_native);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
compare_tranches (gconstpointer a,
|
compare_tranches (gconstpointer a,
|
||||||
gconstpointer b)
|
gconstpointer b)
|
||||||
@ -875,27 +896,6 @@ static const struct zwp_linux_dmabuf_v1_interface dma_buf_implementation =
|
|||||||
dma_buf_handle_get_surface_feedback,
|
dma_buf_handle_get_surface_feedback,
|
||||||
};
|
};
|
||||||
|
|
||||||
static gboolean
|
|
||||||
should_send_modifiers (MetaBackend *backend)
|
|
||||||
{
|
|
||||||
MetaSettings *settings = meta_backend_get_settings (backend);
|
|
||||||
|
|
||||||
if (meta_settings_is_experimental_feature_enabled (
|
|
||||||
settings, META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS))
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
#ifdef HAVE_NATIVE_BACKEND
|
|
||||||
if (META_IS_BACKEND_NATIVE (backend))
|
|
||||||
{
|
|
||||||
MetaRenderer *renderer = meta_backend_get_renderer (backend);
|
|
||||||
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
|
|
||||||
return meta_renderer_native_use_modifiers (renderer_native);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
send_modifiers (struct wl_resource *resource,
|
send_modifiers (struct wl_resource *resource,
|
||||||
MetaWaylandDmaBufFormat *format,
|
MetaWaylandDmaBufFormat *format,
|
||||||
|
Loading…
Reference in New Issue
Block a user