Changeset 22faaf2 in mainline


Ignore:
Timestamp:
2019-10-29T02:34:14Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b3c185b6
Parents:
587b4cb
Message:

A little bit of tiling support

Location:
uspace/srv/hid/display
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/display.c

    r587b4cb r22faaf2  
    6565        log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_create() -> EOK, id=%zu",
    6666            wnd->id);
     67
     68        wnd->dpos.x = ((wnd->id - 1) & 1) * 400;
     69        wnd->dpos.y = ((wnd->id - 1) & 2) / 2 * 300;
     70
    6771        *rwnd_id = wnd->id;
    6872        return EOK;
  • uspace/srv/hid/display/output.c

    r587b4cb r22faaf2  
    6161        }
    6262
    63         vw = 400;
    64         vh = 300;
     63        vw = 800;
     64        vh = 600;
    6565
    6666        pixbuf = calloc(vw * vh, sizeof(pixel_t));
  • uspace/srv/hid/display/types/display/window.h

    r587b4cb r22faaf2  
    3939#include <adt/list.h>
    4040#include <gfx/context.h>
     41#include <gfx/coord.h>
    4142
    4243typedef sysarg_t ds_wnd_id_t;
     
    4849        /** Link to @c display->windows */
    4950        link_t lwindows;
     51        /** Display position */
     52        gfx_coord2_t dpos;
    5053        /** Window ID */
    5154        ds_wnd_id_t id;
  • uspace/srv/hid/display/window.c

    r587b4cb r22faaf2  
    9090{
    9191        ds_window_t *wnd = (ds_window_t *) arg;
     92        gfx_rect_t drect;
    9293
    9394        log_msg(LOG_DEFAULT, LVL_NOTE, "gc_fill_rect");
    94         return gfx_fill_rect(wnd->display->gc, rect);
     95        gfx_rect_translate(&wnd->dpos, rect, &drect);
     96        return gfx_fill_rect(wnd->display->gc, &drect);
    9597}
    9698
     
    152154{
    153155        ds_window_bitmap_t *cbm = (ds_window_bitmap_t *)bm;
    154 
    155         return gfx_bitmap_render(cbm->bitmap, srect0, offs0);
     156        gfx_coord2_t doffs;
     157
     158        if (offs0 != NULL)
     159                gfx_coord2_add(&cbm->wnd->dpos, offs0, &doffs);
     160        else
     161                doffs = cbm->wnd->dpos;
     162
     163        return gfx_bitmap_render(cbm->bitmap, srect0, &doffs);
    156164}
    157165
Note: See TracChangeset for help on using the changeset viewer.