| Summary: | Fix interpolation of the rotate CSS property | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Antoine Quint <graouts> | ||||||||
| Component: | Animations | Assignee: | Antoine Quint <graouts> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | dino, graouts, koivisto, sam, webkit-bug-importer | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | WebKit Nightly Build | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 223876 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Antoine Quint
2021-04-18 01:59:49 PDT
Created attachment 426375 [details]
Patch
Created attachment 426376 [details]
Patch
Comment on attachment 426376 [details] 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. simd stuff is apple-specific ... maybe. other platforms might have versions. And I think it's becoming part of the C++ stdlib. Ask weinig. Another option would be to add a normalize fn to FloatPoint3D. (In reply to Dean Jackson from comment #6) > Another option would be to add a normalize fn to FloatPoint3D. There actually is one :) Created attachment 426379 [details]
Patch for landing
Committed r276231 (236713@main): <https://commits.webkit.org/236713@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426379 [details]. |