[webkit-reviews] review granted: [Bug 224730] Fix interpolation of the rotate CSS property : [Attachment 426376] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 18 08:58:20 PDT 2021


Dean Jackson <dino at apple.com> has granted Antoine Quint <graouts at webkit.org>'s
request for review:
Bug 224730: Fix interpolation of the rotate CSS property
https://bugs.webkit.org/show_bug.cgi?id=224730

Attachment 426376: Patch

https://bugs.webkit.org/attachment.cgi?id=426376&action=review




--- Comment #3 from Dean Jackson <dino at apple.com> ---
Comment on attachment 426376
  --> https://bugs.webkit.org/attachment.cgi?id=426376
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426376&action=review

> Source/WebCore/platform/graphics/transforms/RotateTransformOperation.cpp:66
> +	   auto x = static_cast<float>(op.m_x);
> +	   auto y = static_cast<float>(op.m_y);
> +	   auto z = static_cast<float>(op.m_z);
> +	   auto length = std::hypot(x, y, z);
> +	   return { x / length, y / length, z / length };

Use simd.h here.

auto v = simd_make_float3(static_cast<float>(op.m_x),
static_cast<float>(op.m_y), static_cast<float>(op.m_z));
auto normalized = simd_normalize(v);
return { normalized.x, normalized.y, normalized.z };

Although you might also be able to use simd things through the whole function
and avoid FloatPoint3D.


More information about the webkit-reviews mailing list