diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-11-01 08:40:41 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-22 23:01:46 +0000 |
commit | 411c09eed7ebff7335948a7f96d2b29d82ed817a (patch) | |
tree | 1c61b7665ddb4ee579eeedd59cd93882d8372d13 /test/any2ppm.c | |
parent | c50c8b90c0033686b465e6766fba4772c1d698c6 (diff) | |
download | cairo-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 'test/any2ppm.c')
-rw-r--r-- | test/any2ppm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/any2ppm.c b/test/any2ppm.c index c93e457ae..4d215e082 100644 --- a/test/any2ppm.c +++ b/test/any2ppm.c @@ -236,8 +236,8 @@ write_ppm (cairo_surface_t *surface, int fd) static cairo_surface_t * _create_image (void *closure, cairo_content_t content, - double width, double height) - //csi_object_t *dictionary) + double width, double height, + long uid) { cairo_surface_t **out = closure; cairo_format_t format; |