wayland: Reduce number of unneccessary display flushes

b48781aa6c fixed multiple bugs where the
display wasn't flushed correctly, however it was a little overzealous.

Some of the flushes were added after calls that only updated internal
state, some in internal functions in which the caller was already going
to flush, and some were after wayland protocol calls that are double
buffered anyway and won't do anything until a following commit.

Also, I've removes at least one long standing flush where the recently
added flush is in a better location than the original.
This commit is contained in:
Derek Foreman 2018-01-18 17:21:27 -06:00
parent 79f3eaa68b
commit 520821e432
5 changed files with 1 additions and 18 deletions

View File

@ -749,7 +749,6 @@ _ecore_wl2_buffer_test(Ecore_Wl2_Display *ewd)
zwp_linux_buffer_params_v1_add_listener(dp, &params_listener, ewd);
zwp_linux_buffer_params_v1_create(dp, buf->w, buf->h,
DRM_FORMAT_ARGB8888, 0);
ecore_wl2_display_flush(ewd);
ecore_wl2_buffer_destroy(buf);

View File

@ -1652,7 +1652,6 @@ _ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id, unsigned int v
wl_data_device_manager_get_data_device(display->wl.data_device_manager,
input->wl.seat);
wl_data_device_add_listener(input->data.device, &_data_listener, input);
ecore_wl2_display_flush(input->display);
}
void

View File

@ -96,7 +96,6 @@ _ecore_wl2_output_add(Ecore_Wl2_Display *display, unsigned int id)
eina_inlist_append(display->outputs, EINA_INLIST_GET(output));
wl_output_add_listener(output->wl_output, &_output_listener, output);
ecore_wl2_display_flush(display);
}
void

View File

@ -106,7 +106,6 @@ ecore_wl2_subsurface_position_set(Ecore_Wl2_Subsurface *subsurface, int x, int y
subsurface->y = y;
wl_subsurface_set_position(subsurface->wl.subsurface, x, y);
ecore_wl2_display_flush(subsurface->parent->display);
}
EAPI void
@ -125,7 +124,6 @@ ecore_wl2_subsurface_place_above(Ecore_Wl2_Subsurface *subsurface, struct wl_sur
EINA_SAFETY_ON_NULL_RETURN(surface);
wl_subsurface_place_above(subsurface->wl.subsurface, surface);
ecore_wl2_display_flush(subsurface->parent->display);
}
EAPI void
@ -135,7 +133,6 @@ ecore_wl2_subsurface_place_below(Ecore_Wl2_Subsurface *subsurface, struct wl_sur
EINA_SAFETY_ON_NULL_RETURN(surface);
wl_subsurface_place_below(subsurface->wl.subsurface, surface);
ecore_wl2_display_flush(subsurface->parent->display);
}
EAPI void
@ -153,7 +150,6 @@ ecore_wl2_subsurface_sync_set(Ecore_Wl2_Subsurface *subsurface, Eina_Bool sync)
wl_subsurface_set_sync(subsurface->wl.subsurface);
else
wl_subsurface_set_desync(subsurface->wl.subsurface);
ecore_wl2_display_flush(subsurface->parent->display);
}
EAPI void
@ -186,5 +182,4 @@ ecore_wl2_subsurface_opaque_region_set(Ecore_Wl2_Subsurface *subsurface, int x,
}
else
wl_surface_set_opaque_region(subsurface->wl.surface, NULL);
ecore_wl2_display_flush(subsurface->parent->display);
}

View File

@ -414,7 +414,6 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
}
else
zwp_e_session_recovery_get_uuid(window->display->wl.session_recovery, window->surface);
ecore_wl2_display_flush(window->display);
}
}
@ -708,7 +707,6 @@ ecore_wl2_window_raise(Ecore_Wl2_Window *window)
window->set_config.geometry.w,
window->set_config.geometry.h, &states);
wl_array_release(&states);
ecore_wl2_display_flush(window->display);
}
}
@ -735,7 +733,6 @@ ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha)
window->opaque.h);
else
ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
ecore_wl2_display_flush(window->display);
}
EAPI void
@ -753,7 +750,6 @@ ecore_wl2_window_transparent_set(Ecore_Wl2_Window *window, Eina_Bool transparent
window->opaque.h);
else
ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
ecore_wl2_display_flush(window->display);
}
EAPI void
@ -1048,6 +1044,7 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
xdg_toplevel_set_minimized(window->xdg_toplevel);
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_minimized(window->zxdg_toplevel);
ecore_wl2_display_flush(window->display);
}
else
{
@ -1078,7 +1075,6 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
wl_array_release(&states);
}
}
ecore_wl2_display_flush(window->display);
}
EAPI void
@ -1169,7 +1165,6 @@ ecore_wl2_window_buffer_transform_set(Ecore_Wl2_Window *window, int transform)
EINA_SAFETY_ON_NULL_RETURN(window);
wl_surface_set_buffer_transform(window->surface, transform);
ecore_wl2_display_flush(window->display);
}
EAPI void
@ -1492,7 +1487,6 @@ _maximized_set(Ecore_Wl2_Window *window)
if (window->zxdg_toplevel)
zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel);
}
ecore_wl2_display_flush(window->display);
}
static void
@ -1515,7 +1509,6 @@ _fullscreen_set(Ecore_Wl2_Window *window)
if (window->zxdg_toplevel)
zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel);
}
ecore_wl2_display_flush(window->display);
}
static void
@ -1542,7 +1535,6 @@ _input_set(Ecore_Wl2_Window *window)
window->input_rect.w, window->input_rect.h);
wl_surface_set_input_region(window->surface, region);
wl_region_destroy(region);
ecore_wl2_display_flush(window->display);
}
static void
@ -1567,7 +1559,6 @@ _opaque_set(Ecore_Wl2_Window *window)
window->opaque.w, window->opaque.h);
wl_surface_set_opaque_region(window->surface, region);
wl_region_destroy(region);
ecore_wl2_display_flush(window->display);
}
EAPI void