*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#include <cairo.h>
gdouble alpha,
GdkRectangle page_area)
{
- gint width, height;
+ cairo_save (cr);
gdk_cairo_rectangle (cr, &page_area);
cairo_clip (cr);
-
- width = cairo_image_surface_get_width (surface);
- height = cairo_image_surface_get_height (surface);
-
- cairo_save (cr);
-
- if (width != page_area.width || height != page_area.height) {
- cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_FAST);
- cairo_scale (cr,
- (gdouble) page_area.width / width,
- (gdouble) page_area.height / height);
- }
-
cairo_surface_set_device_offset (surface, x_offset, y_offset);
cairo_set_source_surface (cr, surface, 0, 0);
- if (alpha == 0.)
+ if (alpha == 1.)
cairo_paint (cr);
else
cairo_paint_with_alpha (cr, alpha);
NULL);
if (direction == EV_TRANSITION_DIRECTION_INWARD) {
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
if (alignment == EV_TRANSITION_ALIGNMENT_HORIZONTAL) {
cairo_rectangle (cr,
cairo_clip (cr);
- paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
} else {
- paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
if (alignment == EV_TRANSITION_ALIGNMENT_HORIZONTAL) {
cairo_rectangle (cr,
cairo_clip (cr);
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
}
}
"alignment", &alignment,
NULL);
- paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
for (i = 0; i < N_BLINDS; i++) {
cairo_save (cr);
}
cairo_clip (cr);
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
cairo_restore (cr);
}
}
NULL);
if (direction == EV_TRANSITION_DIRECTION_INWARD) {
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
cairo_rectangle (cr,
width * progress / 2,
height * (1 - progress));
cairo_clip (cr);
- paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
} else {
- paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
cairo_rectangle (cr,
(width / 2) - (width * progress / 2),
height * progress);
cairo_clip (cr);
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
}
}
"angle", &angle,
NULL);
- paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
if (angle == 0) {
/* left to right */
cairo_clip (cr);
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
}
static void
priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
paint_surface (cr, priv->origin_surface, 0, 0, 1 - progress, page_area);
}
if (angle == 0) {
/* left to right */
- paint_surface (cr, priv->origin_surface, - (width * progress), 0, 0, page_area);
- paint_surface (cr, priv->dest_surface, width * (1 - progress), 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, - (width * progress), 0, 1., page_area);
+ paint_surface (cr, priv->dest_surface, width * (1 - progress), 0, 1., page_area);
} else {
/* top to bottom */
- paint_surface (cr, priv->origin_surface, 0, - (height * progress), 0, page_area);
- paint_surface (cr, priv->dest_surface, 0, height * (1 - progress), 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, - (height * progress), 1., page_area);
+ paint_surface (cr, priv->dest_surface, 0, height * (1 - progress), 1., page_area);
}
}
"angle", &angle,
NULL);
- paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
if (angle == 0) {
/* left to right */
- paint_surface (cr, priv->dest_surface, width * (1 - progress), 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, width * (1 - progress), 0, 1., page_area);
} else {
/* top to bottom */
- paint_surface (cr, priv->dest_surface, 0, height * (1 - progress), 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, height * (1 - progress), 1., page_area);
}
}
"angle", &angle,
NULL);
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
if (angle == 0) {
/* left to right */
- paint_surface (cr, priv->origin_surface, - (width * progress), 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, - (width * progress), 0, 1., page_area);
} else {
/* top to bottom */
- paint_surface (cr, priv->origin_surface, 0, - (height * progress), 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, - (height * progress), 1., page_area);
}
}
priv = EV_TRANSITION_ANIMATION_GET_PRIVATE (animation);
- paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
paint_surface (cr, priv->dest_surface, 0, 0, progress, page_area);
}
if (!priv->dest_surface) {
/* animation is still not ready, paint the origin surface */
- paint_surface (cr, priv->origin_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->origin_surface, 0, 0, 1., page_area);
return;
}
switch (type) {
case EV_TRANSITION_EFFECT_REPLACE:
/* just paint the destination slide */
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
break;
case EV_TRANSITION_EFFECT_SPLIT:
ev_transition_animation_split (cr, animation, priv->effect, progress, page_area);
enum_value->value_nick);
/* just paint the destination slide */
- paint_surface (cr, priv->dest_surface, 0, 0, 0, page_area);
+ paint_surface (cr, priv->dest_surface, 0, 0, 1., page_area);
}
}
}