summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-03 14:25:54 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-03 14:32:10 +0000
commit239cfb99f9697392d7c25328093e6662ad04bdc9 (patch)
tree2ff215f0f4c530e5a9edd476500ee2f93a222b1b
parente2542bad88573e590ef4cbeed6b5884166b56adb (diff)
sna: Unroll the quadword upload of the glyph data
We know that the length is nicely aligned and so can avoid a relatively expensive call into memcpy. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b457dd20..95a149eb 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -6877,7 +6877,6 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
do {
CharInfoPtr c = *info++;
- uint8_t *glyph = FONTGLYPHBITS(base, c);
int w = GLYPHWIDTHPIXELS(c);
int h = GLYPHHEIGHTPIXELS(c);
int w8 = (w + 7) >> 3;
@@ -6930,7 +6929,16 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc,
b[0] = br00 | (1 + len);
b[1] = (uint16_t)y1 << 16 | (uint16_t)x1;
b[2] = (uint16_t)(y1+h) << 16 | (uint16_t)(x1+w);
- memcpy(b+3, glyph, w8*h);
+ {
+ uint32_t *glyph = (uint32_t*)c->bits;
+ b += 3;
+ do {
+ *b++ = *glyph++;
+ *b++ = *glyph++;
+
+ len -= 2;
+ } while (len);
+ }
if (damage) {
BoxRec r;