Changeset c79545e in mainline for uspace/srv/hid/display/display.c
- Timestamp:
- 2020-01-19T10:00:11Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2012fe0
- Parents:
- 946a666
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/display.c
r946a666 rc79545e 36 36 #include <errno.h> 37 37 #include <gfx/context.h> 38 #include <gfx/render.h> 38 39 #include <io/log.h> 39 40 #include <stdlib.h> … … 52 53 { 53 54 ds_display_t *disp; 55 errno_t rc; 54 56 55 57 disp = calloc(1, sizeof(ds_display_t)); 56 58 if (disp == NULL) 57 59 return ENOMEM; 60 61 rc = gfx_color_new_rgb_i16(0x8000, 0xc800, 0xffff, &disp->bg_color); 62 if (rc != EOK) { 63 free(disp); 64 return ENOMEM; 65 } 58 66 59 67 list_initialize(&disp->clients); … … 74 82 assert(list_empty(&disp->clients)); 75 83 assert(list_empty(&disp->seats)); 84 gfx_color_delete(disp->bg_color); 76 85 free(disp); 77 86 } … … 401 410 } 402 411 412 /** Paint display background. 413 * 414 * @param display Display 415 * @param rect Bounding rectangle or @c NULL to repaint entire display 416 */ 417 errno_t ds_display_paint_bg(ds_display_t *disp, gfx_rect_t *rect) 418 { 419 gfx_rect_t dsrect; 420 gfx_rect_t crect; 421 gfx_context_t *gc; 422 errno_t rc; 423 424 dsrect.p0.x = 0; 425 dsrect.p0.y = 0; 426 dsrect.p1.x = 1024; 427 dsrect.p1.y = 768; 428 429 if (rect != NULL) 430 gfx_rect_clip(&dsrect, rect, &crect); 431 else 432 crect = dsrect; 433 434 gc = ds_display_get_gc(disp); // XXX 435 436 rc = gfx_set_color(gc, disp->bg_color); 437 if (rc != EOK) 438 return rc; 439 440 return gfx_fill_rect(gc, &crect); 441 } 442 403 443 /** @} 404 444 */
Note:
See TracChangeset
for help on using the changeset viewer.