Changeset d530237a in mainline for fb/fb.c


Ignore:
Timestamp:
2006-06-04T11:28:47Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
67ec84b
Parents:
a78e273
Message:

Console graphics update.
Slight speed improvement on console redraw.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fb/fb.c

    ra78e273 rd530237a  
    267267/* Character-console functions */
    268268
    269 /** Draw character at given position */
    270 static void draw_glyph(int vp,__u8 glyph, unsigned int sx, unsigned int sy, style_t style)
     269/** Draw character at given position
     270 *
     271 * @param vp Viewport where the character is printed
     272 * @param sx Coordinates of top-left of the character
     273 * @param sy Coordinates of top-left of the character
     274 * @param style Color of the character
     275 * @param transparent If false, print background color
     276 */
     277static void draw_glyph(int vp,__u8 glyph, unsigned int sx, unsigned int sy,
     278                       style_t style, int transparent)
    271279{
    272280        int i;
     
    279287                        if (glline & (1 << (7 - i)))
    280288                                putpixel(vp, sx + i, sy + y, style.fg_color);
    281                         else
     289                        else if (!transparent)
    282290                                putpixel(vp, sx + i, sy + y, style.bg_color);
    283291                }
     
    427435 * @param row Screen position relative to viewport
    428436 * @param col Screen position relative to viewport
    429  */
    430 static void draw_char(int vp, char c, unsigned int row, unsigned int col, style_t style)
     437 * @param transparent If false, print background color with character
     438 */
     439static void draw_char(int vp, char c, unsigned int row, unsigned int col, style_t style, int transparent)
    431440{
    432441        viewport_t *vport = &viewports[vp];
     
    437446                invert_char(vp, vport->cur_row, vport->cur_col);
    438447       
    439         draw_glyph(vp, c, col * COL_WIDTH, row * FONT_SCANLINES, style);
     448        draw_glyph(vp, c, col * COL_WIDTH, row * FONT_SCANLINES, style, transparent);
    440449
    441450        vport->cur_col = col;
     
    470479                col = i % vport->cols;
    471480                row = i / vport->cols;
    472                 draw_glyph(vp, data[i].character, col * COL_WIDTH, row * FONT_SCANLINES, data[i].style);
     481                draw_glyph(vp, data[i].character, col * COL_WIDTH, row * FONT_SCANLINES,
     482                           data[i].style, style_same(data[i].style,vport->style));
    473483        }
    474484        cursor_print(vp);
     
    779789
    780790                case FB_PUTCHAR:
     791                case FB_TRANS_PUTCHAR:
    781792                        c = IPC_GET_ARG1(call);
    782793                        row = IPC_GET_ARG2(call);
     
    788799                        ipc_answer_fast(callid,0,0,0);
    789800
    790                         draw_char(vp, c, row, col, vport->style);
     801                        draw_char(vp, c, row, col, vport->style, IPC_GET_METHOD(call) == FB_TRANS_PUTCHAR);
    791802                        continue; /* msg already answered */
    792803                case FB_CLEAR:
Note: See TracChangeset for help on using the changeset viewer.