diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2017-09-15 19:52:49 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2017-09-15 19:52:49 -0700 |
commit | 337440d4a0f141c036e057ecc4fe4f4b808ff9c0 (patch) | |
tree | 10c4050ad018832eca5060ef479a1abe9fc16048 /src/modules/plasma/plasma.c | |
parent | 37edf85c87a8a71eb00c205d8c97eebd6c8dcd25 (diff) |
modules/*: cease dividing stride by 4
Just cast buf to (void *) for the pointer arithmetic, stride is in
units of bytes and no assumptions should be made about its value
such as divisability by 4.
Diffstat (limited to 'src/modules/plasma/plasma.c')
-rw-r--r-- | src/modules/plasma/plasma.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/plasma/plasma.c b/src/modules/plasma/plasma.c index 71c5c13..245cf3c 100644 --- a/src/modules/plasma/plasma.c +++ b/src/modules/plasma/plasma.c @@ -89,7 +89,7 @@ static void plasma_prepare_frame(void *context, unsigned n_cpus, fb_fragment_t * static void plasma_render_fragment(void *context, fb_fragment_t *fragment) { plasma_context_t *ctxt = context; - unsigned stride = fragment->stride / 4, width = fragment->width, height = fragment->height; + unsigned width = fragment->width, height = fragment->height; int fw2 = FIXED_NEW(width / 2), fh2 = FIXED_NEW(height / 2); int x, y, cx, cy, dx2, dy2; uint32_t *buf = fragment->buf; @@ -148,7 +148,7 @@ static void plasma_render_fragment(void *context, fb_fragment_t *fragment) *buf = color2pixel(&c); } - buf += stride; + buf = ((void *)buf) + fragment->stride; } } |