From: Bill Spitzak <[email protected]>

The desired result from the integration is directly available, as the range has 
been
clipped to the intersection of the two boxes. As this filter is probably the 
most
common one, this optimization looks very useful.

Signed-off-by: Bill Spitzak <[email protected]>
---
 pixman/pixman-filter.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index 6d589c2..8dfb49b 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -171,6 +171,11 @@ integral (pixman_kernel_t kernel1,
     {
        return filters[kernel2].func (-pos * scale) * scale;
     }
+    else if (kernel1 == PIXMAN_KERNEL_BOX && kernel2 == PIXMAN_KERNEL_BOX)
+    {
+       assert (high <= low + 1.0);
+       return (high - low) * scale;
+    }
     /* If the integration interval crosses zero, break it into
      * two separate integrals. This ensures that filters such
      * as LINEAR that are not differentiable at 0 will still
-- 
1.9.1

_______________________________________________
Pixman mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to