[Pixman] [PATCH pixman 10/11] pixman-filter: BOX.IMPULSE is same as IMPULSE.IMPULSE

Bill Spitzak spitzak at gmail.com
Wed Sep 10 19:02:04 PDT 2014


The subsampling can be ignored as all the filters are identical.
Code trying to duplicate PIXMAN_FILTER_NEAREST may generate this, so
it may pay off to have this optimization.
---
 pixman/pixman-filter.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index 9860f7f..ebb428a 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -225,6 +225,8 @@ filter_width (pixman_kernel_t reconstruct,
 	      pixman_kernel_t sample,
 	      double scale)
 {
+    if (reconstruct == PIXMAN_KERNEL_BOX && sample == PIXMAN_KERNEL_IMPULSE)
+	return 0;
     return ceil(scale * filters[sample].width + filters[reconstruct].width);
 }
 
-- 
1.7.9.5



More information about the Pixman mailing list