Changeset 82edef2 in mainline


Ignore:
Timestamp:
2012-11-26T20:47:18Z (11 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e1c6d5df
Parents:
fa98b26a
Message:

Ensure that conditions for fast pixel transfers are maintained by window movement and resizing.

File:
1 edited

Legend:

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

    rfa98b26a r82edef2  
    11171117        transform_t scale;
    11181118        transform_identity(&scale);
    1119         transform_scale(&scale, win->fx, win->fy);
     1119        if (win->fx != 1 || win->fy != 1) {
     1120                transform_scale(&scale, win->fx, win->fy);
     1121        }
    11201122
    11211123        transform_t rotate;
    11221124        transform_identity(&rotate);
    1123         transform_rotate(&rotate, win->angle);
     1125        if (win->angle != 0) {
     1126                transform_rotate(&rotate, win->angle);
     1127        }
    11241128
    11251129        transform_t transform;
     
    11651169                }
    11661170
    1167                 if (scale || resize) {
     1171                if ((scale || resize) && (win->angle != 0)) {
    11681172                        transform_t rotate;
    11691173                        transform_identity(&rotate);
     
    11821186                double _dx = dx;
    11831187                double _dy = dy;
    1184                 transform_t unrotate;
    1185                 transform_identity(&unrotate);
    1186                 transform_rotate(&unrotate, -win->angle);
    1187                 transform_apply_linear(&unrotate, &_dx, &_dy);
     1188                if (win->angle != 0) {
     1189                        transform_t unrotate;
     1190                        transform_identity(&unrotate);
     1191                        transform_rotate(&unrotate, -win->angle);
     1192                        transform_apply_linear(&unrotate, &_dx, &_dy);
     1193                }
    11881194                _dx = (pointer->grab_flags & GF_MOVE_X) ? -_dx : _dx;
    11891195                _dy = (pointer->grab_flags & GF_MOVE_Y) ? -_dy : _dy;
     
    11921198                        double fx = 1.0 + (_dx / ((width - 1) * win->fx));
    11931199                        if (fx > 0) {
     1200#if ANIMATE_WINDOW_TRANSFORMS == 0
     1201                                if (scale) win->fx *= fx;
     1202#endif
     1203#if ANIMATE_WINDOW_TRANSFORMS == 1
    11941204                                win->fx *= fx;
     1205#endif
    11951206                                scale_back_x *= fx;
    11961207                        }
     
    12001211                        double fy = 1.0 + (_dy / ((height - 1) * win->fy));
    12011212                        if (fy > 0) {
     1213#if ANIMATE_WINDOW_TRANSFORMS == 0
     1214                                if (scale) win->fy *= fy;
     1215#endif
     1216#if ANIMATE_WINDOW_TRANSFORMS == 1
    12021217                                win->fy *= fy;
     1218#endif
    12031219                                scale_back_y *= fy;
    12041220                        }
     
    15591575
    15601576                        surface_get_resolution(top->surface, &width, &height);
     1577#if ANIMATE_WINDOW_TRANSFORMS == 1
    15611578                        top->fx *= (1.0 / scale_back_x);
    15621579                        top->fy *= (1.0 / scale_back_y);
    15631580                        comp_recalc_transform(top);
     1581#endif
    15641582
    15651583                        /* Commit proper resize action. */
Note: See TracChangeset for help on using the changeset viewer.