mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 07:00:09 +01:00
core: Don't rebuild view list on surface-local changes
If a surface changes size or opaque region, or a view changes position, we don't need to rebuild the entire view list from scratch: we can just rebuild what's changed and nothing else. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
562a368fbd
commit
abfe874a51
3 changed files with 13 additions and 9 deletions
|
|
@ -111,9 +111,6 @@ static void
|
|||
subsurface_committed(struct weston_surface *surface,
|
||||
struct weston_coord_surface new_origin);
|
||||
|
||||
static void
|
||||
weston_view_geometry_dirty_internal(struct weston_view *view);
|
||||
|
||||
static bool
|
||||
weston_view_is_fully_blended(struct weston_view *ev,
|
||||
pixman_region32_t *region);
|
||||
|
|
@ -1884,7 +1881,7 @@ weston_view_update_transform(struct weston_view *view)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
weston_view_geometry_dirty_internal(struct weston_view *view)
|
||||
{
|
||||
struct weston_view *child;
|
||||
|
|
@ -1987,7 +1984,8 @@ weston_view_set_rel_position(struct weston_view *view,
|
|||
return;
|
||||
|
||||
view->geometry.pos_offset = offset.c;
|
||||
weston_view_geometry_dirty(view);
|
||||
weston_view_geometry_dirty_internal(view);
|
||||
weston_view_update_transform(view);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
|
|
@ -2002,7 +2000,8 @@ weston_view_set_position(struct weston_view *view,
|
|||
return;
|
||||
|
||||
view->geometry.pos_offset = pos.c;
|
||||
weston_view_geometry_dirty(view);
|
||||
weston_view_geometry_dirty_internal(view);
|
||||
weston_view_update_transform(view);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
|
|
@ -2373,7 +2372,7 @@ surface_set_size(struct weston_surface *surface, int32_t width, int32_t height)
|
|||
surface->height = height;
|
||||
|
||||
wl_list_for_each(view, &surface->views, surface_link)
|
||||
weston_view_geometry_dirty(view);
|
||||
weston_view_geometry_dirty_internal(view);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
|
|
|
|||
|
|
@ -554,6 +554,9 @@ bool
|
|||
weston_view_takes_input_at_point(struct weston_view *view,
|
||||
struct weston_coord_surface surf_pos);
|
||||
|
||||
void
|
||||
weston_view_geometry_dirty_internal(struct weston_view *view);
|
||||
|
||||
void
|
||||
weston_paint_node_move_to_plane(struct weston_paint_node *pnode,
|
||||
struct weston_plane *plane);
|
||||
|
|
|
|||
|
|
@ -340,8 +340,10 @@ weston_surface_apply_state(struct weston_surface *surface,
|
|||
|
||||
if (!pixman_region32_equal(&opaque, &surface->opaque)) {
|
||||
pixman_region32_copy(&surface->opaque, &opaque);
|
||||
wl_list_for_each(view, &surface->views, surface_link)
|
||||
weston_view_geometry_dirty(view);
|
||||
wl_list_for_each(view, &surface->views, surface_link) {
|
||||
weston_view_geometry_dirty_internal(view);
|
||||
weston_view_update_transform(view);
|
||||
}
|
||||
}
|
||||
|
||||
pixman_region32_fini(&opaque);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue