From 57b54cda1d8a6b70f0e667a4b62e0ed60515029e Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 8 Aug 2021 05:57:27 -0400 Subject: [PATCH] pass ncpile down through to pixel_scroll #2010 --- src/lib/linux.c | 9 +++++++-- src/lib/render.c | 2 +- src/lib/sprite.h | 2 +- src/lib/termdesc.h | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lib/linux.c b/src/lib/linux.c index 1d1c8d33c..f6a791150 100644 --- a/src/lib/linux.c +++ b/src/lib/linux.c @@ -1,8 +1,13 @@ #include "linux.h" #include "internal.h" -void fbcon_scroll(tinfo* ti, int rows){ - // FIXME +void fbcon_scroll(const struct ncpile* p, tinfo* ti, int rows){ + if(ti->cellpixy){ + return; + } + int totalrows = ti->cellpixy * p->dimy; + // FIXME iterate from 0.. dimy - rows, copy from |rows| down + // FIXME clear out bottom |rows| rows } // auxvecs for framebuffer are 1B each for s->cellpxx * s->cellpxy elements, diff --git a/src/lib/render.c b/src/lib/render.c index dbe6c5032..a90c7a77c 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -888,7 +888,7 @@ rasterize_scrolls(ncpile* p, fbuf* f){ } } if(p->nc->tcache.pixel_scroll){ - p->nc->tcache.pixel_scroll(&p->nc->tcache, p->scrolls); + p->nc->tcache.pixel_scroll(p, &p->nc->tcache, p->scrolls); } if(goto_location(p->nc, f, p->dimy, 0)){ return -1; diff --git a/src/lib/sprite.h b/src/lib/sprite.h index da626436e..5b5140fa7 100644 --- a/src/lib/sprite.h +++ b/src/lib/sprite.h @@ -206,7 +206,7 @@ int fbcon_blit(struct ncplane* nc, int linesize, const void* data, int leny, int lenx, const struct blitterargs* bargs); int fbcon_draw(const tinfo* ti, const struct ncpile *p, sprixel* s, fbuf* f, int y, int x); -void fbcon_scroll(tinfo* ti, int rows); +void fbcon_scroll(const struct ncpile* p, tinfo* ti, int rows); typedef enum { // C=1 (disabling scrolling) was only introduced in 0.20.0, at the same diff --git a/src/lib/termdesc.h b/src/lib/termdesc.h index 7be60f883..1f0c4e330 100644 --- a/src/lib/termdesc.h +++ b/src/lib/termdesc.h @@ -164,7 +164,7 @@ typedef struct tinfo { // make a loaded graphic visible. only used with kitty. int (*pixel_commit)(fbuf* f, struct sprixel* s, unsigned noscroll); // scroll all graphics up. only used with fbcon. - void (*pixel_scroll)(struct tinfo*, int rows); + void (*pixel_scroll)(const struct ncpile* p, struct tinfo*, int rows); uint8_t* (*pixel_trans_auxvec)(const struct tinfo* ti); // create tranparent auxvec // sprixel parameters. there are several different sprixel protocols, of // which we support sixel and kitty. the kitty protocol is used based