mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-06 13:48:21 +02:00
surface-state: Only walk the paint node list once in surface_attach
We have to walk it once for the dirty buffer, but we can accumulate our changes along the way and walk it only once. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
501fdea28d
commit
dd74ed6db0
1 changed files with 6 additions and 5 deletions
|
|
@ -203,6 +203,7 @@ weston_surface_attach(struct weston_surface *surface,
|
|||
WESTON_TRACE_FUNC_FLOW(&surface->flow_id);
|
||||
struct weston_buffer *buffer = state->buffer_ref.buffer;
|
||||
struct weston_buffer *old_buffer = surface->buffer_ref.buffer;
|
||||
enum weston_paint_node_status pnode_changes = WESTON_PAINT_NODE_CLEAN;
|
||||
|
||||
if (!buffer) {
|
||||
if (weston_surface_is_mapped(surface)) {
|
||||
|
|
@ -223,6 +224,8 @@ weston_surface_attach(struct weston_surface *surface,
|
|||
return status;
|
||||
}
|
||||
|
||||
pnode_changes |= WESTON_PAINT_NODE_BUFFER_DIRTY;
|
||||
|
||||
/* Recalculate the surface size if the buffer dimensions or the
|
||||
* surface transforms (viewport, rotation/mirror, scale) have
|
||||
* changed. */
|
||||
|
|
@ -251,14 +254,12 @@ weston_surface_attach(struct weston_surface *surface,
|
|||
buffer->format_modifier != old_buffer->format_modifier) {
|
||||
surface->is_opaque = pixel_format_is_opaque(buffer->pixel_format);
|
||||
status |= WESTON_SURFACE_DIRTY_BUFFER_PARAMS;
|
||||
weston_surface_dirty_paint_nodes(surface,
|
||||
WESTON_PAINT_NODE_BUFFER_PARAMS_DIRTY);
|
||||
pnode_changes |= WESTON_PAINT_NODE_BUFFER_PARAMS_DIRTY;
|
||||
}
|
||||
|
||||
status |= WESTON_SURFACE_DIRTY_BUFFER;
|
||||
weston_surface_dirty_paint_nodes(surface,
|
||||
WESTON_PAINT_NODE_BUFFER_DIRTY);
|
||||
old_buffer = NULL;
|
||||
weston_surface_dirty_paint_nodes(surface, pnode_changes);
|
||||
|
||||
weston_buffer_reference(&surface->buffer_ref, buffer,
|
||||
BUFFER_MAY_BE_ACCESSED);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue