From: Pekka Paalanen Date: Fri, 14 Mar 2014 12:38:11 +0000 (+0200) Subject: compositor: refactor more into weston_surface_attach X-Git-Tag: 1.4.91~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=bb2f3f2f919f153a384c3fd39090843e87dd5b80;p=platform%2Fupstream%2Fweston.git compositor: refactor more into weston_surface_attach Merge more code into a common function. No functional changes. At every site where weston_surface_set_size_from_buffer() was called, weston_surface_attach() was called first. Move all calls of set_size_from_buffer into weston_surface_attach. Signed-off-by: Pekka Paalanen --- diff --git a/src/compositor.c b/src/compositor.c index 98a4f6f..5e70e9e 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1478,6 +1478,8 @@ weston_surface_attach(struct weston_surface *surface, } surface->compositor->renderer->attach(surface, buffer); + + weston_surface_set_size_from_buffer(surface); } WL_EXPORT void @@ -2010,10 +2012,8 @@ weston_surface_commit(struct weston_surface *surface) surface->buffer_viewport = surface->pending.buffer_viewport; /* wl_surface.attach */ - if (surface->pending.buffer || surface->pending.newly_attached) { + if (surface->pending.buffer || surface->pending.newly_attached) weston_surface_attach(surface, surface->pending.buffer); - weston_surface_set_size_from_buffer(surface); - } if (surface->configure && surface->pending.newly_attached) surface->configure(surface, @@ -2236,10 +2236,8 @@ 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.buffer_ref.buffer || sub->cached.newly_attached) weston_surface_attach(surface, sub->cached.buffer_ref.buffer); - weston_surface_set_size_from_buffer(surface); - } weston_buffer_reference(&sub->cached.buffer_ref, NULL); if (surface->configure && sub->cached.newly_attached)