blitterstack: must set all 4 bits on full form #1322

pull/1328/head
nick black 4 years ago
parent c35c87ba75
commit aa3cbda9a4
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -147,12 +147,14 @@ tria_blit(ncplane* nc, int placey, int placex, int linesize,
if(memcmp(rgbbase_up, rgbbase_down, 3) == 0){
cell_set_fg_rgb8(c, rgbbase_down[0], rgbbase_down[1], rgbbase_down[2]);
cell_set_bg_rgb8(c, rgbbase_down[0], rgbbase_down[1], rgbbase_down[2]);
cell_set_blitquadrants(c, 0, 0, 0, 0);
if(pool_blit_direct(&nc->pool, c, " ", 1, 1) <= 0){
return -1;
}
}else{
cell_set_fg_rgb8(c, rgbbase_up[0], rgbbase_up[1], rgbbase_up[2]);
cell_set_bg_rgb8(c, rgbbase_down[0], rgbbase_down[1], rgbbase_down[2]);
cell_set_blitquadrants(c, 1, 1, 1, 1);
if(pool_blit_direct(&nc->pool, c, "\u2580", strlen("\u2580"), 1) <= 0){
return -1;
}
@ -307,6 +309,7 @@ qtrans_check(nccell* c, bool blendcolors,
if(ffmpeg_trans_p(rgbbase_br[3])){
// entirety is transparent, load with nul (but not NULL)
cell_set_fg_default(c);
cell_set_blitquadrants(c, 0, 0, 0, 0);
egc = "";
}else{
cell_set_fg_rgb8(c, rgbbase_br[0], rgbbase_br[1], rgbbase_br[2]);
@ -450,6 +453,7 @@ quadrant_blit(ncplane* nc, int placey, int placex, int linesize,
cell_set_bg_alpha(c, CELL_ALPHA_BLEND);
cell_set_fg_alpha(c, CELL_ALPHA_BLEND);
}
cell_set_blitquadrants(c, 1, 1, 1, 1);
}
if(*egc){
if(pool_blit_direct(&nc->pool, c, egc, strlen(egc), 1) <= 0){
@ -658,6 +662,7 @@ sextant_blit(ncplane* nc, int placey, int placex, int linesize,
const char* egc = sex_trans_check(c, rgbas, blendcolors);
if(egc == NULL){
egc = sex_solver(rgbas, &c->channels, blendcolors);
cell_set_blitquadrants(c, 1, 1, 1, 1);
}
//fprintf(stderr, "sex EGC: %s channels: %016lx\n", egc, c->channels);
if(*egc){

@ -871,10 +871,11 @@ static inline void
cell_set_blitquadrants(nccell* c, unsigned tl, unsigned tr, unsigned bl, unsigned br){
// FIXME want a static assert that these four constants OR together to
// equal CELL_BLITTERSTACK_MASK, bah
c->channels |= (tl ? 0x8000000000000000ull : 0);
c->channels |= (tr ? 0x0400000000000000ull : 0);
c->channels |= (bl ? 0x0200000000000000ull : 0);
c->channels |= (br ? 0x0100000000000000ull : 0);
uint64_t newval = (tl ? 0x8000000000000000ull : 0) |
(tr ? 0x0400000000000000ull : 0) |
(bl ? 0x0200000000000000ull : 0) |
(br ? 0x0100000000000000ull : 0);
c->channels = ((c->channels & ~CELL_BLITTERSTACK_MASK) | newval);
}
// Destroy a plane and all its bound descendants.
@ -953,8 +954,8 @@ egc_rtl(const char* egc, int* bytes){
}
// lowest level of cell+pool setup. if the EGC changes the output to RTL, it
// must be suffixed with a LTR-forcing character by now, and
// CELL_NOBACKGROUND_MASK ought be set however it's going to be set.
// must be suffixed with a LTR-forcing character by now. The four bits of
// CELL_BLITTERSTACK_MASK ought already be initialized.
static inline int
pool_blit_direct(egcpool* pool, nccell* c, const char* gcluster, int bytes, int cols){
pool_release(pool, c);

Loading…
Cancel
Save