[cairo-commit] cairo/src cairo-pattern.c,1.64,1.65

Owen Taylor commit at pdx.freedesktop.org
Wed Aug 31 03:42:19 EST 2005


Committed by: otaylor

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv26137/src

Modified Files:
	cairo-pattern.c 
Log Message:
2005-08-27  Owen Taylor  <otaylor at redhat.com>

        * src/cairo-pattern.c (_cairo_pattern_acquire_surface_for_gradient):
        Use a 8xN rather than a 1xN strip for a vertical gradient. This
        is much more tolerant of slow compositing code, and is worth some
        extra expense computing the gradient. (#4263, found in test case
        from Richard Stellingwerff)


Index: cairo-pattern.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pattern.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- cairo-pattern.c	24 Aug 2005 02:52:09 -0000	1.64
+++ cairo-pattern.c	30 Aug 2005 17:42:17 -0000	1.65
@@ -1230,8 +1230,15 @@
 	    height = 1;
 	    repeat = TRUE;
 	}
-	if (is_vertical) {
-	    width = 1;
+	/* width-1 repeating patterns are quite slow with scan-line based
+	 * compositing code, so we use a wider strip and spend some extra
+	 * expense in computing the gradient. It's possible that for narrow
+	 * gradients we'd be better off using a 2 or 4 pixel strip; the
+	 * wider the gradient, the more it's worth spending extra time
+	 * computing a sample.
+	 */
+	if (is_vertical && width > 8) {
+	    width = 8;
 	    repeat = TRUE;
 	}
     }



More information about the cairo-commit mailing list