ivi-shell: simplify surface creation
The weston_surface passed to surface_create() should never be NULL. And other code already relies on that anyway, so just remove the check. Now surface_create() will never fail, so more checks can be removed. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
parent
c4fab1633b
commit
2c96bdbdbf
|
@ -1956,11 +1956,6 @@ surface_create(struct weston_surface *wl_surface, uint32_t id_surface)
|
||||||
struct ivi_layout *layout = get_instance();
|
struct ivi_layout *layout = get_instance();
|
||||||
struct ivi_layout_surface *ivisurf = NULL;
|
struct ivi_layout_surface *ivisurf = NULL;
|
||||||
|
|
||||||
if (wl_surface == NULL) {
|
|
||||||
weston_log("ivi_layout_surface_create: invalid argument\n");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ivisurf = xzalloc(sizeof *ivisurf);
|
ivisurf = xzalloc(sizeof *ivisurf);
|
||||||
|
|
||||||
wl_signal_init(&ivisurf->property_changed);
|
wl_signal_init(&ivisurf->property_changed);
|
||||||
|
@ -2003,10 +1998,8 @@ ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
|
||||||
|
|
||||||
ivisurf = surface_create(wl_surface, IVI_INVALID_ID);
|
ivisurf = surface_create(wl_surface, IVI_INVALID_ID);
|
||||||
|
|
||||||
if (ivisurf) {
|
ivisurf->weston_desktop_surface = surface;
|
||||||
ivisurf->weston_desktop_surface = surface;
|
wl_signal_emit(&layout->surface_notification.created, ivisurf);
|
||||||
wl_signal_emit(&layout->surface_notification.created, ivisurf);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ivisurf;
|
return ivisurf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -519,9 +519,6 @@ desktop_surface_added(struct weston_desktop_surface *surface,
|
||||||
weston_desktop_surface_get_surface(surface);
|
weston_desktop_surface_get_surface(surface);
|
||||||
|
|
||||||
layout_surface = ivi_layout_desktop_surface_create(weston_surf, surface);
|
layout_surface = ivi_layout_desktop_surface_create(weston_surf, surface);
|
||||||
if (!layout_surface) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ivisurf = xzalloc(sizeof *ivisurf);
|
ivisurf = xzalloc(sizeof *ivisurf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue