diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2017-04-22 15:29:49 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2017-04-22 15:29:49 -0700 |
commit | d28ceb85a6b43a503c608116798945baab0e060f (patch) | |
tree | 1a96ae21cbab1ef8fdf831d588fd2c9477fb3f92 /src/modules/roto/roto.c | |
parent | 1ff4632e895202c4485818f6e748e773b6fd2859 (diff) |
*: add module context machinery
introduces create_context() and destroy_context() methods, and adds a
'void *context' first parameter to the module methods.
If a module doesn't supply create_context() then NULL is simply passed
around as the context, so trivial modules can continue to only implement
render_fragment().
A subsequent commit will update the modules to encapsulate their global
state in module-specific contexts.
Diffstat (limited to 'src/modules/roto/roto.c')
-rw-r--r-- | src/modules/roto/roto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c index b889a55..9c7ac18 100644 --- a/src/modules/roto/roto.c +++ b/src/modules/roto/roto.c @@ -154,7 +154,7 @@ static void init_roto(uint8_t texture[256][256], int32_t *costab, int32_t *sinta /* prepare a frame for concurrent rendering */ -static void roto_prepare_frame(unsigned n_cpus, fb_fragment_t *fragment, rototiller_frame_t *res_frame) +static void roto_prepare_frame(void *context, unsigned n_cpus, fb_fragment_t *fragment, rototiller_frame_t *res_frame) { static int initialized; @@ -174,7 +174,7 @@ static void roto_prepare_frame(unsigned n_cpus, fb_fragment_t *fragment, rototil /* Draw a rotating checkered 256x256 texture into fragment. (32-bit version) */ -static void roto32_render_fragment(fb_fragment_t *fragment) +static void roto32_render_fragment(void *context, fb_fragment_t *fragment) { int y_cos_r, y_sin_r, x_cos_r, x_sin_r, x_cos_r_init, x_sin_r_init, cos_r, sin_r; int x, y, stride = fragment->stride / 4, frame_width = fragment->frame_width, frame_height = fragment->frame_height; @@ -223,7 +223,7 @@ static void roto32_render_fragment(fb_fragment_t *fragment) /* Draw a rotating checkered 256x256 texture into fragment. (64-bit version) */ -static void roto64_render_fragment(fb_fragment_t *fragment) +static void roto64_render_fragment(void *context, fb_fragment_t *fragment) { int y_cos_r, y_sin_r, x_cos_r, x_sin_r, x_cos_r_init, x_sin_r_init, cos_r, sin_r; int x, y, stride = fragment->stride / 8, frame_width = fragment->frame_width, frame_height = fragment->frame_height, width = fragment->width; |