summaryrefslogtreecommitdiff
path: root/util/cairo-sphinx
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-11-01 08:40:41 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-01-22 23:01:46 +0000
commit411c09eed7ebff7335948a7f96d2b29d82ed817a (patch)
tree1c61b7665ddb4ee579eeedd59cd93882d8372d13 /util/cairo-sphinx
parentc50c8b90c0033686b465e6766fba4772c1d698c6 (diff)
downloadcairo-411c09eed7ebff7335948a7f96d2b29d82ed817a.tar.gz
perf: Enable a surface cache for perf-trace
Real applications that control their Drawable externally to Cairo are 'disadvantaged' by cairo-perf-trace when it creates a similar surface for each new instance of the same Drawable. The difficulty in maintaining one perf surface for every application surface is that the traces do not track lifetimes for the application surfaces, so we would just accumulate stale surfaces. The surface cache takes a different approach and returns the same surface for each active Drawable, and maintains a hold-over of the MRU 16 surfaces. This achieves 60-80% hit rate with firefox, which is probably as good as can be expected. Obviously for double-buffered applications we only every draw to freshly created surfaces (and Gtk+ bypasses cairo to do the final copy -- the ideal application would just use a push-group for double buffering, in which case we would capture and replay the entire expose event). To enable use of the surface cache whilst replaying use -c: ./cairo-perf-trace -c firefox-talos-gfx
Diffstat (limited to 'util/cairo-sphinx')
-rw-r--r--util/cairo-sphinx/sphinx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/cairo-sphinx/sphinx.c b/util/cairo-sphinx/sphinx.c
index 9fb5ce097..d5f0e93d9 100644
--- a/util/cairo-sphinx/sphinx.c
+++ b/util/cairo-sphinx/sphinx.c
@@ -963,7 +963,8 @@ send_recording (struct client *c,
static cairo_surface_t *
_surface_create (void *closure,
cairo_content_t content,
- double width, double height)
+ double width, double height,
+ long uid)
{
struct client *c = closure;
cairo_surface_t *surface;