xf86-video-intel: src/sna/sna_trapezoids_imprecise.c src/sna/sna_trapezoids_precise.c
Chris Wilson
ickle at kemper.freedesktop.org
Wed Feb 25 09:52:56 PST 2015
src/sna/sna_trapezoids_imprecise.c | 10 ++++++++++
src/sna/sna_trapezoids_precise.c | 10 ++++++++++
2 files changed, 20 insertions(+)
New commits:
commit ea09d830c8651fe854ba772a9e28e8a5f601b1c1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Feb 25 17:20:28 2015 +0000
sna/trapezoids: Restore lost xTrapezoidValid() checks
When fixing up the sample projection of the trapezoids, we lost the
safety check that the trapezoid was valid.
Fixes regression from
commit bca08dc4155c0ee304c60340ccf95fe7b03ac11b [2.99.917]
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Sep 29 19:30:03 2014 +0100
sna/trapezoids: Fix loss of precision through projection onto sample grid
Reported-by: Jiri Slaby <jirislaby at gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c95
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_trapezoids_imprecise.c b/src/sna/sna_trapezoids_imprecise.c
index 60c1387..df22add 100644
--- a/src/sna/sna_trapezoids_imprecise.c
+++ b/src/sna/sna_trapezoids_imprecise.c
@@ -962,6 +962,16 @@ tor_add_trapezoid(struct tor *tor,
const xTrapezoid *t,
int dx, int dy)
{
+ 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));
+ return;
+ }
polygon_add_edge(tor->polygon, t, &t->left, 1, dx, dy);
polygon_add_edge(tor->polygon, t, &t->right, -1, dx, dy);
}
diff --git a/src/sna/sna_trapezoids_precise.c b/src/sna/sna_trapezoids_precise.c
index e7ea433..f1532d3 100644
--- a/src/sna/sna_trapezoids_precise.c
+++ b/src/sna/sna_trapezoids_precise.c
@@ -1023,6 +1023,16 @@ tor_init(struct tor *converter, const BoxRec *box, int num_edges)
static void
tor_add_trapezoid(struct tor *tor, const xTrapezoid *t, int dx, int dy)
{
+ 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));
+ return;
+ }
polygon_add_edge(tor->polygon, t, &t->left, 1, dx, dy);
polygon_add_edge(tor->polygon, t, &t->right, -1, dx, dy);
}
More information about the xorg-commit
mailing list