Remove the wl_visual interface

The visual interface was meant to be a generic mechanism for
specifying the content of a buffer.  It goes back to before we had the
buffer factory interfaces (like wl_drm and wl_shm) and we wanted to
keep it open-ended enough that yuv, png or even svg buffer or so would
be possible.

Now that we have the buffer abstraction, we can add different buffer
types by introducing new interfaces that create buffers.  It only
makes sense to leave it to those interfaces to specify the contents of
the buffers.

For wl_shm, this means that we now just specify the pixel format using
an enum.  For EGL buffers, the exact pixel formats are controlled by
the implementation (part of wl_drm and similar), and from the client
point of view, everything is controlled using EGLConfigs.
This commit is contained in:
Kristian Høgsberg 2011-08-30 21:26:19 -04:00
parent f9c8a691b2
commit c640571c00
5 changed files with 50 additions and 88 deletions

View file

@ -858,28 +858,6 @@ compositor_bind(struct wl_client *client,
compositor->interface, id, compositor);
if (resource == NULL)
return;
wl_resource_post_event(resource,
WL_COMPOSITOR_TOKEN_VISUAL,
compositor->argb_visual.name,
WL_COMPOSITOR_VISUAL_ARGB32);
wl_resource_post_event(resource,
WL_COMPOSITOR_TOKEN_VISUAL,
compositor->premultiplied_argb_visual.name,
WL_COMPOSITOR_VISUAL_PREMULTIPLIED_ARGB32);
wl_resource_post_event(resource,
WL_COMPOSITOR_TOKEN_VISUAL,
compositor->rgb_visual.name,
WL_COMPOSITOR_VISUAL_XRGB32);
}
static void
bind_visual(struct wl_client *client,
void *data, uint32_t version, uint32_t id)
{
wl_client_add_object(client, &wl_visual_interface, NULL, id, data);
}
WL_EXPORT int
@ -895,24 +873,5 @@ wl_compositor_init(struct wl_compositor *compositor,
if (!global)
return -1;
global = wl_display_add_global(display, &wl_visual_interface,
&compositor->argb_visual, bind_visual);
if (!global)
return -1;
compositor->argb_visual.name = global->name;
global = wl_display_add_global(display, &wl_visual_interface,
&compositor->premultiplied_argb_visual,
bind_visual);
if (!global)
return -1;
compositor->premultiplied_argb_visual.name = global->name;
global = wl_display_add_global(display, &wl_visual_interface,
&compositor->rgb_visual, bind_visual);
if (!global)
return -1;
compositor->rgb_visual.name = global->name;
return 0;
}