summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-04-27 17:47:38 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-04-27 17:48:01 +0200
commit5837769cc352eb219153ed2f693fbf95804df2bc (patch)
tree6661ec9dc059070df68389bb700ef8e1002cf118
parent2aedd02f6f9ecfda274ba9a1cf8f9360e4074414 (diff)
compositor: implement query_surface_formats().old.01.yuv_buffers
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-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