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:
Jonas Ådahl 2019-02-08 11:44:00 +01:00
parent ef2153739c
commit 22a296f971

View File

@ -65,9 +65,9 @@ struct _MetaWaylandDmaBufBuffer
G_DEFINE_TYPE (MetaWaylandDmaBufBuffer, meta_wayland_dma_buf_buffer, G_TYPE_OBJECT); G_DEFINE_TYPE (MetaWaylandDmaBufBuffer, meta_wayland_dma_buf_buffer, G_TYPE_OBJECT);
gboolean static gboolean
meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer, meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer *buffer,
GError **error) GError **error)
{ {
MetaBackend *backend = meta_get_backend (); MetaBackend *backend = meta_get_backend ();
MetaEgl *egl = meta_backend_get_egl (backend); MetaEgl *egl = meta_backend_get_egl (backend);
@ -202,6 +202,14 @@ meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer,
return TRUE; 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 static void
buffer_params_add (struct wl_client *client, buffer_params_add (struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
@ -374,7 +382,7 @@ buffer_params_create_common (struct wl_client *client,
buffer = meta_wayland_buffer_from_resource (buffer_resource); buffer = meta_wayland_buffer_from_resource (buffer_resource);
meta_wayland_buffer_realize (buffer); 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) if (buffer_id == 0)
{ {