summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2016-03-06 17:06:49 -0800
committerSøren Sandmann Pedersen <soren.sandmann@gmail.com>2016-03-11 00:00:46 -0500
commitff2bb4dc182b1f71cab0447af348e246b3c10c04 (patch)
treeb65d07c546d293b150bf67caa6dc1402a6640079
parente504c3524ed454f47838541321737a499d2e5665 (diff)
pixman-filter: Do BOX.BOX much faster
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 <spitzak@gmail.com>
-rw-r--r--pixman/pixman-filter.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index 6d589c2b..8dfb49be 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