diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-03-14 14:38:12 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-01 16:46:40 -0700 |
commit | 260ba38fff92aa987a54945a238f2346736946d9 (patch) | |
tree | bef2d383d09e542305cbe2364fc759e5186705df /src/compositor.c | |
parent | bb2f3f2f919f153a384c3fd39090843e87dd5b80 (diff) | |
download | weston-260ba38fff92aa987a54945a238f2346736946d9.tar.gz |
compositor: buffer can be non-NULL only if newly_attached
There is no need for weston_subsurface_commit_to_cache() to leave the
pending.buffer set. Reset it to NULL.
This makes pending.buffer always NULL if pending.newly_attached == 0.
IOW, pending.buffer cannot be non-NULL unless
pending.newly_attached == 1.
Therefore no need to check pending.buffer nor cached.buffer_ref.buffer
for the weston_surface_attach() calls.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'src/compositor.c')
-rw-r--r-- | src/compositor.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compositor.c b/src/compositor.c index 5e70e9ec..c8543a22 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2006,13 +2006,15 @@ weston_surface_commit(struct weston_surface *surface) struct weston_view *view; pixman_region32_t opaque; + /* XXX: wl_viewport.set without an attach should call configure */ + /* wl_surface.set_buffer_transform */ /* wl_surface.set_buffer_scale */ /* wl_viewport.set */ surface->buffer_viewport = surface->pending.buffer_viewport; /* wl_surface.attach */ - if (surface->pending.buffer || surface->pending.newly_attached) + if (surface->pending.newly_attached) weston_surface_attach(surface, surface->pending.buffer); if (surface->configure && surface->pending.newly_attached) @@ -2236,7 +2238,7 @@ weston_subsurface_commit_from_cache(struct weston_subsurface *sub) surface->buffer_viewport = sub->cached.buffer_viewport; /* wl_surface.attach */ - if (sub->cached.buffer_ref.buffer || sub->cached.newly_attached) + if (sub->cached.newly_attached) weston_surface_attach(surface, sub->cached.buffer_ref.buffer); weston_buffer_reference(&sub->cached.buffer_ref, NULL); @@ -2314,6 +2316,10 @@ weston_subsurface_commit_to_cache(struct weston_subsurface *sub) } sub->cached.sx += surface->pending.sx; sub->cached.sy += surface->pending.sy; + + if (surface->pending.buffer) + wl_list_remove(&surface->pending.buffer_destroy_listener.link); + surface->pending.buffer = NULL; surface->pending.sx = 0; surface->pending.sy = 0; surface->pending.newly_attached = 0; |