[gtk+] label: Port active link drawing to gsk



commit 10ddd3112ab794112b098e3196747e889c8c3dca
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 1 12:26:43 2017 -0400

    label: Port active link drawing to gsk
    
    We don't need to fall back to cairo fro this anymore.

 gtk/gtklabel.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 24e0484..5845005 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3990,18 +3990,13 @@ gtk_label_snapshot (GtkWidget   *widget,
 
               range_clip = gdk_pango_layout_get_clip_region (priv->layout, lx, ly, range, 1);
               cairo_region_get_extents (range_clip, &clip_extents);
-              cr = gtk_snapshot_append_cairo (snapshot,
-                                              &GRAPHENE_RECT_FROM_RECT(&clip_extents),
-                                              "Active Link");
-              gdk_cairo_region (cr, range_clip);
-              cairo_clip (cr);
-              cairo_region_destroy (range_clip);
 
-              gtk_render_background (context, cr, x, 0, width, height);
-              gtk_render_layout (context, cr, lx, ly, priv->layout);
+              gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_extents), "Active Link");
+              gtk_snapshot_render_background (snapshot, context, x, 0, width, height);
+              gtk_snapshot_render_layout (snapshot, context, lx, ly, priv->layout);
+              gtk_snapshot_pop (snapshot);
 
               gtk_style_context_restore (context);
-              cairo_restore (cr);
             }
 
           if (focus_link && gtk_widget_has_visible_focus (widget))


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