|
|
|
@ -275,6 +275,32 @@ paint(const ncplane* p, struct crender* rvec, int dstleny, int dstlenx,
|
|
|
|
|
if(cell_wide_right_p(targc)){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(cell_fg_alpha(targc) > CELL_ALPHA_OPAQUE){
|
|
|
|
|
const nccell* vis = &p->fb[nfbcellidx(p, y, x)];
|
|
|
|
|
if(cell_fg_default_p(vis)){
|
|
|
|
|
vis = &p->basecell;
|
|
|
|
|
}
|
|
|
|
|
if(cell_fg_palindex_p(vis)){
|
|
|
|
|
if(cell_fg_alpha(targc) == CELL_ALPHA_TRANSPARENT){
|
|
|
|
|
cell_set_fg_palindex(targc, cell_fg_palindex(vis));
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if(cell_fg_alpha(vis) == CELL_ALPHA_HIGHCONTRAST){
|
|
|
|
|
crender->highcontrast = true;
|
|
|
|
|
crender->hcfgblends = crender->fgblends;
|
|
|
|
|
crender->hcfg = cell_fchannel(targc);
|
|
|
|
|
}
|
|
|
|
|
cell_blend_fchannel(targc, cell_fchannel(vis), &crender->fgblends);
|
|
|
|
|
// crender->highcontrast can only be true if we just set it, since we're
|
|
|
|
|
// about to set targc opaque based on crender->highcontrast (and this
|
|
|
|
|
// entire stanza is conditional on targc not being CELL_ALPHA_OPAQUE).
|
|
|
|
|
if(crender->highcontrast){
|
|
|
|
|
cell_set_fg_alpha(targc, CELL_ALPHA_OPAQUE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Background color takes effect independently of whether we have a
|
|
|
|
|
// glyph. If we've already locked in the background, it has no effect.
|
|
|
|
|
// If it's transparent, it has no effect. Otherwise, update the
|
|
|
|
@ -282,6 +308,8 @@ paint(const ncplane* p, struct crender* rvec, int dstleny, int dstlenx,
|
|
|
|
|
// Evaluate the background first, in case we have HIGHCONTRAST fg text.
|
|
|
|
|
if(cell_bg_alpha(targc) > CELL_ALPHA_OPAQUE){
|
|
|
|
|
const nccell* vis = &p->fb[nfbcellidx(p, y, x)];
|
|
|
|
|
// FIXME need check maps to determine whether inversion is appropriate
|
|
|
|
|
if(!crender->blitterstacked || !cell_blitted_p(vis)){
|
|
|
|
|
if(cell_bg_default_p(vis)){
|
|
|
|
|
vis = &p->basecell;
|
|
|
|
|
}
|
|
|
|
@ -292,29 +320,16 @@ paint(const ncplane* p, struct crender* rvec, int dstleny, int dstlenx,
|
|
|
|
|
}else{
|
|
|
|
|
cell_blend_bchannel(targc, cell_bchannel(vis), &crender->bgblends);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(cell_fg_alpha(targc) > CELL_ALPHA_OPAQUE){
|
|
|
|
|
const nccell* vis = &p->fb[nfbcellidx(p, y, x)];
|
|
|
|
|
}else{ // use the local foreground; we're stacking blittings
|
|
|
|
|
if(cell_fg_default_p(vis)){
|
|
|
|
|
vis = &p->basecell;
|
|
|
|
|
}
|
|
|
|
|
if(cell_fg_palindex_p(vis)){
|
|
|
|
|
if(cell_fg_alpha(targc) == CELL_ALPHA_TRANSPARENT){
|
|
|
|
|
cell_set_fg_palindex(targc, cell_fg_palindex(vis));
|
|
|
|
|
if(cell_bg_alpha(targc) == CELL_ALPHA_TRANSPARENT){
|
|
|
|
|
cell_set_bg_palindex(targc, cell_fg_palindex(vis));
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if(cell_fg_alpha(vis) == CELL_ALPHA_HIGHCONTRAST){
|
|
|
|
|
crender->highcontrast = true;
|
|
|
|
|
crender->hcfgblends = crender->fgblends;
|
|
|
|
|
crender->hcfg = cell_fchannel(targc);
|
|
|
|
|
}
|
|
|
|
|
cell_blend_fchannel(targc, cell_fchannel(vis), &crender->fgblends);
|
|
|
|
|
// crender->highcontrast can only be true if we just set it, since we're
|
|
|
|
|
// about to set targc opaque based on crender->highcontrast (and this
|
|
|
|
|
// entire stanza is conditional on targc not being CELL_ALPHA_OPAQUE).
|
|
|
|
|
if(crender->highcontrast){
|
|
|
|
|
cell_set_fg_alpha(targc, CELL_ALPHA_OPAQUE);
|
|
|
|
|
cell_blend_bchannel(targc, cell_fchannel(vis), &crender->bgblends);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|