[cairo-commit] util/cairo-trace

Chris Wilson ickle at kemper.freedesktop.org
Fri Jun 19 03:58:11 PDT 2009


 util/cairo-trace/trace.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 030ef4ca0023166fcb82f0a0b1512eb31beb3385
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 19 11:56:14 2009 +0100

    [trace] Change the threshold at which pixel data is immediately copied
    
    Embed the pixels for images less than 32*32 as this catches most icons
    which are frequently uploaded, but is still an unlikely size for a
    destination image surface.

diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 6964f50..e3ab7f1 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -3062,8 +3062,11 @@ cairo_image_surface_create_for_data (unsigned char *data, cairo_format_t format,
 	 * Defer grabbing the pixel contents until we have to, but only for
 	 * "large" images, for small images the overhead of embedding pixels
 	 * is negligible.
+	 *
+	 * Choose 32x32 as that captures most icons which thanks to GdkPixbuf
+	 * are frequently reloaded.
 	 */
-	if (width * height < 128) {
+	if (width * height < 32*32) {
 	    _emit_image (ret, NULL);
 	    _trace_printf (" dup /s%ld exch def\n",
 			   surface_id);


More information about the cairo-commit mailing list