This make get the ds_subsurface from wl_subusrface resource.
Change-Id: I8290a812980773fbe82197eb2062470b2ed1c303
bool ds_surface_is_subsurface(struct ds_surface *surface);
+struct ds_subsurface *
+ds_subsurface_from_resource(struct wl_resource *resource);
+
#ifdef __cplusplus
}
#endif
return ds_surface_get_role(surface) == &subsurface_role;
}
+WL_EXPORT struct ds_subsurface *
+ds_subsurface_from_resource(struct wl_resource *resource)
+{
+ assert(wl_resource_instance_of(resource, &wl_subsurface_interface,
+ &subsurface_impl));
+ return wl_resource_get_user_data(resource);
+}
+
struct ds_subsurface *
ds_subsurface_from_ds_surface(struct ds_surface *surface)
{