<div dir="ltr">The old code is comparing pixman_fixed_48_16_t values to pixman_fixed_16_16_t values, thus it is checking for truncation of overflow values.<div><br></div><div>It would probably be better to clamp these overflowed values, like pixman_transform_point_31_16 is doing to clamp to the pixman_fixed_48_16 result. Right now the result is an odd mix of clamping and modulus. A rewrite to go directly to clamped pixman_fixed_16_16 values would be even better.</div><div><br><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 26, 2016 at 10:59 AM, Petr Kobalíček <span dir="ltr"><<a href="mailto:kobalicek.petr@gmail.com" target="_blank">kobalicek.petr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Doesn't this check for NaNs?</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 24, 2016 at 8:22 PM, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">With commit ed39992564b "Use pixman_transform_point_31_16() from<br>
pixman_transform_point()" we added some strange hunks.<br>
<br>
Namely: we copy the data from the internal storage to the user vector<br>
only to compare them immediately after.<br>
<br>
Cc: Siarhei Siamashka <<a href="mailto:siarhei.siamashka@gmail.com" target="_blank">siarhei.siamashka@gmail.com</a>><br>
---<br>
<br>
Siarhei, what is the intent with the original commit ? Any ideas why<br>
things crash ?<br>
<br>
Seemingly this can be dropped/replaced with TRUE, yet it causes one of<br>
the tests () to segfault in the optimised SSE2 codepath -<br>
scaled_bilinear_scanline_sse2_8888_8888_SRC.<br>
<br>
BILINEAR_INTERPOLATE_ONE_PIXEL -> BILINEAR_INTERPOLATE_ONE_PIXEL_HELPER<br>
<br>
Regards,<br>
Emil<br>
---<br>
<br>
 pixman/pixman-matrix.c | 8 ++------<br>
 1 file changed, 2 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/pixman/pixman-matrix.c b/pixman/pixman-matrix.c<br>
index 65b3d32..117015b 100644<br>
--- a/pixman/pixman-matrix.c<br>
+++ b/pixman/pixman-matrix.c<br>
@@ -393,9 +393,7 @@ pixman_transform_point_3d (const struct pixman_transform *transform,<br>
     vector->vector[1] = tmp.v[1];<br>
     vector->vector[2] = tmp.v[2];<br>
<br>
-    return vector->vector[0] == tmp.v[0] &&<br>
-           vector->vector[1] == tmp.v[1] &&<br>
-           vector->vector[2] == tmp.v[2];<br>
+    return TRUE;<br>
 }<br>
<br>
 PIXMAN_EXPORT pixman_bool_t<br>
@@ -414,9 +412,7 @@ pixman_transform_point (const struct pixman_transform *transform,<br>
     vector->vector[1] = tmp.v[1];<br>
     vector->vector[2] = tmp.v[2];<br>
<br>
-    return vector->vector[0] == tmp.v[0] &&<br>
-           vector->vector[1] == tmp.v[1] &&<br>
-           vector->vector[2] == tmp.v[2];<br>
+    return TRUE;<br>
 }<br>
<br>
 PIXMAN_EXPORT pixman_bool_t<br>
<span><font color="#888888">--<br>
2.8.0<br>
<br>
_______________________________________________<br>
Pixman mailing list<br>
<a href="mailto:Pixman@lists.freedesktop.org" target="_blank">Pixman@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/pixman" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/pixman</a><br>
</font></span></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Pixman mailing list<br>
<a href="mailto:Pixman@lists.freedesktop.org">Pixman@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/pixman" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/pixman</a><br>
<br></blockquote></div><br></div>