Bug 1393077 - Part1. Add IntPointToPoint for Point. r=kats draft
authorEthan Lin <ethlin@mozilla.com>
Thu, 31 Aug 2017 17:56:52 +0800
changeset 656513 4a0f2f371c8eea737374211f79dff95a433dfc54
parent 656512 827e6d8e4585b4b684e2f7cf14236ab8a49226d3
child 656514 f3e85f6da832c3225d6bd5f9021e9c8e1e76fac6
push id77257
push userbmo:ethlin@mozilla.com
push dateThu, 31 Aug 2017 10:21:16 +0000
reviewerskats
bugs1393077
milestone57.0a1
Bug 1393077 - Part1. Add IntPointToPoint for Point. r=kats MozReview-Commit-ID: JEGAcRfJEB
gfx/2d/Point.h
--- a/gfx/2d/Point.h
+++ b/gfx/2d/Point.h
@@ -150,16 +150,22 @@ typedef PointTyped<UnknownUnits> Point;
 typedef PointTyped<UnknownUnits, double> PointDouble;
 
 template<class units>
 IntPointTyped<units> RoundedToInt(const PointTyped<units>& aPoint) {
   return IntPointTyped<units>::Round(aPoint.x, aPoint.y);
 }
 
 template<class units>
+PointTyped<units> IntPointToPoint(const IntPointTyped<units>& aPoint)
+{
+  return PointTyped<units>(aPoint.x, aPoint.y);
+}
+
+template<class units>
 IntPointTyped<units> TruncatedToInt(const PointTyped<units>& aPoint) {
   return IntPointTyped<units>::Truncate(aPoint.x, aPoint.y);
 }
 
 template<class units, class F = Float>
 struct Point3DTyped :
   public BasePoint3D< F, Point3DTyped<units, F> > {
   static_assert(IsPixel<units>::value,