Commit 948e0287 authored by Roman Gilg's avatar Roman Gilg Committed by Hans de Goede
Browse files

xwayland: Reuse viewport instead of recreating



When a viewport is already created we can reuse this object instead of
destroying it and getting a new one for updating the source rectangle and
destination size.
Signed-off-by: Roman Gilg's avatarRoman Gilg <subdiff@gmail.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent ded89300
......@@ -217,17 +217,13 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window,
struct xwl_output *xwl_output,
struct xwl_emulated_mode *emulated_mode)
{
/* If necessary disable old viewport to apply new settings */
if (xwl_window_has_viewport_enabled(xwl_window))
xwl_window_disable_viewport(xwl_window);
DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n",
emulated_mode->width, emulated_mode->height,
xwl_output->width, xwl_output->height);
xwl_window->viewport =
wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter,
xwl_window->surface);
if (!xwl_window_has_viewport_enabled(xwl_window)) {
DebugF("XWAYLAND: enabling viewport %dx%d -> %dx%d\n",
emulated_mode->width, emulated_mode->height,
xwl_output->width, xwl_output->height);
xwl_window->viewport = wp_viewporter_get_viewport(xwl_window->xwl_screen->viewporter,
xwl_window->surface);
}
wp_viewport_set_source(xwl_window->viewport,
wl_fixed_from_int(0),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment