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:
parent
e28db24f7d
commit
8632c65e79
@ -133,6 +133,13 @@ struct wl_surface *
|
|||||||
cogl_wayland_onscreen_get_surface (CoglOnscreen *onscreen);
|
cogl_wayland_onscreen_get_surface (CoglOnscreen *onscreen);
|
||||||
struct wl_shell_surface *
|
struct wl_shell_surface *
|
||||||
cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen);
|
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 */
|
#endif /* COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT */
|
||||||
|
|
||||||
#define cogl_onscreen_set_swap_throttled cogl_onscreen_set_swap_throttled_EXP
|
#define cogl_onscreen_set_swap_throttled cogl_onscreen_set_swap_throttled_EXP
|
||||||
|
@ -499,6 +499,30 @@ cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen)
|
|||||||
return NULL;
|
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
|
static const CoglWinsysEGLVtable
|
||||||
_cogl_winsys_egl_vtable =
|
_cogl_winsys_egl_vtable =
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user