fbcon_rebuild, necessary

pull/1953/head
nick black 3 years ago committed by nick black
parent a5b9a2ed42
commit 558a1652cf

@ -18,6 +18,15 @@ int fbcon_wipe(sprixel* s, int ycell, int xcell){
return -1;
}
int fbcon_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec){
(void)s;
(void)ycell;
(void)xcell;
(void)auxvec;
logerror("Not yet implemented\n");
return -1;
}
int fbcon_blit(struct ncplane* n, int linesize, const void* data,
int leny, int lenx, const struct blitterargs* bargs){
int cols = bargs->u.pixel.spx->dimx;
@ -84,9 +93,8 @@ int fbcon_draw(const struct ncpile *p, sprixel* s, FILE* out, int y, int x){
for(int l = 0 ; l < s->pixy ; ++l){
// FIXME pixel size isn't necessarily 4B, line isn't necessarily psize*pixx
size_t offset = ((l + y) * ti->pixx + x) * 4;
size_t lsize = ti->pixx * 4;
size_t lsize = s->pixx * 4;
uint8_t* tl = ti->linux_fbuffer + offset;
// FIXME draw line
const char* src = s->glyph + (l * s->pixx * 4);
memcpy(tl, src, lsize);
}

@ -170,6 +170,7 @@ int fbcon_wipe(sprixel* s, int ycell, int xcell);
int sixel_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec);
int kitty_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec);
int iterm_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec);
int fbcon_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec);
int kitty_rebuild_animation(sprixel* s, int ycell, int xcell, uint8_t* auxvec);
int sixel_draw(const struct ncpile *p, sprixel* s, FILE* out, int y, int x);
int kitty_draw(const struct ncpile *p, sprixel* s, FILE* out, int y, int x);

@ -112,12 +112,13 @@ setup_kitty_bitmaps(tinfo* ti, int fd, int sixel_maxy_pristine){
// kitty 0.19.3 didn't have C=1, and thus needs sixel_maxy_pristine. it also
// lacked animation, and thus requires the older interface.
static inline void
setup_fbcon_bitmaps(tinfo* ti){
// FIXME
setup_fbcon_bitmaps(tinfo* ti, int fd){
ti->pixel_rebuild = fbcon_rebuild;
ti->pixel_wipe = fbcon_wipe;
ti->pixel_draw = fbcon_draw;
ti->pixel_scrub = fbcon_scrub;
set_pixel_blitter(fbcon_blit);
sprite_init(ti, fd);
}
static bool
@ -554,7 +555,7 @@ apply_term_heuristics(tinfo* ti, const char* termname, int fd,
}
if(ti->linux_fb_fd >= 0){
termname = "Linux framebuffer";
setup_fbcon_bitmaps(ti);
setup_fbcon_bitmaps(ti, ti->linux_fb_fd);
}else{
termname = "Linux console";
}

Loading…
Cancel
Save