[planner: 16/61] eel-canvas-rect: Drop now unused rgba to GdkGC mapping and tracking




commit a827e16f936a80e6748a471451f9e52f36391eb4
Author: Mart Raudsepp <leio gentoo org>
Date:   Sat Mar 7 00:37:36 2020 +0200

    eel-canvas-rect: Drop now unused rgba to GdkGC mapping and tracking

 src/eel-canvas-rect.c | 84 ---------------------------------------------------
 1 file changed, 84 deletions(-)
---
diff --git a/src/eel-canvas-rect.c b/src/eel-canvas-rect.c
index d9d62ea3..97158be3 100644
--- a/src/eel-canvas-rect.c
+++ b/src/eel-canvas-rect.c
@@ -67,8 +67,6 @@ struct EelCanvasRectDetails {
 
        ArtDRect last_update_rect;
        ArtDRect last_outline_update_rect;
-       GdkGC *fill_gc;         /* GC for fill, lazily allocated */
-       GdkGC *outline_gc;      /* GC for outline */
 };
 
 
@@ -78,61 +76,6 @@ G_DEFINE_TYPE (EelCanvasRect, eel_canvas_rect, GNOME_TYPE_CANVAS_ITEM);
 static ArtDRect  make_drect (double x0, double y0, double x1, double y1);
 static void      diff_rects (ArtDRect r1, ArtDRect r2, int *count, ArtDRect result[4]);
 
-static void
-eel_canvas_rect_update_fill_gc (EelCanvasRect *rect,
-                               gboolean       create)
-{
-       EelCanvasRectDetails *details;
-       GnomeCanvasItem *item;
-       GdkColor c;
-
-       item = GNOME_CANVAS_ITEM (rect);
-
-       details = rect->details;
-
-       if (details->fill_gc == NULL) {
-               if (!create) {
-                       return;
-               }
-               details->fill_gc =
-                       gdk_gc_new (GTK_WIDGET (item->canvas)->window);
-       }
-
-       c.pixel = gnome_canvas_get_color_pixel (item->canvas,
-                                               details->fill_color);
-       gdk_gc_set_foreground (details->fill_gc, &c);
-}
-
-static void
-eel_canvas_rect_update_outline_gc (EelCanvasRect *rect,
-                                  gboolean       create)
-{
-       EelCanvasRectDetails *details;
-       GnomeCanvasItem *item;
-       GdkColor c;
-
-       item = GNOME_CANVAS_ITEM (rect);
-
-       details = rect->details;
-
-       if (details->outline_gc == NULL) {
-               if (!create) {
-                       return;
-               }
-               details->outline_gc =
-                       gdk_gc_new (GTK_WIDGET (item->canvas)->window);
-       }
-
-       c.pixel = gnome_canvas_get_color_pixel (item->canvas,
-                                               details->outline_color);
-       gdk_gc_set_foreground (details->outline_gc, &c);
-       gdk_gc_set_line_attributes (details->outline_gc,
-                                   details->width_pixels,
-                                   GDK_LINE_SOLID,
-                                   GDK_CAP_BUTT,
-                                   GDK_JOIN_MITER);
-}
-
 
 static void
 eel_canvas_rect_init (EelCanvasRect *rect)
@@ -192,23 +135,16 @@ eel_canvas_rect_set_property (GObject      *object,
 
        case PROP_FILL_COLOR_RGBA:
                details->fill_color = g_value_get_uint (value);
-
-               eel_canvas_rect_update_fill_gc (rect, FALSE);
-
                gnome_canvas_item_request_update (item);
                break;
 
        case PROP_OUTLINE_COLOR_RGBA:
                details->outline_color = g_value_get_uint (value);
-
-               eel_canvas_rect_update_outline_gc (rect, FALSE);
-
                gnome_canvas_item_request_update (item);
                break;
 
        case PROP_WIDTH_PIXELS:
                details->width_pixels = g_value_get_uint (value);
-               eel_canvas_rect_update_outline_gc (rect, FALSE);
                gnome_canvas_item_request_update (item);
                break;
 
@@ -352,10 +288,6 @@ eel_canvas_rect_update (GnomeCanvasItem *item,
 static void
 eel_canvas_rect_realize (GnomeCanvasItem *item)
 {
-       EelCanvasRect *rect = EEL_CANVAS_RECT (item);
-
-       eel_canvas_rect_update_outline_gc (rect, TRUE);
-
        if (GNOME_CANVAS_ITEM_CLASS (eel_canvas_rect_parent_class)->realize) {
                GNOME_CANVAS_ITEM_CLASS (eel_canvas_rect_parent_class)->realize (item);
        }
@@ -364,22 +296,6 @@ eel_canvas_rect_realize (GnomeCanvasItem *item)
 static void
 eel_canvas_rect_unrealize (GnomeCanvasItem *item)
 {
-       EelCanvasRect *rect;
-       EelCanvasRectDetails *details;
-
-       rect = EEL_CANVAS_RECT (item);
-       details = rect->details;
-
-       if (details->outline_gc) {
-               g_object_unref (details->outline_gc);
-               details->outline_gc = NULL;
-       }
-
-       if (details->fill_gc) {
-               g_object_unref (details->fill_gc);
-               details->fill_gc = NULL;
-       }
-
        if (GNOME_CANVAS_ITEM_CLASS (eel_canvas_rect_parent_class)->unrealize) {
                GNOME_CANVAS_ITEM_CLASS (eel_canvas_rect_parent_class)->unrealize (item);
        }


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