diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index 41058c68..284f77e2 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -2515,13 +2515,15 @@ fill: return false; } - if (sna_transform_is_imprecise_integer_translation(src->transform, src->filter, - dst->polyMode == PolyModePrecise, - &tx, &ty)) { + if (!sna_transform_is_imprecise_integer_translation(src->transform, src->filter, + dst->polyMode == PolyModePrecise, + &tx, &ty)) { DBG(("%s: source transform is not an integer translation\n", __FUNCTION__)); return false; } + DBG(("%s: converting transform to integer translation? (%d, %d)\n", + __FUNCTION__, src->transform != NULL, tx, ty)); x += tx; y += ty; diff --git a/src/sna/sna_transform.c b/src/sna/sna_transform.c index 57d1987a..3b54df48 100644 --- a/src/sna/sna_transform.c +++ b/src/sna/sna_transform.c @@ -102,36 +102,49 @@ sna_transform_is_imprecise_integer_translation(const PictTransform *t, int16_t *tx, int16_t *ty) { if (t == NULL) { + DBG(("%s: no transform\n", __FUNCTION__)); *tx = *ty = 0; return true; } + DBG(("%s: FilterNearest?=%d, precise?=%d, transform=[%f %f %f, %f %f %f, %f %f %f]\n", + __FUNCTION__, filter==PictFilterNearest, precise, + t->matrix[0][0]/65536., t->matrix[0][1]/65536., t->matrix[0][2]/65536., + t->matrix[1][0]/65536., t->matrix[1][1]/65536., t->matrix[1][2]/65536., + t->matrix[2][0]/65536., t->matrix[2][1]/65536., t->matrix[2][2]/65536.)); + if (t->matrix[0][0] != IntToxFixed(1) || t->matrix[0][1] != 0 || t->matrix[1][0] != 0 || t->matrix[1][1] != IntToxFixed(1) || t->matrix[2][0] != 0 || t->matrix[2][1] != 0 || - t->matrix[2][2] != IntToxFixed(1)) + t->matrix[2][2] != IntToxFixed(1)) { + DBG(("%s: not unity scaling\n", __FUNCTION__)); return false; + } - DBG(("%s: filter=%d, translation (%x, %x), precise? %d\n", - __FUNCTION__, filter, t->matrix[0][2], t->matrix[1][2], precise)); if (filter != PictFilterNearest) { if (precise) { if (pixman_fixed_fraction(t->matrix[0][2]) || - pixman_fixed_fraction(t->matrix[1][2])) + pixman_fixed_fraction(t->matrix[1][2])) { + DBG(("%s: precise, fractional translation\n", __FUNCTION__)); return false; + } } else { int f; f = pixman_fixed_fraction(t->matrix[0][2]); - if (f < IntToxFixed(1)/4 || f > IntToxFixed(3)/4) + if (f < IntToxFixed(1)/4 || f > IntToxFixed(3)/4) { + DBG(("%s: imprecise, fractional translation X\n", __FUNCTION__)); return false; + } f = pixman_fixed_fraction(t->matrix[1][2]); - if (f < IntToxFixed(1)/4 || f > IntToxFixed(3)/4) + if (f < IntToxFixed(1)/4 || f > IntToxFixed(3)/4) { + DBG(("%s: imprecise, fractional translation Y\n", __FUNCTION__)); return false; + } } }