Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0d61abba07ed7ae27bc5ee812ef2e178d50c47b4
https://github.com/WebKit/WebKit/commit/0d61abba07ed7ae27bc5ee812ef2e178d50c47b4
Author: Ahmad Saleem <[email protected]>
Date: 2026-09-16 (Wed, 16 Sep 2026)
Changed paths:
M Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
Log Message:
-----------
TransformationMatrix::fromProjection(fovy, aspect, ...) loses precision using
tanf() in double math
https://bugs.webkit.org/show_bug.cgi?id=324300
rdar://187531657
Reviewed by Simon Fraser.
f is declared double but was computed as `1.0f / tanf(fovy / 2)`: tanf()
narrows the argument to float and evaluates the tangent in single
precision, and the 1.0f literal keeps the reciprocal in float, so f only
gets widened back to double after the precision is already gone. Use
double tan() and the 1.0 literal to compute in the declared precision,
matching the six-argument overload directly above. (invDepth's 1.0f is
changed to 1.0 for consistency only; it already evaluated in double.)
No test: both callers narrow the matrix to an XRView.projectionMatrix
Float32Array, so the recovered precision is below the float32 output
resolution, and the affected overload is only reachable through a live
inline XRSession.
* Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::fromProjection):
Canonical link: https://commits.webkit.org/321276@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications