Correct normal computation for inverted polygons.
Rather than rely solely the vertices, and their winding
order for sign, we rely on the transform of the previous
normal for the sign, and the vertices (cross product of
edge vectors, similar to Newell's algorithm) for the
numerics of the direction.
BUG=595820
TEST=unittest
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1883623002
Cr-Commit-Position: refs/heads/master@{#386984}
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 75c4797..5bd74b51 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -198,6 +198,9 @@
// Applies the transformation to the point.
void TransformPoint(Point* point) const;
+ // Applies the transformation to the vector.
+ void TransformVector(Vector3dF* vector) const;
+
// Applies the reverse transformation on the point. Returns true if the
// transformation can be inverted.
bool TransformPointReverse(Point3F* point) const;
@@ -266,6 +269,9 @@
void TransformPointInternal(const SkMatrix44& xform,
Point3F* point) const;
+ void TransformVectorInternal(const SkMatrix44& xform,
+ Vector3dF* vector) const;
+
SkMatrix44 matrix_;
// copy/assign are allowed.