Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e80d8f8 in mainline


Ignore:
Timestamp:
2012-11-30T05:15:11Z (8 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master
Children:
3e6a98c5
Parents:
69c1995
Message:

Avoid underflow in calculation of damage region position.

File:
1 edited

Legend:

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

    r69c1995 re80d8f8  
    266266}
    267267
    268 static void comp_coord_from_client(sysarg_t x_in, sysarg_t y_in, transform_t win_trans,
     268static void comp_coord_from_client(double x_in, double y_in, transform_t win_trans,
    269269    sysarg_t *x_out, sysarg_t *y_out)
    270270{
     
    279279}
    280280
    281 static void comp_coord_bounding_rect(sysarg_t x_in, sysarg_t y_in,
    282     sysarg_t w_in, sysarg_t h_in, transform_t win_trans,
     281static void comp_coord_bounding_rect(double x_in, double y_in,
     282    double w_in, double h_in, transform_t win_trans,
    283283    sysarg_t *x_out, sysarg_t *y_out, sysarg_t *w_out, sysarg_t *h_out)
    284284{
     
    303303                (*h_out) = (*h_out) - (*y_out) + 1;
    304304        } else {
     305                (*x_out) = 0;
     306                (*y_out) = 0;
    305307                (*w_out) = 0;
    306308                (*h_out) = 0;
     
    547549static void comp_window_damage(window_t *win, ipc_callid_t iid, ipc_call_t *icall)
    548550{
    549         sysarg_t x = IPC_GET_ARG1(*icall);
    550         sysarg_t y = IPC_GET_ARG2(*icall);
    551         sysarg_t width = IPC_GET_ARG3(*icall);
    552         sysarg_t height = IPC_GET_ARG4(*icall);
     551        double x = IPC_GET_ARG1(*icall);
     552        double y = IPC_GET_ARG2(*icall);
     553        double width = IPC_GET_ARG3(*icall);
     554        double height = IPC_GET_ARG4(*icall);
    553555
    554556        if (width == 0 || height == 0) {
     
    556558        } else {
    557559                fibril_mutex_lock(&window_list_mtx);
     560                sysarg_t x_dmg_glob, y_dmg_glob, w_dmg_glob, h_dmg_glob;
    558561                comp_coord_bounding_rect(x - 1, y - 1, width + 2, height + 2,
    559                     win->transform, &x, &y, &width, &height);
     562                    win->transform, &x_dmg_glob, &y_dmg_glob, &w_dmg_glob, &h_dmg_glob);
    560563                fibril_mutex_unlock(&window_list_mtx);
    561                 comp_damage(x, y, width, height);
     564                comp_damage(x_dmg_glob, y_dmg_glob, w_dmg_glob, h_dmg_glob);
    562565        }
    563566
Note: See TracChangeset for help on using the changeset viewer.