[Pixman] [RFC 1/2] Remove seemingly unneeded comparison(s)
Bill Spitzak
spitzak at gmail.com
Tue Apr 26 18:12:45 UTC 2016
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.
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.
On Tue, Apr 26, 2016 at 10:59 AM, Petr Kobalíček <kobalicek.petr at gmail.com>
wrote:
> Doesn't this check for NaNs?
>
> On Sun, Apr 24, 2016 at 8:22 PM, Emil Velikov <emil.l.velikov at gmail.com>
> wrote:
>
>> With commit ed39992564b "Use pixman_transform_point_31_16() from
>> pixman_transform_point()" we added some strange hunks.
>>
>> Namely: we copy the data from the internal storage to the user vector
>> only to compare them immediately after.
>>
>> Cc: Siarhei Siamashka <siarhei.siamashka at gmail.com>
>> ---
>>
>> Siarhei, what is the intent with the original commit ? Any ideas why
>> things crash ?
>>
>> Seemingly this can be dropped/replaced with TRUE, yet it causes one of
>> the tests () to segfault in the optimised SSE2 codepath -
>> scaled_bilinear_scanline_sse2_8888_8888_SRC.
>>
>> BILINEAR_INTERPOLATE_ONE_PIXEL -> BILINEAR_INTERPOLATE_ONE_PIXEL_HELPER
>>
>> Regards,
>> Emil
>> ---
>>
>> pixman/pixman-matrix.c | 8 ++------
>> 1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/pixman/pixman-matrix.c b/pixman/pixman-matrix.c
>> index 65b3d32..117015b 100644
>> --- a/pixman/pixman-matrix.c
>> +++ b/pixman/pixman-matrix.c
>> @@ -393,9 +393,7 @@ pixman_transform_point_3d (const struct
>> pixman_transform *transform,
>> vector->vector[1] = tmp.v[1];
>> vector->vector[2] = tmp.v[2];
>>
>> - return vector->vector[0] == tmp.v[0] &&
>> - vector->vector[1] == tmp.v[1] &&
>> - vector->vector[2] == tmp.v[2];
>> + return TRUE;
>> }
>>
>> PIXMAN_EXPORT pixman_bool_t
>> @@ -414,9 +412,7 @@ pixman_transform_point (const struct pixman_transform
>> *transform,
>> vector->vector[1] = tmp.v[1];
>> vector->vector[2] = tmp.v[2];
>>
>> - return vector->vector[0] == tmp.v[0] &&
>> - vector->vector[1] == tmp.v[1] &&
>> - vector->vector[2] == tmp.v[2];
>> + return TRUE;
>> }
>>
>> PIXMAN_EXPORT pixman_bool_t
>> --
>> 2.8.0
>>
>> _______________________________________________
>> Pixman mailing list
>> Pixman at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/pixman
>>
>
>
> _______________________________________________
> Pixman mailing list
> Pixman at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pixman
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20160426/20bafe7a/attachment.html>
More information about the Pixman
mailing list