Changeset 4a62ec9 in mainline


Ignore:
Timestamp:
2009-01-09T21:53:36Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
42ec919
Parents:
7447572
Message:

Must check colors in draw_text_data().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fb/fb.c

    r7447572 r4a62ec9  
    186186};
    187187
     188static int rgb_from_attr(attr_rgb_t *rgb, const attrs_t *a);
    188189static int rgb_from_style(attr_rgb_t *rgb, int style);
    189190static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color,
     
    878879                uint8_t glyph = bbp->glyph;
    879880
    880                 if (glyph != data[i].character) {
    881                         bbp->glyph = data[i].character;
    882                         a = &data[i].attrs;
    883 
    884                         switch (a->t) {
    885                         case at_style:
    886                                 rgb_from_style(&rgb, a->a.s.style);
    887                                 break;
    888                         case at_idx:
    889                                 rgb_from_idx(&rgb, a->a.i.fg_color,
    890                                     a->a.i.bg_color, a->a.i.flags);
    891                                 break;
    892                         case at_rgb:
    893                                 rgb = a->a.r;
    894                                 break;
    895                         }
     881                a = &data[i].attrs;
     882                rgb_from_attr(&rgb, a);
     883
     884                if (glyph != data[i].character ||
     885                    rgb.fg_color != bbp->fg_color ||
     886                    rgb.bg_color != bbp->bg_color) {
     887                        bbp->glyph = data[i].character;
    896888
    897889                        bbp->fg_color = rgb.fg_color;
     
    14431435
    14441436        return EOK;
     1437}
     1438
     1439static int rgb_from_attr(attr_rgb_t *rgb, const attrs_t *a)
     1440{
     1441        int rc;
     1442
     1443        switch (a->t) {
     1444        case at_style:
     1445                rc = rgb_from_style(rgb, a->a.s.style);
     1446                break;
     1447        case at_idx:
     1448                rc = rgb_from_idx(rgb, a->a.i.fg_color,
     1449                    a->a.i.bg_color, a->a.i.flags);
     1450                break;
     1451        case at_rgb:
     1452                *rgb = a->a.r;
     1453                rc = EOK;
     1454                break;
     1455        }
     1456
     1457        return rc;
    14451458}
    14461459
Note: See TracChangeset for help on using the changeset viewer.