diff options
author | Bill Spitzak <spitzak@gmail.com> | 2014-10-09 19:46:11 -0700 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2014-10-10 18:08:48 -0700 |
commit | c8b1bf55ad016de0675f4e924fdb8e17051a029c (patch) | |
tree | 46e2c99f130fb1cd7fe04f05358dd81cbe8f3fb5 /src/cairo-image-source.c | |
parent | 82cd66f8330da0521c29c003ef0a4bb773d6dbc6 (diff) | |
download | cairo-c8b1bf55ad016de0675f4e924fdb8e17051a029c.tar.gz |
image: Move filter decision to _cairo_pattern_analyze_filter
The analysis to deterimine if the GOOD filter can be replaced with
the BILINEAR filter is moved to this function so it can be used
by backends other than the image backend.
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Diffstat (limited to 'src/cairo-image-source.c')
-rw-r--r-- | src/cairo-image-source.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/cairo-image-source.c b/src/cairo-image-source.c index b6b6b9f55..950053db2 100644 --- a/src/cairo-image-source.c +++ b/src/cairo-image-source.c @@ -941,21 +941,17 @@ _pixman_image_set_properties (pixman_image_t *pixman_image, pixman_filter = PIXMAN_FILTER_FAST; break; case CAIRO_FILTER_GOOD: - pixman_filter = PIXMAN_FILTER_GOOD; - if (dx > 1.35 || dy > 1.35) { - pixman_filter = PIXMAN_FILTER_SEPARABLE_CONVOLUTION; - kernel = KERNEL_BOX; - /* Clip the filter size to prevent extreme slowness. This - value could be raised if 2-pass filtering is done */ - if (dx > 16.0) dx = 16.0; - /* Match the bilinear filter for dimension scaling up: */ - else if (dx < 1.0) dx = 1.0; - if (dy > 16.0) dy = 16.0; - else if (dy < 1.0) dy = 1.0; - } + pixman_filter = PIXMAN_FILTER_SEPARABLE_CONVOLUTION; + kernel = KERNEL_BOX; + /* Clip the filter size to prevent extreme slowness. This + value could be raised if 2-pass filtering is done */ + if (dx > 16.0) dx = 16.0; + if (dy > 16.0) dy = 16.0; + /* Match the bilinear filter for scales > .75: */ + if (dx < 1.0/0.75) dx = 1.0; + if (dy < 1.0/0.75) dy = 1.0; break; case CAIRO_FILTER_BEST: - pixman_filter = PIXMAN_FILTER_BEST; pixman_filter = PIXMAN_FILTER_SEPARABLE_CONVOLUTION; kernel = KERNEL_CATMULL_ROM; /* LANCZOS3 is better but not much */ /* Clip the filter size to prevent extreme slowness. This |