compositor: Refactor weston_output_mode_switch()

This breaks weston_output_mode_switch() into 3 functions:
weston_output_mode_set_native()
weston_output_mode_switch_to_temporary()
weston_output_mode_switch_to_native()

Differences from previous behaviour:
SET_NATIVE didn't set current_scale (now it does)
SET_TEMPORARY could set mode and scale independently - now it can't.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Derek Foreman
2014-11-04 10:47:33 -06:00
committed by Pekka Paalanen
parent 61a9bf5557
commit 6ae7bc982f
5 changed files with 123 additions and 106 deletions
+4 -8
View File
@@ -2247,12 +2247,8 @@ shell_surface_set_class(struct wl_client *client,
static void
restore_output_mode(struct weston_output *output)
{
if (output->original_mode ||
(int32_t)output->current_scale != output->original_scale)
weston_output_switch_mode(output,
output->native_mode,
output->native_scale,
WESTON_MODE_SWITCH_RESTORE_NATIVE);
if (output->original_mode)
weston_output_mode_switch_to_native(output);
}
static void
@@ -2876,8 +2872,8 @@ shell_configure_fullscreen(struct shell_surface *shsurf)
surf_height * surface->buffer_viewport.buffer.scale,
shsurf->fullscreen.framerate};
if (weston_output_switch_mode(output, &mode, surface->buffer_viewport.buffer.scale,
WESTON_MODE_SWITCH_SET_TEMPORARY) == 0) {
if (weston_output_mode_switch_to_temporary(output, &mode,
surface->buffer_viewport.buffer.scale) == 0) {
weston_view_set_position(shsurf->view,
output->x - surf_x,
output->y - surf_y);