Lines Matching refs:fg
83 uint8_t fg;
227 om_set_rowattr(int row, uint8_t fg, uint8_t bg)
230 if (rowattr[row].fg == fg && rowattr[row].bg == bg)
235 if (rowattr[row].fg == rowattr[row].bg) {
237 if (rowattr[row].fg != fg && rowattr[row].bg != bg) {
242 rowattr[row].fg = fg;
254 /* Setting fg equal to bg means 'reset' or 'erased'. */
257 rowattr[row].fg = bg;
411 * Calculate ROP depending on fg/bg color combination as follows.
412 * This is called per individual plane while shifting fg and bg.
413 * So the LSB of fg and bg points to this plane.
417 * bg fg rop result
424 * This allows characters to be drawn in the specified fg/bg colors with
428 om_fgbg2rop(uint8_t fg, uint8_t bg)
432 t = (bg & 1) * 2 + (fg & 1);
456 uint8_t fg, bg;
473 om_unpack_attr(attr, &fg, &bg, NULL);
474 om_set_rowattr(row, fg, bg);
476 if (last_fg != fg || last_bg != bg) {
477 last_fg = fg;
481 int t = om_fgbg2rop(fg, bg);
483 fg >>= 1;
568 uint8_t fg, bg;
576 om_unpack_attr(attr, &fg, &bg, NULL);
582 om_set_rowattr(row, fg, bg);
609 uint8_t fg, bg;
617 om_unpack_attr(attr, &fg, &bg, NULL);
1186 rowattr[srcrow].fg == rowattr[srcrow].bg &&
1212 uint8_t fg;
1216 fg = rowattr[srcrow].fg;
1218 set = fg ^ bg;
1220 /* use fg since both can be acceptable */
1221 set = fg;
1222 } else if ((set & fg) != 0) {
1224 * set is the set of bits that set in fg and
1227 set &= fg;
1231 * (probably) set in bg and cleared in fg.
1236 /* and swap fg and bg */
1237 tmp = fg;
1238 fg = bg;
1243 int t = om_fgbg2rop(fg, bg);
1246 fg >>= 1;
1253 * srcplane is the plane that fg is set and bg is
1669 * b15-8: fg color code
1675 * Place fg and bg side by side in advance to reduce the computation cost
1685 om_allocattr(void *cookie, int fg, int bg, int flags, long *attrp)
1699 fg = WSCOL_WHITE; /* maybe 7 or 1 */
1705 tmp = fg;
1706 fg = bg;
1717 } else if (fg < 8) {
1718 fg += 8;
1730 fg &= hwplanemask;
1737 c += ((fg & 1) << 1) | (bg & 1);
1738 fg >>= 1;
1742 c = (fg << 8) | bg;
1751 om_unpack_attr(long attr, uint8_t *fg, uint8_t *bg, int *underline)
1758 if (fg)
1759 *fg = f;