_cairo_pattern_get_extents: Fix to allow for expansion based on filter
This fixes the filter-bilinear-extents test case and the related bug entry: bad clipping with EXTEND_NONE http://bugs.freedesktop.org/show_bug.cgi?id=15349 Though there are still differences in the PDF and PostScript backends, (primarily because we can't capture cairo's filter modes in those file formats).
|
|
@ -2098,6 +2098,28 @@ _cairo_pattern_get_extents (cairo_pattern_t *pattern,
|
|||
x2 = x1 + surface_extents.width;
|
||||
y2 = y1 + surface_extents.height;
|
||||
|
||||
/* The filter can effectively enlarge the extents of the
|
||||
* pattern, so extend as necessary. Note: We aren't doing any
|
||||
* backend-specific querying of filter box sizes at this time,
|
||||
* (since currently no specific backends that could do custom
|
||||
* filters are calling _cairo_pattern_get_extents). */
|
||||
switch (pattern->filter) {
|
||||
case CAIRO_FILTER_GOOD:
|
||||
case CAIRO_FILTER_BEST:
|
||||
case CAIRO_FILTER_BILINEAR:
|
||||
x1 -= 0.5;
|
||||
y1 -= 0.5;
|
||||
x2 += 0.5;
|
||||
y2 += 0.5;
|
||||
break;
|
||||
case CAIRO_FILTER_FAST:
|
||||
case CAIRO_FILTER_NEAREST:
|
||||
case CAIRO_FILTER_GAUSSIAN:
|
||||
default:
|
||||
/* Nothing to do */
|
||||
break;
|
||||
}
|
||||
|
||||
imatrix = pattern->matrix;
|
||||
status = cairo_matrix_invert (&imatrix);
|
||||
/* cairo_pattern_set_matrix ensures the matrix is invertible */
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 505 B After Width: | Height: | Size: 756 B |
|
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 229 B |
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 229 B |
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 243 B |