Use a clip region when rendering a non-solid pattern through a rectangular path ... trapezoid rasterization is just too slow to use that path when we aren't forced to do so.

This commit is contained in:
Owen Taylor 2005-06-15 12:44:52 +00:00
parent fac3cd46b3
commit a3906e65aa
2 changed files with 23 additions and 9 deletions

View file

@ -1,3 +1,10 @@
2005-06-15 Owen Taylor <otaylor@redhat.com>
* src/cairo-gstate.c (_cairo_gstate_clip_and_composite_trapezoids):
Use a clip region when rendering a non-solid pattern through
a rectangular path ... trapezoid rasterization is just too slow
to use that path when we aren't forced to do so.
2005-06-15 Carl Worth <cworth@cworth.org>
* test/cairo-test.c: Track removal of cairo_status_string.

View file

@ -1417,16 +1417,23 @@ _cairo_gstate_clip_and_composite_trapezoids (cairo_gstate_t *gstate,
/* Solid rectangles are handled specially */
status = _composite_trap_region_solid (gstate, (cairo_solid_pattern_t *)src,
operator, dst, trap_region);
} else if (trap_region && pixman_region_num_rects (trap_region) <= 1) {
/* For a simple rectangle, we can just use composite(), for more
* rectangles, we'd have to set a clip region. That might still
* be a win, but it's less obvious. (Depends on the backend)
*/
status = _composite_trap_region (gstate, src, operator, dst,
trap_region, &extents);
} else {
status = _composite_traps (gstate, src, operator,
dst, traps, &extents);
if (trap_region) {
/* For a simple rectangle, we can just use composite(), for more
* rectangles, we have to set a clip region. The cost of rasterizing
* trapezoids is pretty high for most backends currently, so it's
* worthwhile even if a region is needed.
*/
status = _composite_trap_region (gstate, src, operator, dst,
trap_region, &extents);
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
goto out;
/* If a clip regions aren't supported, fall through */
}
status = _composite_traps (gstate, src, operator,
dst, traps, &extents);
}
}