summaryrefslogtreecommitdiff
path: root/src/theme-viewer.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-01-28 05:16:04 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-28 05:16:04 +0000
commit838d999d86e6b5d4aab753b40c44b4b2340f4f42 (patch)
tree3bce5c19d4230fef3e063dd212883e2626f06128 /src/theme-viewer.c
parent8ddeb4f953148473978443f94e6cf14e2d078f1e (diff)
downloadmetacity-838d999d86e6b5d4aab753b40c44b4b2340f4f42.tar.gz
metacity-838d999d86e6b5d4aab753b40c44b4b2340f4f42.tar.bz2
implement (meta_texture_spec_draw): implement shape spec and blank texture
2002-01-27 Havoc Pennington <hp@pobox.com> * src/theme.c (meta_shape_spec_draw): implement (meta_texture_spec_draw): implement shape spec and blank texture support (meta_frame_style_draw): implement
Diffstat (limited to 'src/theme-viewer.c')
-rw-r--r--src/theme-viewer.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/theme-viewer.c b/src/theme-viewer.c
index 59af1fd..2ae7b20 100644
--- a/src/theme-viewer.c
+++ b/src/theme-viewer.c
@@ -23,8 +23,10 @@
#include "util.h"
#include "theme.h"
#include <gtk/gtk.h>
+#include <time.h>
static void run_position_expression_tests (void);
+static void run_position_expression_timings (void);
int
main (int argc, char **argv)
@@ -32,7 +34,8 @@ main (int argc, char **argv)
bindtextdomain (GETTEXT_PACKAGE, METACITY_LOCALEDIR);
run_position_expression_tests ();
-
+ run_position_expression_timings ();
+
return 0;
}
@@ -245,3 +248,46 @@ run_position_expression_tests (void)
++i;
}
}
+
+static void
+run_position_expression_timings (void)
+{
+ int i;
+ int iters;
+ clock_t start;
+ clock_t end;
+
+#define ITERATIONS 100000
+
+ start = clock ();
+
+ iters = 0;
+ i = 0;
+ while (iters < ITERATIONS)
+ {
+ const PositionExpressionTest *test;
+ int x, y;
+
+ test = &position_expression_tests[i];
+
+ meta_parse_position_expression (test->expr,
+ test->rect.x,
+ test->rect.y,
+ test->rect.width,
+ test->rect.height,
+ &x, &y, NULL);
+
+ ++iters;
+ ++i;
+ if (i == G_N_ELEMENTS (position_expression_tests))
+ i = 0;
+ }
+
+ end = clock ();
+
+ g_print ("%d coordinate expressions parsed in %g seconds (%g seconds average)\n",
+ ITERATIONS,
+ ((double)end - (double)start) / CLOCKS_PER_SEC,
+ ((double)end - (double)start) / CLOCKS_PER_SEC / (double) ITERATIONS);
+
+}