[cogl/rbradford/cogl-wayland-resize] wayland: Add a cogl_wayland_onscreen_resize function



commit 9ae0820550fee9126f319b7b487eb24856cb565b
Author: Rob Bradford <rob linux intel com>
Date:   Thu Jan 12 14:49:27 2012 +0000

    wayland: Add a cogl_wayland_onscreen_resize function
    
    This function will call into the Wayland EGL platform API and resize the
    surface that the window is using and update the internal dimensions for
    framebuffer and viewport to reflect the change.

 cogl/cogl-onscreen.h                  |    5 +++++
 cogl/winsys/cogl-winsys-egl-wayland.c |   22 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index 9bcc769..31b3f52 100644
--- a/cogl/cogl-onscreen.h
+++ b/cogl/cogl-onscreen.h
@@ -133,6 +133,11 @@ struct wl_surface *
 cogl_wayland_onscreen_get_surface (CoglOnscreen *onscreen);
 struct wl_shell_surface *
 cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen);
+
+void
+cogl_wayland_onscreen_resize (CoglOnscreen *onscreen,
+                              gint          width,
+                              gint          height);
 #endif /* COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT */
 
 #define cogl_onscreen_set_swap_throttled cogl_onscreen_set_swap_throttled_EXP
diff --git a/cogl/winsys/cogl-winsys-egl-wayland.c b/cogl/winsys/cogl-winsys-egl-wayland.c
index 0b7ff26..07a9a1b 100644
--- a/cogl/winsys/cogl-winsys-egl-wayland.c
+++ b/cogl/winsys/cogl-winsys-egl-wayland.c
@@ -499,6 +499,28 @@ cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen)
     return NULL;
 }
 
+void
+cogl_wayland_onscreen_resize (CoglOnscreen *onscreen,
+                              gint          width,
+                              gint          height)
+{
+  CoglFramebuffer *fb;
+
+  fb = COGL_FRAMEBUFFER (onscreen);
+  if (fb->allocated)
+    {
+      CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
+      CoglOnscreenWayland *wayland_onscreen = egl_onscreen->platform;
+
+      wl_egl_window_resize (wayland_onscreen->wayland_egl_native_window,
+                            width,
+                            height,
+                            0,
+                            0);
+       _cogl_framebuffer_winsys_update_size (fb, width, height);
+    }
+}
+
 static const CoglWinsysEGLVtable
 _cogl_winsys_egl_vtable =
   {



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