[Webkit-unassigned] [Bug 52700] Transition from perspective(500px) to 'none' is probably wrong

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 19 11:43:09 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=52700





--- Comment #2 from Chris Marrin <cmarrin at apple.com>  2011-01-19 11:43:09 PST ---
The formula for blendToIdentity is right:

     if (blendToIdentity)
        return PerspectiveTransformOperation::create(m_p + (1. - m_p) * progress);

Because it's blending down to the identity perspective value, which is 1. 

The other case is:

        return PerspectiveTransformOperation::create(decomp.perspectiveZ ? -1.0 / decomp.perspectiveZ : 0.0);

In the other case we construct from and to matrices and then let TransformationMatrix blend them. TransformationMatrix decomposes both matrices and then linearly interpolates all the decomposed values. Then composes the result into a new matrix and returns the value. PerspectiveTransformOperation::blend then decomposes that matrix and picks out the perspective Z value, which is the one we want.

I did it this crazy way because perspective is not linear, so applying a linear interpolation would give us the wrong results.

So I believe the code is correct, although we could certainly optimize the interpolation!

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list