From bf879f1b37cfe5ee2ec921d26bf9d9126ca59b9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Thu, 30 Apr 2009 02:25:48 -0400 Subject: [PATCH] Simplify logic to compute store function --- pixman/pixman-compose.c | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c index 577b489..1f9a689 100644 --- a/pixman/pixman-compose.c +++ b/pixman/pixman-compose.c @@ -246,40 +246,29 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data, fetchDest = get_fetch_external_alpha(wide); store = get_store_external_alpha(wide); - if (data->op == PIXMAN_OP_CLEAR || data->op == PIXMAN_OP_SRC) - fetchDest = NULL; } else { fetchDest = get_fetch(wide); store = get_store(wide); - switch (data->op) - { - case PIXMAN_OP_CLEAR: - case PIXMAN_OP_SRC: - fetchDest = NULL; #ifndef PIXMAN_FB_ACCESSORS - /* fall-through */ - case PIXMAN_OP_ADD: - case PIXMAN_OP_OVER: - switch (data->dest->bits.format) { - case PIXMAN_a8r8g8b8: - case PIXMAN_x8r8g8b8: - // Skip the store step and composite directly into the - // destination if the output format of the compose func matches - // the destination format. - if (!wide) - store = NULL; - break; - default: - break; - } -#endif - break; + // Skip the store step and composite directly into the + // destination if the output format of the compose func matches + // the destination format. + if (!wide && + (data->op == PIXMAN_OP_ADD || data->op == PIXMAN_OP_OVER) && + (data->dest->bits.format == PIXMAN_a8r8g8b8 || + data->dest->bits.format == PIXMAN_x8r8g8b8)) + { + store = NULL; } +#endif } + if (data->op == PIXMAN_OP_CLEAR || data->op == PIXMAN_OP_SRC) + fetchDest = NULL; + if (!store) { bits = data->dest->bits.bits; -- 2.7.4