From 5332547a0ac6ae6b9f1a6c6428e6fdbdf303108f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 8 Feb 2010 17:14:34 +0100 Subject: [PATCH] glamor: Fix prepare_access on 1bpp data. Apparently I don't have anything hitting this path, so I'm not sure if it's good or not. --- glamor/glamor_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c index 4d03bd718..4ec8540f0 100644 --- a/glamor/glamor_core.c +++ b/glamor/glamor_core.c @@ -351,15 +351,16 @@ glamor_prepare_access(DrawablePtr drawable, glamor_access_t access) for (y = 0; y < pixmap->drawable.height; y++) { uint8_t *read_row = read + read_stride * (pixmap->drawable.height - y - 1); + uint8_t *write_row = data + y * stride; for (x = 0; x < pixmap->drawable.width; x++) { int index = x / 8; int bit = 1 << (x % 8); if (read_row[x]) - data[index] |= bit; + write_row[index] |= bit; else - data[index] &= ~bit; + write_row[index] &= ~bit; } } } else {