From: Emilio Pozuelo Monfort <[email protected]>

This lets the compositor know the size of the surface as calculated
in weston_surface_set_size_from_buffer(), and fixes a couple of
tests when using the headless backend.

Signed-off-by: Emilio Pozuelo Monfort <[email protected]>
---
 src/noop-renderer.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/noop-renderer.c b/src/noop-renderer.c
index ad750b5..36d59be 100644
--- a/src/noop-renderer.c
+++ b/src/noop-renderer.c
@@ -49,6 +49,21 @@ noop_renderer_flush_damage(struct weston_surface *surface)
 static void
 noop_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
 {
+       struct wl_shm_buffer *shm_buffer;
+
+       if (!buffer)
+               return;
+
+       shm_buffer = wl_shm_buffer_get(buffer->resource);
+
+       if (!shm_buffer) {
+               weston_log("No-op renderer supports only SHM buffers\n");
+               return;
+       }
+
+       buffer->shm_buffer = shm_buffer;
+       buffer->width = wl_shm_buffer_get_width(shm_buffer);
+       buffer->height = wl_shm_buffer_get_height(shm_buffer);
 }
 
 static void
-- 
1.9.rc1

_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to