summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2019-11-24 11:26:23 -0800
committerVito Caputo <vcaputo@pengaru.com>2019-11-24 11:26:23 -0800
commit8f774980b9222f39f9e74e8e3a694cad55753e2f (patch)
treec971c4b954428109ceee9351fc751dda467e0ff3
parent53cc747fd2bdd774bc6f27f8aca5749c664b5cc7 (diff)
fb: add number to fb_fragment_t
This introduces a stricter coupling and requirement for modules supplying a fragmenter in their prepare_frame() to only receive fragments produced by *their* fragmenter at their render_fragment(). When modules don't explicitly perform any fragmenting they can't really make much use of this number as it will reflect an arbitrary fragmenting pass's perspective. But when modules do perform their own frame fragmenting, they can assume any fragment supplied to their render function will have been generated by it. This needs to be enforced a bit in the code. The current use case is montage using a fragmenter for tiling the montage in a threaded render. The fragment numbers map to the modules to be rendered in the tiles. As long as modules can assume their fragmenter will always be what produces their fragments, this is perfectly fine.
-rw-r--r--src/fb.c2
-rw-r--r--src/fb.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/fb.c b/src/fb.c
index a20fdd3..c37cc04 100644
--- a/src/fb.c
+++ b/src/fb.c
@@ -328,6 +328,7 @@ int fb_fragment_slice_single(const fb_fragment_t *fragment, unsigned n_fragments
res_fragment->frame_height = fragment->frame_height;
res_fragment->stride = fragment->stride;
res_fragment->pitch = fragment->pitch;
+ res_fragment->number = num;
return 1;
}
@@ -362,6 +363,7 @@ int fb_fragment_tile_single(const fb_fragment_t *fragment, unsigned tile_size, u
res_fragment->frame_height = fragment->frame_height;
res_fragment->stride = fragment->stride + ((fragment->width - res_fragment->width) * 4);
res_fragment->pitch = fragment->pitch;
+ res_fragment->number = num;
return 1;
}
diff --git a/src/fb.h b/src/fb.h
index dfd4550..300c134 100644
--- a/src/fb.h
+++ b/src/fb.h
@@ -18,6 +18,7 @@ typedef struct fb_fragment_t {
unsigned frame_height; /* height of the frame this fragment is part of */
unsigned stride; /* number of bytes from the end of one row to the start of the next */
unsigned pitch; /* number of bytes separating y from y + 1, including any padding */
+ unsigned number; /* this fragment's number as produced by fragmenting */
} fb_fragment_t;
/* This is a page handle object for page flip submission/life-cycle.
© All Rights Reserved