From 13ce88f80095d0fa18330a23e03819368987e277 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 24 Jan 2011 11:35:27 -0500 Subject: [PATCH] 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. --- pixman/pixman-noop.c | 19 +++++++++++++++++++ pixman/pixman.c | 2 -- 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, -- 2.7.4