Changeset 5fae123 in mainline


Ignore:
Timestamp:
2019-12-10T13:40:06Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5bded44
Parents:
23e86c6
git-author:
Jiri Svoboda <jiri@…> (2019-12-09 18:39:55)
git-committer:
Jiri Svoboda <jiri@…> (2019-12-10 13:40:06)
Message:

KFB needs to translate bitmaps properly when rendering

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/gfxdemo/gfxdemo.c

    r23e86c6 r5fae123  
    490490{
    491491        printf("Keyboard event type=%d key=%d\n", event->type, event->key);
    492         quit = true;
     492        if (event->type == KEY_PRESS)
     493                quit = true;
    493494}
    494495
  • uspace/drv/fb/kfb/port.c

    r23e86c6 r5fae123  
    245245        gfx_coord2_t bmdim;
    246246        gfx_coord2_t dim;
    247         gfx_coord_t x, y;
     247        gfx_coord2_t sp;
     248        gfx_coord2_t dp;
     249        gfx_coord2_t pos;
    248250        pixelmap_t pbm;
    249251        pixel_t color;
     
    270272        pbm.data = kfbbm->alloc.pixels;
    271273
    272         for (y = srect.p0.y; y < srect.p1.y; y++) {
    273                 for (x = srect.p0.x; x < srect.p1.x; x++) {
    274                         color = pixelmap_get_pixel(&pbm, x, y);
     274        for (pos.y = srect.p0.y; pos.y < srect.p1.y; pos.y++) {
     275                for (pos.x = srect.p0.x; pos.x < srect.p1.x; pos.x++) {
     276                        gfx_coord2_subtract(&pos, &kfbbm->rect.p0, &sp);
     277                        gfx_coord2_add(&pos, &offs, &dp);
     278
     279                        color = pixelmap_get_pixel(&pbm, sp.x, sp.y);
    275280                        kfb->pixel2visual(kfb->addr +
    276                             FB_POS(kfb, x, y), color);
     281                            FB_POS(kfb, dp.x, dp.y), color);
    277282                }
    278283        }
Note: See TracChangeset for help on using the changeset viewer.