[gtk+] css: Complete the cross-fade implementation
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] css: Complete the cross-fade implementation
- Date: Tue, 6 Sep 2016 10:39:14 +0000 (UTC)
commit e51fd7cb18cd1c74d41f11337257b2faa7b250d2
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Sep 6 06:37:47 2016 -0400
css: Complete the cross-fade implementation
We need to actually compute the images. Otherwise,
bad things happen when we try to draw.
https://bugzilla.gnome.org/show_bug.cgi?id=767391
gtk/gtkcssimagecrossfade.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssimagecrossfade.c b/gtk/gtkcssimagecrossfade.c
index 8124579..bb631a4 100644
--- a/gtk/gtkcssimagecrossfade.c
+++ b/gtk/gtkcssimagecrossfade.c
@@ -227,6 +227,27 @@ gtk_css_image_cross_fade_print (GtkCssImage *image,
g_string_append (string, ")");
}
+static GtkCssImage *
+gtk_css_image_cross_fade_compute (GtkCssImage *image,
+ guint property_id,
+ GtkStyleProviderPrivate *provider,
+ GtkCssStyle *style,
+ GtkCssStyle *parent_style)
+{
+ GtkCssImageCrossFade *cross_fade = GTK_CSS_IMAGE_CROSS_FADE (image);
+ GtkCssImage *start, *end, *computed;
+
+ start = _gtk_css_image_compute (cross_fade->start, property_id, provider, style, parent_style);
+ end = _gtk_css_image_compute (cross_fade->end, property_id, provider, style, parent_style);
+
+ computed = _gtk_css_image_cross_fade_new (start, end, cross_fade->progress);
+
+ g_object_unref (start);
+ g_object_unref (end);
+
+ return computed;
+}
+
static void
gtk_css_image_cross_fade_dispose (GObject *object)
{
@@ -250,6 +271,7 @@ _gtk_css_image_cross_fade_class_init (GtkCssImageCrossFadeClass *klass)
image_class->draw = gtk_css_image_cross_fade_draw;
image_class->parse = gtk_css_image_cross_fade_parse;
image_class->print = gtk_css_image_cross_fade_print;
+ image_class->compute = gtk_css_image_cross_fade_compute;
object_class->dispose = gtk_css_image_cross_fade_dispose;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]