summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2011-01-24 11:35:27 -0500
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-05-19 13:45:59 +0000
commit13ce88f80095d0fa18330a23e03819368987e277 (patch)
tree9e809c059fc4b5576138dce98de80aa8e1204f47
parent8c76235f41b2ac70ce6e652dcd1cab975e1283a4 (diff)
Add a noop composite function for the DST operator
The DST operator doesn't actually do anything, so add a noop "fast path" for it, instead of checking in pixman_image_composite32(). The performance tradeoff here is that we get rid of a test for DST in the common case where the operator is not DST, in return for an extra walk over the clip rectangles in the uncommon case where the operator actually is DST.
-rw-r--r--pixman/pixman-noop.c19
-rw-r--r--pixman/pixman.c2
2 files changed, 19 insertions, 2 deletions
diff --git a/pixman/pixman-noop.c b/pixman/pixman-noop.c
index 50bbfb0..673a02a 100644
--- a/pixman/pixman-noop.c
+++ b/pixman/pixman-noop.c
@@ -30,8 +30,27 @@
#include "pixman-combine32.h"
#include "pixman-fast-path.h"
+static void
+noop_composite (pixman_implementation_t *imp,
+ pixman_op_t op,
+ pixman_image_t * src,
+ pixman_image_t * mask,
+ pixman_image_t * dest,
+ int32_t src_x,
+ int32_t src_y,
+ int32_t mask_x,
+ int32_t mask_y,
+ int32_t dest_x,
+ int32_t dest_y,
+ int32_t width,
+ int32_t height)
+{
+ return;
+}
+
static const pixman_fast_path_t noop_fast_paths[] =
{
+ { PIXMAN_OP_DST, PIXMAN_any, 0, PIXMAN_any, 0, PIXMAN_any, 0, noop_composite },
{ PIXMAN_OP_NONE },
};
diff --git a/pixman/pixman.c b/pixman/pixman.c
index f21af2f..61d3a92 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -761,8 +761,6 @@ pixman_image_composite32 (pixman_op_t op,
* mathematically equivalent to the source.
*/
op = optimize_operator (op, src_flags, mask_flags, dest_flags);
- if (op == PIXMAN_OP_DST)
- goto out;
if (lookup_composite_function (op,
src_format, src_flags,