From 864649157dd98ba8d86e0fd3561ea7345c00893d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 4 Dec 2008 20:55:44 +0100 Subject: Move _gdk_gc_remove_drawable_clip from after each time its set to before each pixmap set and when adding a new different region This means we can avoid changing the clip if we're drawing with the same gc to the same clip region --- gdk/gdkgc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gdk/gdkgc.c') diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c index 355a34613..a85a3b77c 100644 --- a/gdk/gdkgc.c +++ b/gdk/gdkgc.c @@ -44,6 +44,8 @@ struct _GdkGCPrivate GdkRegion *clip_region; guint32 region_tag_applied; + int region_tag_offset_x; + int region_tag_offset_y; GdkRegion *old_clip_region; @@ -597,9 +599,18 @@ _gdk_gc_add_drawable_clip (GdkGC *gc, { GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc); - g_assert (priv->old_clip_region == NULL); + if (priv->region_tag_applied == region_tag && + offset_x == priv->region_tag_offset_x && + offset_y == priv->region_tag_offset_y) + return; /* Already appied this drawable region */ + if (priv->region_tag_applied) + _gdk_gc_remove_drawable_clip (gc); + priv->region_tag_applied = region_tag; + priv->region_tag_offset_x = offset_x; + priv->region_tag_offset_y = offset_y; + priv->old_clip_region = priv->clip_region; region = gdk_region_copy (region); -- cgit v1.2.1