[gtk/wip/baedert/gl-rework] cssimagerecolor: Implement is_computed()



commit 159b688492223182a4011b8f2ae49ca2f782d654
Author: Timm Bäder <mail baedert org>
Date:   Mon Jan 20 09:22:02 2020 +0100

    cssimagerecolor: Implement is_computed()

 gtk/gtkcssimagerecolor.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/gtk/gtkcssimagerecolor.c b/gtk/gtkcssimagerecolor.c
index 36cc7bd9c4..1f639b86de 100644
--- a/gtk/gtkcssimagerecolor.c
+++ b/gtk/gtkcssimagerecolor.c
@@ -308,6 +308,14 @@ gtk_css_image_recolor_get_height (GtkCssImage *image)
   return gdk_texture_get_height (recolor->texture);
 }
 
+static gboolean
+gtk_css_image_recolor_is_computed (GtkCssImage *image)
+{
+  GtkCssImageRecolor *recolor = GTK_CSS_IMAGE_RECOLOR (image);
+
+  return !recolor->palette || gtk_css_value_is_computed (recolor->palette);
+}
+
 static void
 _gtk_css_image_recolor_class_init (GtkCssImageRecolorClass *klass)
 {
@@ -320,6 +328,7 @@ _gtk_css_image_recolor_class_init (GtkCssImageRecolorClass *klass)
   image_class->snapshot = gtk_css_image_recolor_snapshot;
   image_class->parse = gtk_css_image_recolor_parse;
   image_class->print = gtk_css_image_recolor_print;
+  image_class->is_computed = gtk_css_image_recolor_is_computed;
 
   object_class->dispose = gtk_css_image_recolor_dispose;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]