wayland/dma-buf: Don't use API meant for MetaWaylandSurface internally
What was actually done when calling meta_wayland_buffer_attach() was that the texture was realized, so just call the function `meta_wayland_dma_buf_realize_texture()` and call that. This is in preparation to change how meta_wayland_buffer_attach() work. https://gitlab.gnome.org/GNOME/mutter/issues/199
This commit is contained in:
parent
ef2153739c
commit
22a296f971
@ -65,9 +65,9 @@ struct _MetaWaylandDmaBufBuffer
|
||||
|
||||
G_DEFINE_TYPE (MetaWaylandDmaBufBuffer, meta_wayland_dma_buf_buffer, G_TYPE_OBJECT);
|
||||
|
||||
gboolean
|
||||
meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
GError **error)
|
||||
static gboolean
|
||||
meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer *buffer,
|
||||
GError **error)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaEgl *egl = meta_backend_get_egl (backend);
|
||||
@ -202,6 +202,14 @@ meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
CoglTexture **texture,
|
||||
GError **error)
|
||||
{
|
||||
return meta_wayland_dma_buf_realize_texture (buffer, error);
|
||||
}
|
||||
|
||||
static void
|
||||
buffer_params_add (struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
@ -374,7 +382,7 @@ buffer_params_create_common (struct wl_client *client,
|
||||
buffer = meta_wayland_buffer_from_resource (buffer_resource);
|
||||
|
||||
meta_wayland_buffer_realize (buffer);
|
||||
if (!meta_wayland_buffer_attach (buffer, &error))
|
||||
if (!meta_wayland_dma_buf_realize_texture (buffer, &error))
|
||||
{
|
||||
if (buffer_id == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user