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/drm_fb.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/drm_fb.c') diff --git a/src/drm_fb.c b/src/drm_fb.c index 927f46c..a60f1e7 100644 --- a/src/drm_fb.c +++ b/src/drm_fb.c @@ -487,13 +487,15 @@ static void * drm_fb_page_alloc(til_fb_t *fb, void *context, til_fb_page_t *res_ p->drm_dumb_handle = map_dumb.handle; p->drm_fb_id = fb_id; - res_page->fragment.buf = map; - res_page->fragment.width = c->mode->hdisplay; - res_page->fragment.frame_width = c->mode->hdisplay; - res_page->fragment.height = c->mode->vdisplay; - res_page->fragment.frame_height = c->mode->vdisplay; - res_page->fragment.pitch = create_dumb.pitch >> 2; - res_page->fragment.stride = res_page->fragment.pitch - (c->mode->hdisplay); + *res_page = (til_fb_page_t){ + .fragment.buf = map, + .fragment.width = c->mode->hdisplay, + .fragment.frame_width = c->mode->hdisplay, + .fragment.height = c->mode->vdisplay, + .fragment.frame_height = c->mode->vdisplay, + .fragment.pitch = create_dumb.pitch >> 2, + .fragment.stride = (create_dumb.pitch >> 2) - c->mode->hdisplay, + }; return p; } -- cgit v1.2.1