From 5a0776f1fdc6b7780cd21d568150e804347a6f8a Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 14 Jun 2022 02:28:36 -0700 Subject: til: til_fb_fragment_t **fragment_ptr all the things Preparatory commit for enabling cloneable/swappable fragments There's an outstanding issue with the til_fb_page_t submission, see comments. Doesn't matter for now since cloning doesn't happen yet, but will need to be addressed before they do. --- src/modules/shapes/shapes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/modules/shapes') diff --git a/src/modules/shapes/shapes.c b/src/modules/shapes/shapes.c index 47bb8df..bce0a37 100644 --- a/src/modules/shapes/shapes.c +++ b/src/modules/shapes/shapes.c @@ -115,9 +115,11 @@ static til_module_context_t * shapes_create_context(unsigned seed, unsigned tick } -static void shapes_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t *fragment) +static void shapes_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr) { shapes_context_t *ctxt = (shapes_context_t *)context; + til_fb_fragment_t *fragment = *fragment_ptr; + unsigned size = MIN(fragment->frame_width, fragment->frame_height) * ctxt->setup.scale; unsigned xoff = (fragment->frame_width - size) >> 1; unsigned yoff = (fragment->frame_height - size) >> 1; -- cgit v1.2.3