[clutter] wayland: Support programmatically resizing the stage



commit dd64ad1e4209793c436ad1cb90ba18ec85bbe936
Author: Rob Bradford <rob linux intel com>
Date:   Fri Jan 20 15:49:16 2012 +0000

    wayland: Support programmatically resizing the stage
    
    This will call into Cogl and ask it to resize the framebuffer which will then
    update the underlying EGL surface.

 clutter/wayland/clutter-stage-wayland.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/clutter/wayland/clutter-stage-wayland.c b/clutter/wayland/clutter-stage-wayland.c
index 0555b2f..099a303 100644
--- a/clutter/wayland/clutter-stage-wayland.c
+++ b/clutter/wayland/clutter-stage-wayland.c
@@ -120,6 +120,18 @@ clutter_stage_wayland_set_fullscreen (ClutterStageWindow *stage_window,
 }
 
 static void
+clutter_stage_wayland_resize (ClutterStageWindow *stage_window,
+                              gint                width,
+                              gint                height)
+{
+  ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
+
+  /* Resize preserving top left */
+  cogl_wayland_onscreen_resize (stage_cogl->onscreen, width, height, 0, 0);
+  _clutter_stage_window_redraw (stage_window);
+}
+
+static void
 clutter_stage_wayland_init (ClutterStageWayland *stage_wayland)
 {
 }
@@ -131,6 +143,7 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
 
   iface->realize = clutter_stage_wayland_realize;
   iface->set_fullscreen = clutter_stage_wayland_set_fullscreen;
+  iface->resize = clutter_stage_wayland_resize;
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]