[webkit-changes] [WebKit/WebKit] a959ac: TransformationMatrix::Recompose() and Decompose() ...

mattwoodrow noreply at github.com
Tue Aug 29 14:45:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a959acf1111c6f159ea4ada5c4dd6483170b6d0f
      https://github.com/WebKit/WebKit/commit/a959acf1111c6f159ea4ada5c4dd6483170b6d0f
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/transforms/RotateTransformOperation.cpp
    M Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp

  Log Message:
  -----------
  TransformationMatrix::Recompose() and Decompose() incorrectly transpose rotation.
https://bugs.webkit.org/show_bug.cgi?id=220856
<rdar://problem/73747851>

Reviewed by Dean Jackson.

The computation of quaternions during matrix decomposition appeared
to be based off of the matrix transpose. Indexing in the quaternion
calculation is consistent with row-major ordering; however, the "rows"
variable is actually column major order (goes back to the original
implementation of unmatrix in Graphics Gems II).  The rotation matrix
constructed from the quaternions also appeared to be assuming row-major
ordering. These discrepancies were mostly corrected for by flipping the
direction of the quaternion when extracting from the matrix.

This is a (partial) cherry-pick from Blink:
  - https://chromium-review.googlesource.com/c/chromium/src/+/2489727

* Source/WebCore/platform/graphics/transforms/RotateTransformOperation.cpp:
(WebCore::RotateTransformOperation::blend):
* Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::decompose4):
(WebCore::slerp):
(WebCore::accumulateQuaternion):
(WebCore::TransformationMatrix::recompose4):

Canonical link: https://commits.webkit.org/267424@main




More information about the webkit-changes mailing list