struct ds_subsurface *
ds_subsurface_from_resource(struct wl_resource *resource);
+struct ds_subsurface *ds_subsurface_from_surface(struct ds_surface *surface);
+
#ifdef __cplusplus
}
#endif
struct ds_surface *surface, struct ds_surface *parent,
uint32_t version, uint32_t id);
-struct ds_subsurface *
-subsurface_from_ds_surface(struct ds_surface *surface);
-
struct ds_surface *
subsurface_get_parent(struct ds_subsurface *subsurface);
return subsurface->parent;
}
-struct ds_subsurface *
-subsurface_from_ds_surface(struct ds_surface *surface)
+WL_EXPORT struct ds_subsurface *
+ds_subsurface_from_surface(struct ds_surface *surface)
{
- DS_ASSERT(ds_surface_is_subsurface(surface));
+ if (!ds_surface_is_subsurface(surface))
+ return NULL;
return (struct ds_subsurface *)surface->role_data;
}
do {
if (iter->synchronized)
return true;
- } while ((iter = subsurface_from_ds_surface(iter->parent)));
+ } while ((iter = ds_subsurface_from_surface(iter->parent)));
return false;
}
while (target_surface &&
ds_surface_is_subsurface(target_surface)) {
- target_subsurface = subsurface_from_ds_surface(target_surface);
+ target_subsurface = ds_subsurface_from_surface(target_surface);
if (!target_subsurface)
break;
struct ds_subsurface *subsurface;
while (ds_surface_is_subsurface(surface)) {
- subsurface = subsurface_from_ds_surface(surface);
+ subsurface = ds_subsurface_from_surface(surface);
if (!subsurface)
break;
ds_dbg("ds_surface(%p) commit", surface);
if (ds_surface_is_subsurface(surface)) {
- subsurface = subsurface_from_ds_surface(surface);
+ subsurface = ds_subsurface_from_surface(surface);
subsurface_commit(subsurface);
return;
}