[gtk+] borderimage: No need to resolve



commit c0a6b1fb907f4947328af3ae307fd4ccfe874a1d
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jun 7 16:48:47 2011 +0200

    borderimage: No need to resolve
    
    border-image is a shorthand, so it's unpacked unresolved and repacked
    resolved.

 gtk/gtkborderimage.c        |   32 --------------------------------
 gtk/gtkborderimageprivate.h |    4 ----
 gtk/gtkstyleproperty.c      |   28 ----------------------------
 3 files changed, 0 insertions(+), 64 deletions(-)
---
diff --git a/gtk/gtkborderimage.c b/gtk/gtkborderimage.c
index f38b4f9..cf9da9c 100644
--- a/gtk/gtkborderimage.c
+++ b/gtk/gtkborderimage.c
@@ -55,7 +55,6 @@ struct _GtkBorderImage {
   GtkCssBorderImageRepeat repeat;
 
   gint ref_count;
-  gboolean resolved;
 };
 
 GtkBorderImage *
@@ -77,8 +76,6 @@ _gtk_border_image_new (cairo_pattern_t      *pattern,
   if (repeat != NULL)
     image->repeat = *repeat;
 
-  image->resolved = TRUE;
-
   return image;
 }
 
@@ -101,38 +98,9 @@ _gtk_border_image_new_for_gradient (GtkGradient          *gradient,
   if (repeat != NULL)
     image->repeat = *repeat;
 
-  image->resolved = FALSE;
-
   return image;  
 }
 
-gboolean
-_gtk_border_image_get_resolved (GtkBorderImage *image)
-{
-  return image->resolved;
-}
-
-GtkBorderImage *
-_gtk_border_image_resolve (GtkBorderImage     *image,
-                           GtkStyleProperties *props)
-{
-  GtkBorderImage *resolved_image;
-  cairo_pattern_t *pattern;
-
-  if (image->resolved)
-    return _gtk_border_image_ref (image);
-
-  image->resolved =
-    gtk_gradient_resolve (image->source_gradient, props, &pattern);
-
-  if (!image->resolved)
-    return NULL;
-
-  resolved_image = _gtk_border_image_new (pattern, &image->slice, &image->repeat);
-
-  return resolved_image;
-}
-
 GtkBorderImage *
 _gtk_border_image_ref (GtkBorderImage *image)
 {
diff --git a/gtk/gtkborderimageprivate.h b/gtk/gtkborderimageprivate.h
index 5068c51..ca2ef01 100644
--- a/gtk/gtkborderimageprivate.h
+++ b/gtk/gtkborderimageprivate.h
@@ -45,10 +45,6 @@ GtkBorderImage *  _gtk_border_image_new_for_gradient (GtkGradient          *grad
                                                       GtkBorder            *slice,
                                                       GtkCssBorderImageRepeat *repeat);
 
-GtkBorderImage *  _gtk_border_image_resolve          (GtkBorderImage       *image,
-                                                      GtkStyleProperties   *props);
-gboolean          _gtk_border_image_get_resolved     (GtkBorderImage       *image);
-
 GtkBorderImage *  _gtk_border_image_ref              (GtkBorderImage       *image);
 void              _gtk_border_image_unref            (GtkBorderImage       *image);
 
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c
index 5ad1a01..5e105a7 100644
--- a/gtk/gtkstyleproperty.c
+++ b/gtk/gtkstyleproperty.c
@@ -1915,29 +1915,6 @@ resolve_shadow (GtkStyleProperties *props,
   return TRUE;
 }
 
-static gboolean
-resolve_border_image (GtkStyleProperties *props,
-                      GValue *value)
-{
-  GtkBorderImage *resolved, *base;
-
-  base = g_value_get_boxed (value);
-
-  if (base == NULL)
-    return FALSE;
-
-  if (_gtk_border_image_get_resolved (base))
-    return TRUE;
-
-  resolved = _gtk_border_image_resolve (base, props);
-  if (resolved == NULL)
-    return FALSE;
-
-  g_value_take_boxed (value, resolved);
-
-  return TRUE;
-}
-
 void
 _gtk_style_property_resolve (const GtkStyleProperty *property,
                              GtkStyleProperties     *props,
@@ -1970,11 +1947,6 @@ _gtk_style_property_resolve (const GtkStyleProperty *property,
       if (!resolve_shadow (props, val))
         _gtk_style_property_resolve (property, props, val);
     }
-  else if (G_VALUE_TYPE (val) == GTK_TYPE_BORDER_IMAGE)
-    {
-      if (!resolve_border_image (props, val))
-        _gtk_style_property_resolve (property, props, val);
-    }
 }
 
 gboolean



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