summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2012-01-12 14:49:27 +0000
committerRob Bradford <rob@linux.intel.com>2012-01-12 16:32:38 +0000
commit1b9dc5f6d24d28f9b356a6798b438d2456ec3de4 (patch)
tree82d1dc46b2ee6754f2b9d92346b7bb53489cbbff
parente28db24f7d062601673f6ccd816c60dd326ecf19 (diff)
downloadcogl-rbradford/wayland-resize.tar.gz
wayland: Add a cogl_wayland_onscreen_resize functionrbradford/wayland-resize
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.
-rw-r--r--cogl/cogl-onscreen.h7
-rw-r--r--cogl/winsys/cogl-winsys-egl-wayland.c24
2 files changed, 31 insertions, 0 deletions
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index 9bcc7693..12995ea8 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 0b7ff260..eecacec6 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 =
{