1
0
Fork 0

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>
This commit is contained in:
Rob Bradford 2012-01-12 14:49:27 +00:00 committed by Robert Bragg
parent e28db24f7d
commit 8632c65e79
2 changed files with 31 additions and 0 deletions

View file

@ -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

View file

@ -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 =
{