summaryrefslogtreecommitdiff
path: root/gtk/gtkcssimagelinear.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-07-14 20:24:46 +0200
committerBenjamin Otte <otte@redhat.com>2012-08-28 15:40:56 +0200
commit09f9fd42b4bbc35e0883771512089fd9b5673621 (patch)
treee714856fee132c47059b33ca8ee75a04e2b0f061 /gtk/gtkcssimagelinear.c
parent9b4ed662181cabde506248cf8b344420a0300a3e (diff)
downloadgtk+-09f9fd42b4bbc35e0883771512089fd9b5673621.tar.gz
css: Fold color value computation into gtksymboliccolor.c
This gets rid of the public function _gtk_css_rgba_value_compute_from_symbolic(). The fallback is now handled using a switch statement instead of letting the caller pass the function.
Diffstat (limited to 'gtk/gtkcssimagelinear.c')
-rw-r--r--gtk/gtkcssimagelinear.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/gtk/gtkcssimagelinear.c b/gtk/gtkcssimagelinear.c
index e6440232a2..10977e8ff2 100644
--- a/gtk/gtkcssimagelinear.c
+++ b/gtk/gtkcssimagelinear.c
@@ -413,10 +413,8 @@ gtk_css_image_linear_compute (GtkCssImage *image,
guint property_id,
GtkStyleContext *context)
{
- static const GdkRGBA transparent = { 0, 0, 0, 0 };
GtkCssImageLinear *linear = GTK_CSS_IMAGE_LINEAR (image);
GtkCssImageLinear *copy;
- GtkCssValue *fallback;
guint i;
copy = g_object_new (GTK_TYPE_CSS_IMAGE_LINEAR, NULL);
@@ -424,7 +422,6 @@ gtk_css_image_linear_compute (GtkCssImage *image,
copy->angle = _gtk_css_value_compute (linear->angle, property_id, context);
- fallback = _gtk_css_symbolic_value_new_take_symbolic_color (gtk_symbolic_color_new_literal (&transparent));
g_array_set_size (copy->stops, linear->stops->len);
for (i = 0; i < linear->stops->len; i++)
{
@@ -433,10 +430,7 @@ gtk_css_image_linear_compute (GtkCssImage *image,
stop = &g_array_index (linear->stops, GtkCssImageLinearColorStop, i);
scopy = &g_array_index (copy->stops, GtkCssImageLinearColorStop, i);
- scopy->color = _gtk_css_rgba_value_compute_from_symbolic (stop->color,
- fallback,
- context,
- FALSE);
+ scopy->color = _gtk_css_value_compute (stop->color, property_id, context);
if (stop->offset)
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, context);
@@ -444,8 +438,6 @@ gtk_css_image_linear_compute (GtkCssImage *image,
scopy->offset = NULL;
}
- _gtk_css_value_unref (fallback);
-
return GTK_CSS_IMAGE (copy);
}