Changeset 0b63dc2 in mainline for uspace/srv/hid/rfb/main.c


Ignore:
Timestamp:
2019-12-07T20:26:28Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
df1a019
Parents:
71cbe5c
Message:

Switch compositor → display server

Convert KFB from visualizer to display device interface. Add ability
of display device implementor to provide client with arg2, arg3 needed
to connect to GC.

File:
1 edited

Legend:

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

    r71cbe5c r0b63dc2  
    6969} rfb_bitmap_t;
    7070
    71 gfx_context_ops_t rfb_gc_ops = {
     71static gfx_context_ops_t rfb_gc_ops = {
    7272        .set_color = rfb_gc_set_color,
    7373        .fill_rect = rfb_gc_fill_rect,
     
    277277}
    278278
    279 #if 0
    280 static errno_t rfb_handle_damage_pixels(visualizer_t *vs,
    281     sysarg_t x0, sysarg_t y0, sysarg_t width, sysarg_t height,
    282     sysarg_t x_offset, sysarg_t y_offset)
    283 {
    284         fibril_mutex_lock(&rfb.lock);
    285 
    286         if (x0 + width > rfb.width || y0 + height > rfb.height) {
    287                 fibril_mutex_unlock(&rfb.lock);
    288                 return EINVAL;
    289         }
    290 
    291         /* TODO update surface_t and use it */
    292         if (!rfb.damage_valid) {
    293                 rfb.damage_rect.x = x0;
    294                 rfb.damage_rect.y = y0;
    295                 rfb.damage_rect.width = width;
    296                 rfb.damage_rect.height = height;
    297                 rfb.damage_valid = true;
    298         } else {
    299                 if (x0 < rfb.damage_rect.x) {
    300                         rfb.damage_rect.width += rfb.damage_rect.x - x0;
    301                         rfb.damage_rect.x = x0;
    302                 }
    303                 if (y0 < rfb.damage_rect.y) {
    304                         rfb.damage_rect.height += rfb.damage_rect.y - y0;
    305                         rfb.damage_rect.y = y0;
    306                 }
    307                 sysarg_t x1 = x0 + width;
    308                 sysarg_t dx1 = rfb.damage_rect.x + rfb.damage_rect.width;
    309                 if (x1 > dx1) {
    310                         rfb.damage_rect.width += x1 - dx1;
    311                 }
    312                 sysarg_t y1 = y0 + height;
    313                 sysarg_t dy1 = rfb.damage_rect.y + rfb.damage_rect.height;
    314                 if (y1 > dy1) {
    315                         rfb.damage_rect.height += y1 - dy1;
    316                 }
    317         }
    318 
    319         pixelmap_t *map = &vs->cells;
    320 
    321         for (sysarg_t y = y0; y < height + y0; ++y) {
    322                 for (sysarg_t x = x0; x < width + x0; ++x) {
    323                         pixel_t pix = pixelmap_get_pixel(map, (x + x_offset) % map->width,
    324                             (y + y_offset) % map->height);
    325                         pixelmap_put_pixel(&rfb.framebuffer, x, y, pix);
    326                 }
    327         }
    328 
    329         fibril_mutex_unlock(&rfb.lock);
    330         return EOK;
    331 }
    332 #endif
    333 
    334279static void syntax_print(void)
    335280{
Note: See TracChangeset for help on using the changeset viewer.