summaryrefslogtreecommitdiff
path: root/src/vcr.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2024-08-17 12:15:13 -0700
committerVito Caputo <vcaputo@pengaru.com>2024-08-27 08:21:11 -0700
commit399fb7a8f7ec4f7ce5cd7c910d8a8b7c7099db56 (patch)
treee96954a7c07a372ee36de9dd8b59383062fb5598 /src/vcr.h
parent62af39cb7181118d3d9c32e12aa0bcb7d273f4ee (diff)
vcr: represent mem backend layers in nibbles
This mostly works, but the maintenance of text shadows are a gross naive conversion of the pre-nibbles code. It would probably be better to add the shadows @ mem->png serialization time and not bother maintaining them at all for headless. It seems to work well enough to exercise and evaluate memory footprints though... The reason for "nibbles" is to save memory. Prior to this, the mem backend would use a byte per pixel of layer information. By not storing the background layer in this space, the current set of layers used can fit in 4 bits (aka a nibble). So this commit pivots to packing two pixels worth of layer data into each of those bytes, effectively cutting the memory requirements of the mem backend (headless mode) in half. It matters for embedded use cases. The next step from here to use substantially less memory in headless mode would require a deeper refactor where we don't maintain a bitmap style representation at all. It's doable, but not in the cards for my free time right now.
Diffstat (limited to 'src/vcr.h')
-rw-r--r--src/vcr.h9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/vcr.h b/src/vcr.h
index 089e79a..057d39f 100644
--- a/src/vcr.h
+++ b/src/vcr.h
@@ -35,15 +35,6 @@ typedef enum vcr_layer_t {
VCR_LAYER_SHADOW, /* the shadow layer below the text (XXX: this must be kept after text) */
VCR_LAYER_GRAPHA, /* the graph A layer below the shadow layer */
VCR_LAYER_GRAPHB, /* the graph B layer below the shadow layer */
- VCR_LAYER_BG, /* the background layer (row separators, with milestone breaks */
-#if 0
- /* It should be reasonable to support up to eight layers, so there's room to grow.
- * per-thread memory use seems like a good idea..
- */
- VCR_LAYER_UNUSED1, /* TODO */
- VCR_LAYER_UNUSED2, /* TODO */
- VCR_LAYER_UNUSED3, /* TODO */
-#endif
VCR_LAYER_CNT,
} vcr_layer_t;
© All Rights Reserved