sna/trapezoids: Fix comparison on right edge of trapezoids

We need to compare the fixed ceiling rather the floor for accuracy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-10-01 10:28:10 +01:00
parent c6d9303303
commit de7185bbf4
5 changed files with 16 additions and 20 deletions

View File

@ -75,8 +75,16 @@ bool trapezoids_bounds(int n, const xTrapezoid *t, BoxPtr box)
do {
xFixed fx1, fx2, v;
if (!xTrapezoidValid(t))
if (!xTrapezoidValid(t)) {
__DBG(("%s: skipping invalid trapezoid: top=%d, bottom=%d, left=(%d, %d), (%d, %d), right=(%d, %d), (%d, %d)\n",
__FUNCTION__,
t->top, t->bottom,
t->left.p1.x, t->left.p1.y,
t->left.p2.x, t->left.p2.y,
t->right.p1.x, t->right.p1.y,
t->right.p2.x, t->right.p2.y));
continue;
}
if (t->top < y1)
y1 = t->top;
@ -104,7 +112,7 @@ bool trapezoids_bounds(int n, const xTrapezoid *t, BoxPtr box)
}
if (((x2 - t->right.p1.x) | (x2 - t->right.p2.x)) < 0) {
if (pixman_fixed_floor(t->right.p1.x) == pixman_fixed_floor(t->right.p2.x)) {
if (pixman_fixed_ceil(t->right.p1.x) == pixman_fixed_ceil(t->right.p2.x)) {
x2 = pixman_fixed_ceil(t->right.p1.x);
} else {
if (t->right.p1.y == t->top)

View File

@ -13,6 +13,12 @@
#define NO_IMPRECISE 0
#define NO_PRECISE 0
#if 0
#define __DBG DBG
#else
#define __DBG(x)
#endif
bool
composite_aligned_boxes(struct sna *sna,
CARD8 op,

View File

@ -42,12 +42,6 @@
#undef SAMPLES_X
#undef SAMPLES_Y
#if 0
#define __DBG DBG
#else
#define __DBG(x)
#endif
/* TODO: Emit unantialiased and MSAA triangles. */
#ifndef MAX

View File

@ -39,12 +39,6 @@
#include <mipict.h>
#if 0
#define __DBG(x) LogF x
#else
#define __DBG(x)
#endif
struct quorem {
int32_t quo;
int32_t rem;

View File

@ -42,12 +42,6 @@
#undef FAST_SAMPLES_X
#undef FAST_SAMPLES_Y
#if 0
#define __DBG DBG
#else
#define __DBG(x)
#endif
/* TODO: Emit unantialiased and MSAA triangles. */
#ifndef MAX