diff options
Diffstat (limited to 'src/til_fb.h')
-rw-r--r-- | src/til_fb.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/til_fb.h b/src/til_fb.h index f6763e1..21699c2 100644 --- a/src/til_fb.h +++ b/src/til_fb.h @@ -162,9 +162,13 @@ static inline void _til_fb_fragment_fill(til_fb_fragment_t *fragment, uint32_t p /* TODO: there should be a fast-path for non-divided fragments where there's no stride to skip */ for (int y = 0; y < fragment->height; y++, buf += fragment->pitch) { - /* TODO: this should use something memset-like for perf */ - for (int x = 0; x < fragment->width; x++) - buf[x] = pixel; + if (!pixel) { + memset(buf, pixel, fragment->width * sizeof(pixel)); + } else { + /* TODO: this should use something memset-like for perf */ + for (int x = 0; x < fragment->width; x++) + buf[x] = pixel; + } } } |