Significantly reduced the number of calls to gdk_draw_point() (and thus to

1999-03-09  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
	the number of calls to gdk_draw_point() (and thus to X) by
	clipping the points by hand.

	* gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
	the clip parameter.
	(gtk_handle_box_paint): Only paint the handle if the expose area
	intersects it.
This commit is contained in:
Federico Mena Quintero 1999-03-09 21:26:57 +00:00 committed by Arturo Espinosa
parent 91ed4f809f
commit ac7b6805f4
9 changed files with 115 additions and 18 deletions

View File

@ -1,3 +1,14 @@
1999-03-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
the number of calls to gdk_draw_point() (and thus to X) by
clipping the points by hand.
* gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
the clip parameter.
(gtk_handle_box_paint): Only paint the handle if the expose area
intersects it.
Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen) Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen)
* gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.) * gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.)

View File

@ -1,3 +1,14 @@
1999-03-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
the number of calls to gdk_draw_point() (and thus to X) by
clipping the points by hand.
* gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
the clip parameter.
(gtk_handle_box_paint): Only paint the handle if the expose area
intersects it.
Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen) Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen)
* gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.) * gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.)

View File

@ -1,3 +1,14 @@
1999-03-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
the number of calls to gdk_draw_point() (and thus to X) by
clipping the points by hand.
* gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
the clip parameter.
(gtk_handle_box_paint): Only paint the handle if the expose area
intersects it.
Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen) Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen)
* gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.) * gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.)

View File

@ -1,3 +1,14 @@
1999-03-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
the number of calls to gdk_draw_point() (and thus to X) by
clipping the points by hand.
* gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
the clip parameter.
(gtk_handle_box_paint): Only paint the handle if the expose area
intersects it.
Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen) Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen)
* gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.) * gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.)

View File

@ -1,3 +1,14 @@
1999-03-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
the number of calls to gdk_draw_point() (and thus to X) by
clipping the points by hand.
* gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
the clip parameter.
(gtk_handle_box_paint): Only paint the handle if the expose area
intersects it.
Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen) Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen)
* gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.) * gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.)

View File

@ -1,3 +1,14 @@
1999-03-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
the number of calls to gdk_draw_point() (and thus to X) by
clipping the points by hand.
* gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
the clip parameter.
(gtk_handle_box_paint): Only paint the handle if the expose area
intersects it.
Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen) Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen)
* gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.) * gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.)

View File

@ -1,3 +1,14 @@
1999-03-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
the number of calls to gdk_draw_point() (and thus to X) by
clipping the points by hand.
* gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
the clip parameter.
(gtk_handle_box_paint): Only paint the handle if the expose area
intersects it.
Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen) Sun Mar 7 18:46:37 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen)
* gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.) * gtk/gtkmain.c (add_dll_suffix): Add this function (OS/2 ver.)

View File

@ -690,7 +690,7 @@ draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, G
GdkRectangle *clip) GdkRectangle *clip)
{ {
gtk_paint_handle(widget->style, window, GTK_STATE_NORMAL, shadow, gtk_paint_handle(widget->style, window, GTK_STATE_NORMAL, shadow,
NULL, widget, "handlebox", clip, widget, "handlebox",
rect->x, rect->y, rect->width, rect->height, rect->x, rect->y, rect->width, rect->height,
GTK_ORIENTATION_VERTICAL); GTK_ORIENTATION_VERTICAL);
} }
@ -740,6 +740,7 @@ gtk_handle_box_paint (GtkWidget *widget,
guint width; guint width;
guint height; guint height;
GdkRectangle rect; GdkRectangle rect;
GdkRectangle dest;
bin = GTK_BIN (widget); bin = GTK_BIN (widget);
hb = GTK_HANDLE_BOX (widget); hb = GTK_HANDLE_BOX (widget);
@ -797,7 +798,10 @@ gtk_handle_box_paint (GtkWidget *widget,
break; break;
} }
draw_textured_frame (widget, hb->bin_window, &rect, GTK_SHADOW_OUT, event ? &event->area : area); if (gdk_rectangle_intersect (event ? &event->area : area, &rect, &dest))
draw_textured_frame (widget, hb->bin_window, &rect,
GTK_SHADOW_OUT,
event ? &event->area : area);
if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{ {

View File

@ -3054,7 +3054,9 @@ gtk_default_draw_handle (GtkStyle *style,
gint xx, yy; gint xx, yy;
gint xthick, ythick; gint xthick, ythick;
GdkGC *light_gc, *dark_gc; GdkGC *light_gc, *dark_gc;
GdkRectangle rect;
GdkRectangle dest; GdkRectangle dest;
gint intersect;
g_return_if_fail (style != NULL); g_return_if_fail (style != NULL);
g_return_if_fail (window != NULL); g_return_if_fail (window != NULL);
@ -3075,26 +3077,40 @@ gtk_default_draw_handle (GtkStyle *style,
xthick = style->klass->xthickness; xthick = style->klass->xthickness;
ythick = style->klass->ythickness; ythick = style->klass->ythickness;
dest.x = x + xthick; rect.x = x + xthick;
dest.y = y + ythick; rect.y = y + ythick;
dest.width = width - (xthick * 2); rect.width = width - (xthick * 2);
dest.height = height - (ythick * 2); rect.height = height - (ythick * 2);
gdk_gc_set_clip_rectangle (light_gc, &dest); if (area)
gdk_gc_set_clip_rectangle (dark_gc, &dest); intersect = gdk_rectangle_intersect (area, &rect, &dest);
else
{
intersect = TRUE;
dest = rect;
}
if (!intersect)
return;
#define DRAW_POINT(w, gc, clip, xx, yy) \
{ \
if ((xx) >= (clip).x \
&& (yy) >= (clip).y \
&& (xx) < (clip).x + (clip).width \
&& (yy) < (clip).y + (clip).height) \
gdk_draw_point ((w), (gc), (xx), (yy)); \
}
for (yy = y + ythick; yy < (y + height - ythick); yy += 3) for (yy = y + ythick; yy < (y + height - ythick); yy += 3)
for (xx = x + xthick; xx < (x + width - xthick); xx += 6) for (xx = x + xthick; xx < (x + width - xthick); xx += 6)
{ {
gdk_draw_point (window, light_gc, xx, yy); DRAW_POINT (window, light_gc, dest, xx, yy);
gdk_draw_point (window, dark_gc, xx + 1, yy + 1); DRAW_POINT (window, dark_gc, dest, xx + 1, yy + 1);
gdk_draw_point (window, light_gc, xx + 3, yy + 1); DRAW_POINT (window, light_gc, dest, xx + 3, yy + 1);
gdk_draw_point (window, dark_gc, xx + 4, yy + 2); DRAW_POINT (window, dark_gc, dest, xx + 4, yy + 2);
} }
gdk_gc_set_clip_rectangle (light_gc, NULL);
gdk_gc_set_clip_rectangle (dark_gc, NULL);
} }
static void static void