summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compositor.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 1642f63..00812f4 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1466,6 +1466,27 @@ compositor_create_surface(struct wl_client *client,
}
static void
+compositor_query_surface_formats(struct wl_client *client,
+ struct wl_resource *resource)
+{
+ uint32_t i;
+
+ static const uint32_t surface_formats[] = {
+ WL_BUFFER_FORMAT_ARGB32,
+ WL_BUFFER_FORMAT_XRGB32,
+ WL_BUFFER_FORMAT_NV12,
+ WL_BUFFER_FORMAT_YUV410,
+ WL_BUFFER_FORMAT_YUV411,
+ WL_BUFFER_FORMAT_YUV420,
+ WL_BUFFER_FORMAT_YUV422,
+ WL_BUFFER_FORMAT_YUV444
+ };
+
+ for (i = 0; i < ARRAY_LENGTH(surface_formats); i++)
+ wl_compositor_send_surface_format(resource, surface_formats[i]);
+}
+
+static void
destroy_region(struct wl_resource *resource)
{
struct weston_region *region =
@@ -1536,7 +1557,8 @@ compositor_create_region(struct wl_client *client,
static const struct wl_compositor_interface compositor_interface = {
compositor_create_surface,
- compositor_create_region
+ compositor_create_region,
+ compositor_query_surface_formats
};
WL_EXPORT void