summaryrefslogtreecommitdiff
path: root/gdk/gdkgc.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2008-12-04 20:55:44 +0100
committerAlexander Larsson <alex@localhost.localdomain>2009-04-02 10:14:06 +0200
commit864649157dd98ba8d86e0fd3561ea7345c00893d (patch)
tree971e6737fe7c515ad2fb5adc5f50e8bcc44dd8da /gdk/gdkgc.c
parente9ee842db1cec299f6b67ecfa9eb23985d60aad3 (diff)
downloadgdk-pixbuf-864649157dd98ba8d86e0fd3561ea7345c00893d.tar.gz
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
Diffstat (limited to 'gdk/gdkgc.c')
-rw-r--r--gdk/gdkgc.c13
1 files changed, 12 insertions, 1 deletions
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);