[PATCH weston v2 01/16] zoom: remove animation_xy as unused
Pekka Paalanen
ppaalanen at gmail.com
Tue Mar 10 06:01:32 PDT 2015
From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Remove several fields from struct weston_output_zoom as a consequence of
removing animation_xy from it. Animation_xy was always empty, unused.
Animation_xy was likely used by text_cursor_position implementation, but
that was removed in commit a7af70436b7dccfacd736626d6719b3e751fd985.
Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
src/compositor.h | 4 ----
src/zoom.c | 49 +++----------------------------------------------
2 files changed, 3 insertions(+), 50 deletions(-)
diff --git a/src/compositor.h b/src/compositor.h
index f4ba7a5..bb7562f 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -160,10 +160,6 @@ struct weston_output_zoom {
float trans_x, trans_y;
struct weston_animation animation_z;
struct weston_spring spring_z;
- struct weston_animation animation_xy;
- struct weston_spring spring_xy;
- struct weston_fixed_point from;
- struct weston_fixed_point to;
struct weston_fixed_point current;
struct wl_listener motion_listener;
};
diff --git a/src/zoom.c b/src/zoom.c
index f71d08c..16d487d 100644
--- a/src/zoom.c
+++ b/src/zoom.c
@@ -63,39 +63,6 @@ weston_zoom_pick_seat(struct weston_compositor *compositor)
struct weston_seat, link);
}
-
-static void
-weston_zoom_frame_xy(struct weston_animation *animation,
- struct weston_output *output, uint32_t msecs)
-{
- struct weston_seat *seat = weston_zoom_pick_seat(output->compositor);
- wl_fixed_t x, y;
-
- if (animation->frame_counter <= 1)
- output->zoom.spring_xy.timestamp = msecs;
-
- weston_spring_update(&output->zoom.spring_xy, msecs);
-
- x = output->zoom.from.x - ((output->zoom.from.x - output->zoom.to.x) *
- output->zoom.spring_xy.current);
- y = output->zoom.from.y - ((output->zoom.from.y - output->zoom.to.y) *
- output->zoom.spring_xy.current);
-
- output->zoom.current.x = x;
- output->zoom.current.y = y;
-
- if (weston_spring_done(&output->zoom.spring_xy)) {
- output->zoom.spring_xy.current = output->zoom.spring_xy.target;
- output->zoom.current.x = seat->pointer->x;
- output->zoom.current.y = seat->pointer->y;
- wl_list_remove(&animation->link);
- wl_list_init(&animation->link);
- }
-
- output->dirty = 1;
- weston_output_damage(output);
-}
-
static void
zoom_area_center_from_pointer(struct weston_output *output,
wl_fixed_t *x, wl_fixed_t *y)
@@ -127,8 +94,7 @@ weston_output_update_zoom_transform(struct weston_output *output)
ratio = 1 / level;
- if (wl_list_empty(&output->zoom.animation_xy.link))
- zoom_area_center_from_pointer(output, &x, &y);
+ zoom_area_center_from_pointer(output, &x, &y);
global_x = wl_fixed_to_double(x);
global_y = wl_fixed_to_double(y);
@@ -179,13 +145,8 @@ weston_output_update_zoom(struct weston_output *output)
zoom_area_center_from_pointer(output, &x, &y);
- if (wl_list_empty(&output->zoom.animation_xy.link)) {
- output->zoom.current.x = seat->pointer->x;
- output->zoom.current.y = seat->pointer->y;
- } else {
- output->zoom.to.x = x;
- output->zoom.to.y = y;
- }
+ output->zoom.current.x = seat->pointer->x;
+ output->zoom.current.y = seat->pointer->y;
weston_zoom_transition(output, x, y);
weston_output_update_zoom_transform(output);
@@ -229,9 +190,5 @@ weston_output_init_zoom(struct weston_output *output)
output->zoom.spring_z.friction = 1000;
output->zoom.animation_z.frame = weston_zoom_frame_z;
wl_list_init(&output->zoom.animation_z.link);
- weston_spring_init(&output->zoom.spring_xy, 250.0, 0.0, 0.0);
- output->zoom.spring_xy.friction = 1000;
- output->zoom.animation_xy.frame = weston_zoom_frame_xy;
- wl_list_init(&output->zoom.animation_xy.link);
output->zoom.motion_listener.notify = motion;
}
--
2.0.5
More information about the wayland-devel
mailing list