From: Simon Glass <simon.glass@canonical.com>
Add a ctx parameter to scene_render_obj() to allow passing in a specific
vidconsole context. If NULL, the default context is used.
Update the caller accordingly.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
boot/scene.c | 4 ++--
boot/scene_internal.h | 3 ++-
boot/scene_txtin.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
@@ -969,7 +969,7 @@ int scene_arrange(struct scene *scn)
return 0;
}
-int scene_render_obj(struct scene *scn, uint id)
+int scene_render_obj(struct scene *scn, uint id, void *ctx)
{
struct scene_obj *obj;
int ret;
@@ -979,7 +979,7 @@ int scene_render_obj(struct scene *scn, uint id)
return log_msg_ret("obj", -ENOENT);
if (!(obj->flags & SCENEOF_HIDE)) {
- ret = scene_obj_render(obj, NULL, false);
+ ret = scene_obj_render(obj, ctx, false);
if (ret && ret != -ENOTSUPP)
return log_msg_ret("ren", ret);
}
@@ -348,9 +348,10 @@ int scene_send_click(struct scene *scn, int x, int y, struct expo_action *event)
*
* @scn: Scene containing the object
* @id: Object ID to render
+ * @ctx: Vidconsole context, or NULL to use default
* Returns: 0 if OK, -ENOENT if object not found, -ve on other error
*/
-int scene_render_obj(struct scene *scn, uint id);
+int scene_render_obj(struct scene *scn, uint id, void *ctx);
/**
* scene_render_deps() - Render an object and its dependencies
@@ -75,7 +75,7 @@ int scene_txtin_render_deps(struct scene *scn, struct scene_obj *obj,
ret = vidconsole_entry_restore(cons, &scn->entry_save);
if (ret)
return log_msg_ret("sav", ret);
- scene_render_obj(scn, tin->edit_id);
+ scene_render_obj(scn, tin->edit_id, NULL);
/* move cursor back to the correct position */
for (i = cls->num; i < cls->eol_num; i++)