Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2577)

Unified Diff: ui/gfx/geometry/vector3d_f.cc

Issue 2504583003: Fix QuadF::ContainsPoint and gfx::CrossProduct on arm64 (Closed)
Patch Set: quadtest: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/geometry/vector3d_f.cc
diff --git a/ui/gfx/geometry/vector3d_f.cc b/ui/gfx/geometry/vector3d_f.cc
index ddeafe5ee6f2bf142c8ee999bbb8deba9133d329..a834047215cf6ac6954ae1e953ab6369df95c854 100644
--- a/ui/gfx/geometry/vector3d_f.cc
+++ b/ui/gfx/geometry/vector3d_f.cc
@@ -50,9 +50,12 @@ void Vector3dF::Scale(float x_scale, float y_scale, float z_scale) {
}
void Vector3dF::Cross(const Vector3dF& other) {
- float x = y_ * other.z() - z_ * other.y();
- float y = z_ * other.x() - x_ * other.z();
- float z = x_ * other.y() - y_ * other.x();
+ double dx = x_;
+ double dy = y_;
+ double dz = z_;
+ float x = static_cast<float>(dy * other.z() - dz * other.y());
+ float y = static_cast<float>(dz * other.x() - dx * other.z());
+ float z = static_cast<float>(dx * other.y() - dy * other.x());
x_ = x;
y_ = y;
z_ = z;

Powered by Google App Engine
This is Rietveld 408576698