[cogl] wayland: Add a cogl_wayland_onscreen_resize function
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] wayland: Add a cogl_wayland_onscreen_resize function
- Date: Fri, 13 Jan 2012 13:58:17 +0000 (UTC)
commit 8632c65e798b5cf40c9ee4411d6ae2c851bb21d7
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.
Reviewed-by: Robert Bragg <robert linux intel com>
cogl/cogl-onscreen.h | 7 +++++++
cogl/winsys/cogl-winsys-egl-wayland.c | 24 ++++++++++++++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index 9bcc769..12995ea 100644
--- a/cogl/cogl-onscreen.h
+++ b/cogl/cogl-onscreen.h
@@ -133,6 +133,13 @@ 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,
+ gint offset_x,
+ gint offset_y);
#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..46e144b 100644
--- a/cogl/winsys/cogl-winsys-egl-wayland.c
+++ b/cogl/winsys/cogl-winsys-egl-wayland.c
@@ -499,6 +499,30 @@ cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen)
return NULL;
}
+void
+cogl_wayland_onscreen_resize (CoglOnscreen *onscreen,
+ gint width,
+ gint height,
+ gint offset_x,
+ gint offset_y)
+{
+ 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,
+ offset_x,
+ offset_y);
+ _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]