From a59229c5513e73348c87bcfc5cc4b39a31012437 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 28 Apr 2022 01:46:10 -0700 Subject: til_fb: introduce a fragment texture source Idea here is to provide texture sources for obtaining pixel colors at the til_fb_put_pixel/fill drawing API, making it possible for at least overlayable modules to serve as mask/stencil operators where their drawn areas are populated by the contents of another fragment produced dynamically, potentially by other modules altogether. This commit adds a texture=modulename option to the compose module for specifying if a texture should be used when compositing, excepting and defaulting to "none" for disabling texturing. A future commit should expand this compose option to accept a potential list of modules for composing the texture in the same way as the main layers= list functions. Something this all immediately makes clear is the need for a better settings syntax, probably in the form of all module setting specifiers optionally being followed by a squence of settings, with support for escaping to handle nested situations. --- src/modules/blinds/blinds.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/modules/blinds') diff --git a/src/modules/blinds/blinds.c b/src/modules/blinds/blinds.c index b14997e..0a8342e 100644 --- a/src/modules/blinds/blinds.c +++ b/src/modules/blinds/blinds.c @@ -66,8 +66,11 @@ static inline void draw_blind_horizontal(til_fb_fragment_t *fragment, unsigned r unsigned row_height = fragment->frame_height / count; unsigned height = roundf(t * (float)row_height); - for (unsigned y = 0; y < height; y++) - memset(fragment->buf + ((row * row_height) + y ) * fragment->pitch, 0xff, fragment->width * 4); +/* XXX FIXME: use faster block style fill/copy if til_fb gets that */ + for (unsigned y = 0; y < height; y++) { + for (unsigned x = 0; x < fragment->width; x++) + til_fb_fragment_put_pixel_unchecked(fragment, fragment->x + x, fragment->y + y + row * row_height, 0xffffffff); + } } @@ -77,8 +80,11 @@ static inline void draw_blind_vertical(til_fb_fragment_t *fragment, unsigned col unsigned column_width = fragment->frame_width / count; unsigned width = roundf(t * (float)column_width); - for (unsigned y = 0; y < fragment->height; y++) - memset(fragment->buf + y * fragment->pitch + column * column_width, 0xff, width * 4); +/* XXX FIXME: use faster block style fill/copy if til_fb gets that */ + for (unsigned y = 0; y < fragment->height; y++) { + for (unsigned x = 0; x < width; x++) + til_fb_fragment_put_pixel_unchecked(fragment, fragment->x + x + column * column_width, fragment->y + y, 0xffffffff); + } } -- cgit v1.2.1