[Pixman] [PATCH v14 13/22] pixman-filter: integral splitting is only needed for triangle filter

spitzak at gmail.com spitzak at gmail.com
Mon Mar 7 01:06:48 UTC 2016


From: Bill Spitzak <spitzak at gmail.com>

Only the triangle is discontinuous at 0. The other filters resemble a cubic closely
enough that Simpsons integration works without splitting.

Signed-off-by: Bill Spitzak <spitzak at gmail.com>
---
 pixman/pixman-filter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index f9ad45f..6d589c2 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -176,13 +176,13 @@ integral (pixman_kernel_t kernel1,
      * as LINEAR that are not differentiable at 0 will still
      * integrate properly.
      */
-    else if (low < 0 && high > 0)
+    else if (kernel1 == PIXMAN_KERNEL_LINEAR && low < 0 && high > 0)
     {
 	return
 	    integral (kernel1, kernel2, scale, pos, low, 0) +
 	    integral (kernel1, kernel2, scale, pos, 0, high);
     }
-    else if (low < pos && high > pos)
+    else if (kernel2 == PIXMAN_KERNEL_LINEAR && low < pos && high > pos)
     {
 	return
 	    integral (kernel1, kernel2, scale, pos, low, pos) +
-- 
1.9.1



More information about the Pixman mailing list