Changeset 71cbe5c in mainline for uspace/srv/hid/rfb/main.c


Ignore:
Timestamp:
2019-12-06T17:48:48Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b63dc2
Parents:
87a7cdb
Message:

Make bitmaps work with IPC GC / RFB

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/rfb/main.c

    r87a7cdb r71cbe5c  
    224224        gfx_rect_t drect;
    225225        gfx_coord2_t offs;
     226        gfx_coord2_t bmdim;
    226227        gfx_coord2_t dim;
     228        gfx_coord_t x, y;
     229        pixelmap_t pbm;
     230        pixel_t color;
    227231
    228232        if (srect0 != NULL)
     
    240244        /* Destination rectangle */
    241245        gfx_rect_translate(&offs, &srect, &drect);
    242 
    243246        gfx_coord2_subtract(&drect.p1, &drect.p0, &dim);
     247        gfx_coord2_subtract(&rfbbm->rect.p1, &rfbbm->rect.p0, &bmdim);
     248
     249        pbm.width = bmdim.x;
     250        pbm.height = bmdim.y;
     251        pbm.data = rfbbm->alloc.pixels;
     252
     253        for (y = srect.p0.y; y < srect.p1.y; y++) {
     254                for (x = srect.p0.x; x < srect.p1.x; x++) {
     255                        color = pixelmap_get_pixel(&pbm, x, y);
     256                        pixelmap_put_pixel(&rfbbm->rfb->rfb.framebuffer,
     257                            x + offs.x, y + offs.y, color);
     258                }
     259        }
     260
     261        rfb_gc_invalidate_rect(rfbbm->rfb, &drect);
    244262
    245263        return EOK;
Note: See TracChangeset for help on using the changeset viewer.