[bitmap] check p_beats_sprixel, use text phase 2 when set #1496

pull/1499/head
nick black 4 years ago
parent 3c4d25a092
commit d7408cf5aa
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -58,6 +58,7 @@ typedef enum {
SPRIXCELL_CONTAINS_TRANS, // this cell has transparent pixels
SPRIXCELL_ANNIHILATED, // this cell has been wiped
SPRIXCELL_UNHIDDEN, // this cell needs be unwiped
SPRIXCELL_ANASTASIS, // this cell needs be revived
} sprixcell_e;
// there is a context-wide set of displayed pixel glyphs ("sprixels"); i.e.
@ -437,6 +438,7 @@ struct crender {
// declaration. save the foreground state when we go highcontrast.
unsigned hcfgblends: 8; // number of foreground blends prior to HIGHCONTRAST
unsigned sprixeled: 1; // have we passed through a sprixel?
unsigned p_beats_sprixel: 1; // did we solve for our glyph above the bitmap?
} s;
};

@ -791,16 +791,16 @@ init_banner(const notcurses* nc, const char* shortname_term){
printf(" on %s", shortname_term ? shortname_term : "?");
term_fg_palindex(nc, stdout, 12 % nc->tcache.colors);
if(nc->tcache.cellpixy && nc->tcache.cellpixx){
printf("\n %d rows (%dpx) %d cols (%dpx) (%sB) %d colors",
printf("\n %d rows (%dpx) %d cols (%dpx) (%sB) %zuB crend %d colors",
nc->stdplane->leny, nc->tcache.cellpixy,
nc->stdplane->lenx, nc->tcache.cellpixx,
bprefix(nc->stats.fbbytes, 1, prefixbuf, 0),
nc->tcache.colors);
sizeof(struct crender), nc->tcache.colors);
}else{
printf("\n %d rows %d cols (%sB) %d colors",
printf("\n %d rows %d cols (%sB) %zuB crend %d colors",
nc->stdplane->leny, nc->stdplane->lenx,
bprefix(nc->stats.fbbytes, 1, prefixbuf, 0),
nc->tcache.colors);
sizeof(struct crender), nc->tcache.colors);
}
if(nc->tcache.RGBflag){
putc('+', stdout);

@ -259,6 +259,7 @@ paint(const ncplane* p, struct crender* rvec, int dstleny, int dstlenx,
// if sprite_wipe_cell() fails, we presumably do not have the
// ability to wipe, and must reprint the character
if(sprite_wipe_cell(ncplane_notcurses_const(p), p->sprite, y, x)){
crender->s.p_beats_sprixel = 1;
crender->s.damaged = 1;
}
}else if(!crender->p){
@ -968,7 +969,7 @@ rasterize_sprixels(notcurses* nc, const ncpile* p, FILE* out){
// lastframe has *not yet been written to the screen*, i.e. it's only about to
// *become* the last frame rasterized.
static int
rasterize_core(notcurses* nc, const ncpile* p, FILE* out){
rasterize_core(notcurses* nc, const ncpile* p, FILE* out, unsigned phase){
struct crender* rvec = p->crender;
for(int y = nc->stdplane->absy ; y < p->dimy + nc->stdplane->absy ; ++y){
const int innery = y - nc->stdplane->absy;
@ -984,7 +985,7 @@ rasterize_core(notcurses* nc, const ncpile* p, FILE* out){
if(cell_wide_left_p(srccell)){
++x;
}
}else{
}else if(phase != 0 || !rvec[damageidx].s.p_beats_sprixel){
++nc->stats.cellemissions;
if(goto_location(nc, out, y, x)){
return -1;
@ -1090,7 +1091,7 @@ notcurses_rasterize_inner(notcurses* nc, const ncpile* p, FILE* out){
return -1;
}
//fprintf(stderr, "RASTERIZE CORE\n");
if(rasterize_core(nc, p, out)){
if(rasterize_core(nc, p, out, 0)){
return -1;
}
//fprintf(stderr, "RASTERIZE SPRIXELS\n");
@ -1098,7 +1099,7 @@ notcurses_rasterize_inner(notcurses* nc, const ncpile* p, FILE* out){
return -1;
}
//fprintf(stderr, "RASTERIZE CORE\n");
if(rasterize_core(nc, p, out)){
if(rasterize_core(nc, p, out, 1)){
return -1;
}
if(fflush(out)){

Loading…
Cancel
Save