示例#1
0
static GtkCssImage *
gtk_css_image_gradient_compute (GtkCssImage     *image,
                                GtkStyleContext *context)
{
  GtkCssImageGradient *gradient = GTK_CSS_IMAGE_GRADIENT (image);
  GtkCssImageGradient *copy;

  if (gradient->pattern)
    return g_object_ref (gradient);

  copy = g_object_new (GTK_TYPE_CSS_IMAGE_GRADIENT, NULL);
  copy->gradient = gtk_gradient_ref (gradient->gradient);
  copy->pattern = gtk_gradient_resolve_for_context (copy->gradient, context);

  return GTK_CSS_IMAGE (copy);
}
示例#2
0
static GtkCssImage *
gtk_css_image_gradient_compute (GtkCssImage             *image,
                                guint                    property_id,
                                GtkStyleProviderPrivate *provider,
                                GtkCssComputedValues    *values,
                                GtkCssComputedValues    *parent_values,
                                GtkCssDependencies      *dependencies)
{
  GtkCssImageGradient *gradient = GTK_CSS_IMAGE_GRADIENT (image);
  GtkCssImageGradient *copy;

  if (gradient->pattern)
    return g_object_ref (gradient);

  copy = g_object_new (GTK_TYPE_CSS_IMAGE_GRADIENT, NULL);
  copy->gradient = gtk_gradient_ref (gradient->gradient);
  copy->pattern = _gtk_gradient_resolve_full (copy->gradient, provider, values, parent_values, dependencies);

  return GTK_CSS_IMAGE (copy);
}