summaryrefslogtreecommitdiff
path: root/src/sna/sna_trapezoids_imprecise.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-28 07:05:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-28 07:07:40 +0100
commit24cb50e53c789cb7a05d59ad103dda1c3a009485 (patch)
tree92f168d9a49e93bede42d2709260359016ff069a /src/sna/sna_trapezoids_imprecise.c
parent72c041e57b99367f327c51c50fce2a55d618fc63 (diff)
sna/trapezoids: Handle mono traps just in case
I disabled a few paths and ended up in an assert that mono trapezoids shouldn't get that far... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_trapezoids_imprecise.c')
-rw-r--r--src/sna/sna_trapezoids_imprecise.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/sna/sna_trapezoids_imprecise.c b/src/sna/sna_trapezoids_imprecise.c
index 69f8ae89..ebde7622 100644
--- a/src/sna/sna_trapezoids_imprecise.c
+++ b/src/sna/sna_trapezoids_imprecise.c
@@ -1505,6 +1505,15 @@ inplace_end_subrows(struct active_list *active, uint8_t *row,
}
static void
+convert_mono(uint8_t *ptr, int w)
+{
+ while (w--) {
+ *ptr = 0xff * (*ptr >= 0xf0);
+ ptr++;
+ }
+}
+
+static void
tor_inplace(struct tor *converter, PixmapPtr scratch, int mono, uint8_t *buf)
{
int i, j, h = converter->extents.y2;
@@ -1516,7 +1525,6 @@ tor_inplace(struct tor *converter, PixmapPtr scratch, int mono, uint8_t *buf)
int width = scratch->drawable.width;
__DBG(("%s: mono=%d, buf?=%d\n", __FUNCTION__, mono, buf != NULL));
- assert(!mono);
assert(converter->extents.y1 == 0);
assert(converter->extents.x1 == 0);
assert(scratch->drawable.depth == 8);
@@ -1552,6 +1560,8 @@ tor_inplace(struct tor *converter, PixmapPtr scratch, int mono, uint8_t *buf)
if (do_full_step) {
memset(ptr, 0, width);
inplace_row(active, ptr, width);
+ if (mono)
+ convert_mono(ptr, width);
if (row != ptr)
memcpy(row, ptr, width);
@@ -1584,8 +1594,11 @@ tor_inplace(struct tor *converter, PixmapPtr scratch, int mono, uint8_t *buf)
}
assert(min >= 0 && max <= width);
memset(row, 0, min);
- if (max > min)
+ if (max > min) {
inplace_end_subrows(active, row+min, (int8_t*)ptr+min, max-min);
+ if (mono)
+ convert_mono(row+min, max-min);
+ }
if (max < width)
memset(row+max, 0, width-max);
}