Index: client/gui-gtk/gtkpixcomm.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/gtkpixcomm.c,v retrieving revision 1.8 diff -u -u -r1.8 gtkpixcomm.c --- client/gui-gtk/gtkpixcomm.c 2002/12/03 17:53:59 1.8 +++ client/gui-gtk/gtkpixcomm.c 2002/12/13 09:16:38 @@ -37,6 +37,9 @@ #include #endif +#include "log.h" +#include "timing.h" + #include "gtkpixcomm.h" static void gtk_pixcomm_class_init (GtkPixcommClass *cclass); @@ -197,6 +200,9 @@ gtk_pixcomm_copyto (GtkPixcomm *pixcomm, SPRITE *src, gint x, gint y, gboolean refresh) { + struct timer *t; + int i; + g_return_if_fail (pixcomm != NULL); g_return_if_fail (GTK_IS_PIXCOMM (pixcomm)); g_return_if_fail (src != NULL); @@ -209,6 +215,37 @@ gdk_draw_pixmap (pixcomm->pixmap, pixcomm->fg_gc, src->pixmap, 0, 0, x, y, src->width, src->height); +#define N 10000 + + if (src->has_mask) { + double mask, mask2, nomask; + + t = new_timer_start(TIMER_USER, TIMER_ACTIVE); + for (i = 0; i < N; i++) { + gdk_draw_pixmap(pixcomm->pixmap, pixcomm->fg_gc, src->pixmap, + 0, 0, x, y, src->width, src->height); + } + mask = read_timer_seconds_free(t); + + t = new_timer_start(TIMER_USER, TIMER_ACTIVE); + for (i = 0; i < N; i++) { + gdk_draw_pixmap(pixcomm->pixmap, pixcomm->fg_gc, src->pixmap, + 0, 0, x, y, src->width, src->height); + } + mask2 = read_timer_seconds_free(t); + + gdk_gc_set_clip_mask(pixcomm->fg_gc, NULL); + t = new_timer_start(TIMER_USER, TIMER_ACTIVE); + for (i = 0; i < N; i++) { + gdk_draw_pixmap(pixcomm->pixmap, pixcomm->fg_gc, src->pixmap, + 0, 0, x, y, src->width, src->height); + } + nomask = read_timer_seconds_free(t); + freelog(LOG_NORMAL, + "gdk_draw_pixmap of %dx%d: mask=%fs/%fs (%f) nomask=%fs factor=%f", + src->width, src->height, mask, mask2, mask / mask2, nomask, + mask / nomask); + } if (src->has_mask) {