From 7e999e37a5cf65e466091f4d8eeb36a6cea20f52 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 8 Sep 2017 19:09:57 -0700 Subject: *: use fragment generator Rather than laying out all fragments in a frame up-front in ray_module_t.prepare_frame(), return a fragment generator (rototiller_fragmenter_t) which produces the numbered fragment as needed. This removes complexity from the serially-executed prepare_frame() and allows the individual fragments to be computed in parallel by the different threads. It also eliminates the need for a fragments array in the rototiller_frame_t, indeed rototiller_frame_t is eliminated altogether. --- src/rototiller.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rototiller.c') diff --git a/src/rototiller.c b/src/rototiller.c index 63881fe..c0a755b 100644 --- a/src/rototiller.c +++ b/src/rototiller.c @@ -59,11 +59,11 @@ static void module_select(int *module) static void module_render_page_threaded(rototiller_module_t *module, void *context, threads_t *threads, fb_page_t *page) { - rototiller_frame_t frame; + rototiller_fragmenter_t fragmenter; - module->prepare_frame(context, threads_num_threads(threads), &page->fragment, &frame); + module->prepare_frame(context, threads_num_threads(threads), &page->fragment, &fragmenter); - threads_frame_submit(threads, &frame, module->render_fragment, context); + threads_frame_submit(threads, &page->fragment, fragmenter, module->render_fragment, context); threads_wait_idle(threads); } -- cgit v1.2.1