[cairo-commit] 2 commits - perf/cairo-perf-trace.c test/solid-pattern-cache-stress.c
Chris Wilson
ickle at kemper.freedesktop.org
Sun Jun 7 16:15:39 PDT 2009
perf/cairo-perf-trace.c | 2 +-
test/solid-pattern-cache-stress.c | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 34ccaeae2d3cf1b5bdd8b97581d6e70324494356
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Jun 8 00:12:28 2009 +0100
[perf] Continuously update the summary for traces
diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index 9e23f28..5e35cf6 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -382,7 +382,7 @@ parse_options (cairo_perf_t *perf, int argc, char *argv[])
if (verbose && perf->summary == NULL)
perf->summary = stderr;
- if (perf->summary == stdout && isatty (fileno(stdout)))
+ if (perf->summary && isatty (fileno (perf->summary)))
perf->summary_continuous = TRUE;
if (optind < argc) {
commit 055e9b0eb650bec6ae8297e5a36f1cac22c43d56
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Jun 7 23:35:57 2009 +0100
[test] Cache resolved scaled-font
The intention is to stress test the solid pattern caches, so we can cheat
and avoid repeatedly resolving the toy font.
diff --git a/test/solid-pattern-cache-stress.c b/test/solid-pattern-cache-stress.c
index 285275e..c2a1c15 100644
--- a/test/solid-pattern-cache-stress.c
+++ b/test/solid-pattern-cache-stress.c
@@ -37,6 +37,8 @@
#define drand48() (rand () / (double) RAND_MAX)
#endif
+static cairo_scaled_font_t *scaled_font;
+
static cairo_t *
_cairo_create_similar (cairo_t *cr, int width, int height)
{
@@ -93,6 +95,7 @@ _draw (cairo_t *cr,
cairo_mask (cr, cairo_get_source (cr));
+ cairo_set_scaled_font (cr, scaled_font);
cairo_text_extents (cr, "cairo", &extents);
cairo_move_to (cr,
-extents.x_bearing - .5 * extents.width,
@@ -173,6 +176,9 @@ draw (cairo_t *cr, int width, int height)
};
int i, j, loop;
+ /* cache a resolved scaled-font */
+ scaled_font = cairo_get_scaled_font (cr);
+
for (loop = 0; loop < LOOPS; loop++) {
for (i = 0; i < LOOPS; i++) {
for (j = 0; j < 8; j++) {
More information about the cairo-commit
mailing list