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

Bill Spitzak <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <1410487950-55268-11-git-send-email-spitzak__15506.2479120263$1410488077$gmane$org@gmail.com>
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 78ea72d..d763138 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -230,6 +230,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

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.