mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 00:38:06 +02:00
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)
This commit is contained in:
parent
2120864edf
commit
a4418a63d7
2 changed files with 17 additions and 2 deletions
|
|
@ -1,3 +1,11 @@
|
|||
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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue