diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/cairo-pattern.c | 11 |
2 files changed, 17 insertions, 2 deletions
@@ -1,5 +1,13 @@ 2005-08-27 Owen Taylor <otaylor@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) + +2005-08-27 Owen Taylor <otaylor@redhat.com> + reviewed by: cworth * src/cairo-traps.c (_cairo_traps_extract_region): Make the diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index 7b0130f6a..162d6bf49 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -1230,8 +1230,15 @@ _cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern, 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; } } |