Re: Comments on clipping fix (118317)
- From: Soeren Sandmann <sandmann daimi au dk>
- To: Owen Taylor <otaylor redhat com>
- Cc: gtk-devel-list gnome org
- Subject: Re: Comments on clipping fix (118317)
- Date: 20 Aug 2003 19:00:17 +0200
Owen Taylor <otaylor redhat com> writes:
> > > I think clipping the clear to the actual region is worthwhile - the
> > > regions are not infrequently very sparse, for an opaque move resize,
> > > we might frequently have a 500x500 region of which only
> > > two 5x500 stripes are there.
> >
> > Done.
>
> How? I don't see it in the new patch, though maybe I'm just
> missing something.
static void
gdk_window_clear_backing_rect (GdkWindow *window,
gint x,
@@ -1795,10 +1682,16 @@
if (GDK_WINDOW_DESTROYED (window))
return;
-
+
tmp_gc = gdk_window_get_bg_gc (window, paint);
+
+ gdk_region_offset (paint->region, paint->x_offset, paint->y_offset);
+ gdk_gc_set_clip_region (tmp_gc, paint->region);
+ gdk_region_offset (paint->region, - paint->x_offset, - paint->y_offset);
+
gdk_draw_rectangle (paint->pixmap, tmp_gc, TRUE,
x - paint->x_offset, y - paint->y_offset, width, height);
+
g_object_unref (tmp_gc);
}
(It's possible to save one line of code by using
gdk_gc_set_clip_offset(), of course).
Søren
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]