[Webkit-unassigned] [Bug 83088] New: TransformationMatrix::hasPerspective() should consider the entire bottom row of the matrix

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 3 16:07:58 PDT 2012


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

           Summary: TransformationMatrix::hasPerspective() should consider
                    the entire bottom row of the matrix
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: shawnsingh at chromium.org
                CC: simon.fraser at apple.com, cmarrin at apple.com,
                    vangelis at chromium.org, enne at google.com,
                    reveman at chromium.org


TransformationMatrix::hasPerspective() checks only the 4th row, 3rd column to see that it is non-zero.  I think it is more correct to consider the entire bottom row of the matrix when there is a perspective projection.

Take the following example:

  TransformationMatrix A;
  A.makeIdentity()
  A.applyPerspective(1);
  A.translate(50, 0);
  A.rotate3d(0, 90, 0);

The resulting matrix does have perspective, but the 4th row, 3rd colum element is zero.  Specifically that matrix has a bottom row of  (1, 0, 0, 1).  Technically, its -0.0 on the element, and hasPerspective() is likely to work, but it is probably not a good idea to rely on IEEE floating-point mechanisms to get this correct by luck.

Should we be testing the entire bottom row of elements, instead?  i.e. anything that may cause w != 1 should be considered a perspective projection.

Please let me know if you all agree, and I'll submit a quick two-line patch to fix this.

-- 
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