Interesting. I think this is related: (found using google)
There are limitations that developers need to be aware of. For instance, *if
the quadrilateral points form a bow tie* (they cross), then PolyToPolyMapcan't
succeed. It will likely generate an overflow in one of the math
calculations, and pin the resulting value to 0x7FFFFFFF or 0x80000000 (GX's
equivalents to plus and minus infinity). You may also find that *more
pedestrian pairs of quadrilaterals can fail*.
On Tuesday, September 25, 2012 4:50:47 PM UTC-5, Romain Guy (Google) wrote:
>
> bool SkMatrix::setPolyToPoly(const SkPoint src[], const SkPoint dst[],
> int count) {
> if ((unsigned)count > 4) {
> SkDebugf("--- SkMatrix::setPolyToPoly count out of range %d\n",
> count);
> return false;
> }
>
> if (0 == count) {
> this->reset();
> return true;
> }
> if (1 == count) {
> this->setTranslate(dst[0].fX - src[0].fX, dst[0].fY - src[0].fY);
> return true;
> }
>
> SkPoint scale;
> if (!poly_to_point(&scale, src, count) ||
> SkScalarNearlyZero(scale.fX) ||
> SkScalarNearlyZero(scale.fY)) {
> return false;
> }
>
> static const PolyMapProc gPolyMapProcs[] = {
> SkMatrix::Poly2Proc, SkMatrix::Poly3Proc, SkMatrix::Poly4Proc
> };
> PolyMapProc proc = gPolyMapProcs[count - 2];
>
> SkMatrix tempMap, result;
> tempMap.setTypeMask(kUnknown_Mask);
>
> if (!proc(src, &tempMap, scale)) {
> return false;
> }
> if (!tempMap.invert(&result)) {
> return false;
> }
> if (!proc(dst, &tempMap, scale)) {
> return false;
> }
> if (!result.setConcat(tempMap, result)) {
> return false;
> }
> *this = result;
> return true;
> }
>
> On Tue, Sep 25, 2012 at 2:27 PM, TreKing <[email protected] <javascript:>>
> wrote:
> > On Tue, Sep 25, 2012 at 4:19 PM, bob <[email protected]<javascript:>>
> wrote:
> >>
> >> I can't find the source for native_setPolyToPoly though.
> >
> >
> > http://lmgtfy.com/?q=android+native+source
> >
> >
> >
> -------------------------------------------------------------------------------------------------
>
>
> > TreKing - Chicago transit tracking app for Android-powered devices
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to
> > [email protected]<javascript:>
> > To unsubscribe from this group, send email to
> > [email protected] <javascript:>
> > For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
>
>
>
> --
> Romain Guy
> Android framework engineer
> [email protected] <javascript:>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en