diff options
author | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-09-19 06:14:38 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-11-11 17:08:00 -0500 |
commit | 4f8868e37fabb804d4557db9f9bf9dc53f72bbe4 (patch) | |
tree | 17edccd557ac87f0166f6e75153fc9425cad1fe5 | |
parent | abefe68ae2a422fecf315f17430c0cda5561be66 (diff) |
Use the destination buffer directly in more cases instead of fetching.direct-destination
When the destination buffer is either a8r8g8b8 or x8r8g8b8, we can use
it directly instead of fetching into a temporary buffer. When the
format is x8r8g8b8, we require the operator to not make use of
destination alpha, but when it is a8r8g8b8, there are no restrictions.
This is approximately a 5% speedup on the poppler cairo benchmark:
[ # ] backend test min(s) median(s) stddev. count
Before:
[ 0] image poppler 6.661 6.709 0.59% 6/6
After:
[ 0] image poppler 6.307 6.320 0.12% 5/6
-rw-r--r-- | pixman/pixman-general.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c index 3ead3dac..c96a3f97 100644 --- a/pixman/pixman-general.c +++ b/pixman/pixman-general.c @@ -133,15 +133,27 @@ general_composite_rect (pixman_implementation_t *imp, /* Skip the store step and composite directly into the * destination if the output format of the compose func matches * the destination format. + * + * If the destination format is a8r8g8b8 then we can always do + * this. If it is x8r8g8b8, then we can only do it if the + * operator doesn't make use of destination alpha. */ - if (!wide && - !dest->common.alpha_map && - !dest->bits.write_func && - (op == PIXMAN_OP_ADD || op == PIXMAN_OP_OVER) && - (dest->bits.format == PIXMAN_a8r8g8b8 || - dest->bits.format == PIXMAN_x8r8g8b8)) + if ((dest->bits.format == PIXMAN_a8r8g8b8) || + (dest->bits.format == PIXMAN_x8r8g8b8 && + (op == PIXMAN_OP_OVER || + op == PIXMAN_OP_ADD || + op == PIXMAN_OP_SRC || + op == PIXMAN_OP_CLEAR || + op == PIXMAN_OP_IN_REVERSE || + op == PIXMAN_OP_OUT_REVERSE || + op == PIXMAN_OP_DST))) { - store = NULL; + if (!wide && + !dest->common.alpha_map && + !dest->bits.write_func) + { + store = NULL; + } } if (!store) |