[gtk+/wip/cssvalue] xxx: crossfade
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssvalue] xxx: crossfade
- Date: Mon, 2 Apr 2012 09:19:58 +0000 (UTC)
commit 93c36bffb8512aee904e27d302da772848f0d6b1
Author: Benjamin Otte <otte redhat com>
Date: Mon Apr 2 09:43:47 2012 +0200
xxx: crossfade
gtk/gtkcssimagecrossfade.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkcssimagecrossfade.c b/gtk/gtkcssimagecrossfade.c
index 43894f2..f5fe1fa 100644
--- a/gtk/gtkcssimagecrossfade.c
+++ b/gtk/gtkcssimagecrossfade.c
@@ -105,20 +105,20 @@ gtk_css_image_cross_fade_draw (GtkCssImage *image,
}
else
{
- cairo_surface_t *surface;
-
+ /* to reduce the group size */
+ cairo_rectangle (cr, 0, 0, width, height);
+ cairo_clip (cr);
+
+ cairo_push_group (cr);
+
if (cross_fade->start)
- {
- surface = _gtk_css_image_get_surface (cross_fade->start,
- cairo_get_target (cr),
- width, height);
- cairo_set_source_surface (cr, surface, 0, 0);
- cairo_paint_with_alpha (cr, 1.0 - cross_fade->progress);
- cairo_surface_destroy (surface);
- }
+ _gtk_css_image_draw (cross_fade->start, cr, width, height);
+
if (cross_fade->end)
{
+ cairo_surface_t *surface;
+
surface = _gtk_css_image_get_surface (cross_fade->end,
cairo_get_target (cr),
width, height);
@@ -126,6 +126,9 @@ gtk_css_image_cross_fade_draw (GtkCssImage *image,
cairo_paint_with_alpha (cr, cross_fade->progress);
cairo_surface_destroy (surface);
}
+
+ cairo_pop_group_to_source (cr);
+ cairo_paint (cr);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]