[evince] [libview] Fix page transitions in presentation mode
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: svn-commits-list gnome org
- Subject: [evince] [libview] Fix page transitions in presentation mode
- Date: Tue, 9 Jun 2009 04:09:48 -0400 (EDT)
commit d337cbe9269e142f0b70e12a8c58296fe34b4892
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Mon Jun 8 16:24:32 2009 +0200
[libview] Fix page transitions in presentation mode
Set the destination surface as soon as possible when starting a page
transition animation. Fixes bgo#583652 and bgo#581881.
---
libview/ev-transition-animation.c | 6 ++++++
libview/ev-view.c | 8 ++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/libview/ev-transition-animation.c b/libview/ev-transition-animation.c
index efcb509..7e33023 100644
--- a/libview/ev-transition-animation.c
+++ b/libview/ev-transition-animation.c
@@ -635,6 +635,9 @@ ev_transition_animation_set_origin_surface (EvTransitionAnimation *animation,
priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+ if (priv->origin_surface == origin_surface)
+ return;
+
surface = cairo_surface_reference (origin_surface);
if (priv->origin_surface)
@@ -658,6 +661,9 @@ ev_transition_animation_set_dest_surface (EvTransitionAnimation *animation,
priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
+ if (priv->dest_surface == dest_surface)
+ return;
+
surface = cairo_surface_reference (dest_surface);
if (priv->dest_surface)
diff --git a/libview/ev-view.c b/libview/ev-view.c
index ee81680..f69b7b0 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -4628,10 +4628,14 @@ ev_view_presentation_animation_start (EvView *view,
if (!effect)
return;
- surface = ev_pixbuf_cache_get_surface (view->pixbuf_cache, view->current_page);
view->animation = ev_transition_animation_new (effect);
+
+ surface = ev_pixbuf_cache_get_surface (view->pixbuf_cache, view->current_page);
ev_transition_animation_set_origin_surface (view->animation, surface);
-
+ surface = ev_pixbuf_cache_get_surface (view->pixbuf_cache, new_page);
+ if (surface)
+ ev_transition_animation_set_dest_surface (view->animation, surface);
+
g_signal_connect (view->animation, "frame",
G_CALLBACK (ev_view_transition_animation_frame), view);
g_signal_connect (view->animation, "finished",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]