[gtk+/wip/baedert/drawing: 47/306] image: Remove css box drawing



commit 5fe9cb4f4452367056bf328f21b0463d1b727ff7
Author: Timm Bäder <mail baedert org>
Date:   Wed May 3 10:44:18 2017 +0200

    image: Remove css box drawing

 gtk/gtkimage.c |   41 +++++++++++------------------------------
 1 files changed, 11 insertions(+), 30 deletions(-)
---
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index bc47eee..4cafb21 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -163,13 +163,6 @@ static void gtk_image_get_content_size (GtkCssGadget   *gadget,
                                         gint           *minimum_baseline,
                                         gint           *natural_baseline,
                                         gpointer        unused);
-static gboolean gtk_image_render_contents (GtkCssGadget *gadget,
-                                           GtkSnapshot  *snapshot,
-                                           int           x,
-                                           int           y,
-                                           int           width,
-                                           int           height,
-                                           gpointer      data);
 
 static void gtk_image_style_updated        (GtkWidget    *widget);
 static void gtk_image_finalize             (GObject      *object);
@@ -373,7 +366,7 @@ gtk_image_init (GtkImage *image)
                                                      GTK_WIDGET (image),
                                                      gtk_image_get_content_size,
                                                      NULL,
-                                                     gtk_image_render_contents,
+                                                     NULL,
                                                      NULL, NULL);
 
 }
@@ -1419,27 +1412,17 @@ static void
 gtk_image_snapshot (GtkWidget   *widget,
                     GtkSnapshot *snapshot)
 {
-  gtk_css_gadget_snapshot (GTK_IMAGE (widget)->priv->gadget,
-                           snapshot);
-}
-
-static gboolean
-gtk_image_render_contents (GtkCssGadget *gadget,
-                           GtkSnapshot  *snapshot,
-                           int           x,
-                           int           y,
-                           int           width,
-                           int           height,
-                           gpointer      data)
-{
-  GtkWidget *widget;
-  GtkImage *image;
-  GtkImagePrivate *priv;
+  GtkImage *image = GTK_IMAGE (widget);
+  GtkImagePrivate *priv = gtk_image_get_instance_private (image);
+  GtkAllocation allocation;
+  int x, y, width, height;
   gint w, h, baseline;
 
-  widget = gtk_css_gadget_get_owner (gadget);
-  image = GTK_IMAGE (widget);
-  priv = image->priv;
+  gtk_widget_get_allocation (widget, &allocation);
+  x = 0;
+  y = 0;
+  width = allocation.width;
+  height = allocation.height;
 
   _gtk_icon_helper_get_size (priv->icon_helper, &w, &h);
 
@@ -1458,7 +1441,7 @@ gtk_image_render_contents (GtkCssGadget *gadget,
       GdkPixbuf *pixbuf = get_animation_frame (image);
 
       gtk_snapshot_render_icon (snapshot, context, pixbuf, x, y);
-      
+
       g_object_unref (pixbuf);
     }
   else
@@ -1467,8 +1450,6 @@ gtk_image_render_contents (GtkCssGadget *gadget,
       gtk_icon_helper_snapshot (priv->icon_helper, snapshot);
       gtk_snapshot_offset (snapshot, -x, -y);
     }
-
-  return FALSE;
 }
 
 static void


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