Curiosity regarding implementation details of SkMatrix::Poly4Proc

16 views
Skip to first unread message

Alexandru-Gabriel Ică

unread,
Oct 14, 2024, 8:17:08 AMOct 14
to skia-discuss
Hi everyone!

I was reading the source of SkMatrix::setPolyToPoly and inside Poly4Proc I noticed lines like this one:

/* check if abs(x2) > abs(y2) */
if (x2 > 0 ? y2 > 0 ? x2 > y2 : x2 > -y2 : y2 > 0 ? -x2 > y2 : x2 < y2)

Is there any particular reason why the standard abs() function is not used here, like in the comment?

Thank you.

Florin Malita

unread,
Oct 14, 2024, 10:01:08 AMOct 14
to skia-d...@googlegroups.com
There's no good reason in this day and age.

That code is ancient though, who knows what platform/library restrictions it was targeting at the time.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/58a639cb-a787-4a3f-966e-b0a699d2381en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages