Changeset 2012fe0 in mainline for uspace/srv/hid/display/window.c


Ignore:
Timestamp:
2020-01-21T15:04:53Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
28db46b
Parents:
c79545e
git-author:
Jiri Svoboda <jiri@…> (2020-01-20 19:04:50)
git-committer:
Jiri Svoboda <jiri@…> (2020-01-21 15:04:53)
Message:

Repaint display when finished moving a window

File:
1 edited

Legend:

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

    rc79545e r2012fe0  
    348348}
    349349
    350 /** Repaint a window using its backing bitmap.
    351  *
    352  * @param wnd Window to repaint
    353  * @return EOK on success or an error code
    354  */
    355 static errno_t ds_window_repaint(ds_window_t *wnd)
    356 {
    357         log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_start_repaint");
    358         return gfx_bitmap_render(wnd->bitmap, NULL, &wnd->dpos);
     350/** Paint a window using its backing bitmap.
     351 *
     352 * @param wnd Window to paint
     353 * @param rect Display rectangle to paint to
     354 * @return EOK on success or an error code
     355 */
     356errno_t ds_window_paint(ds_window_t *wnd, gfx_rect_t *rect)
     357{
     358        gfx_rect_t srect;
     359        gfx_rect_t *brect;
     360        gfx_rect_t crect;
     361
     362        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_paint");
     363
     364        if (rect != NULL) {
     365                gfx_rect_rtranslate(&wnd->dpos, rect, &srect);
     366
     367                /* Determine if we have anything to do */
     368                gfx_rect_clip(&srect, rect, &crect);
     369                if (gfx_rect_is_empty(&crect))
     370                        return EOK;
     371
     372                brect = &srect;
     373        } else {
     374                brect = NULL;
     375        }
     376
     377        return gfx_bitmap_render(wnd->bitmap, brect, &wnd->dpos);
    359378}
    360379
     
    399418        wnd->state = dsw_idle;
    400419
    401         (void) ds_window_repaint(wnd);
     420        (void) ds_display_paint(wnd->display, NULL);
    402421}
    403422
Note: See TracChangeset for help on using the changeset viewer.