X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=libview%2Fev-transition-animation.c;h=7e33023e220734c35193a876484c709c889e432d;hb=470da44057ddaf67b1a1ef6254851e288537609e;hp=148b4c7734eccaba3e576e1f1ec5ef060ce722e3;hpb=68d0fc3c59185065d9694ba3f8cb2665b984eb9f;p=evince.git diff --git a/libview/ev-transition-animation.c b/libview/ev-transition-animation.c index 148b4c77..7e33023e 100644 --- a/libview/ev-transition-animation.c +++ b/libview/ev-transition-animation.c @@ -556,8 +556,6 @@ ev_transition_animation_paint (EvTransitionAnimation *animation, g_return_if_fail (EV_IS_TRANSITION_ANIMATION (animation)); priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation); - g_object_get (priv->effect, "type", &type, NULL); - progress = ev_timeline_get_progress (EV_TIMELINE (animation)); if (!priv->dest_surface) { /* animation is still not ready, paint the origin surface */ @@ -565,6 +563,9 @@ ev_transition_animation_paint (EvTransitionAnimation *animation, return; } + g_object_get (priv->effect, "type", &type, NULL); + progress = ev_timeline_get_progress (EV_TIMELINE (animation)); + switch (type) { case EV_TRANSITION_EFFECT_REPLACE: /* just paint the destination slide */ @@ -634,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) @@ -657,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) @@ -678,5 +685,5 @@ ev_transition_animation_ready (EvTransitionAnimation *animation) priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation); - return (priv->origin_surface && priv->dest_surface); + return (priv->origin_surface != NULL); }