pool_load_direct(): don't check for full block

We used to set all four quadrant bits if a full block
came through pool_direct_load(). Since users of this
function are going to be explicitly setting the quadrant
bits themselves immediately after this call, there's no
point (except for manual writes of full blocks, but those
ought be uncommon enough not to tip the scales the other
way -- this optimization was directed at blitters).
About a 5% speedup in notcurses-demo. Originates in #1316.
pull/1338/head
nick black 4 years ago
parent 02c57186b4
commit d66042306f
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -979,11 +979,7 @@ static inline int
pool_load_direct(egcpool* pool, nccell* c, const char* gcluster, int bytes, int cols){
char* rtl = NULL;
c->width = cols;
if(bytes == 3 && memcmp(gcluster, "\xe2\x96\x88", 4) == 0){
c->channels |= CELL_NOBACKGROUND_MASK;
}else{
c->channels &= ~CELL_NOBACKGROUND_MASK;
}
c->channels &= ~CELL_NOBACKGROUND_MASK;
if(bytes >= 0){
rtl = egc_rtl(gcluster, &bytes); // checks for RTL and adds U+200E if so
}

@ -942,13 +942,8 @@ notcurses_rasterize_inner(notcurses* nc, const ncpile* p, FILE* out){
nc->rstate.bgpalelidable = false;
nc->rstate.fgpalelidable = false;
}
// we allow these to be set distinctly, but terminfo only supports using
// them both via the 'op' capability. unless we want to generate the 'op'
// escapes ourselves, if either is set to default, we first send op, and
// then a turnon for whichever aren't default.
// if our cell has a default foreground *or* background, we can elide the
// default set iff one of:
// if our cell has a default foreground *or* background, we can elide
// the default set iff one of:
// * we are a partial glyph, and the previous was default on both, or
// * we are a no-foreground glyph, and the previous was default background, or
// * we are a no-background glyph, and the previous was default foreground
@ -959,8 +954,8 @@ notcurses_rasterize_inner(notcurses* nc, const ncpile* p, FILE* out){
return -1;
}
}
// if our cell has a non-default foreground, we can elide the non-default
// foreground set iff either:
// if our cell has a non-default foreground, we can elide the
// non-default foreground set iff either:
// * the previous was non-default, and matches what we have now, or
// * we are a no-foreground glyph (iswspace() is true)
if(cell_fg_palindex_p(srccell)){ // palette-indexed foreground
@ -993,6 +988,10 @@ notcurses_rasterize_inner(notcurses* nc, const ncpile* p, FILE* out){
nc->rstate.fgdefelidable = false;
nc->rstate.fgpalelidable = false;
}
// if our cell has a non-default background, we can elide the
// non-default background set iff either:
// * we do not use the background, because the cell is all-foreground,
// * the previous was non-default, and matches what we have now, or
if(nobackground){
++nc->stats.bgelisions;
}else if(cell_bg_palindex_p(srccell)){ // palette-indexed background

Loading…
Cancel
Save