Use move constructor for points draft
authorMiko Mynttinen <mikokm@gmail.com>
Mon, 08 Aug 2016 13:03:33 -0700
changeset 398868 b16ce9c90a1d7c4ee2d7f4ec754c8a38ddac176a
parent 398867 62ab853cd9b7bfa0b6bef25cc5c86a3e4f7201d1
child 398869 d4fcc75db54bfd50735c15494dc978df89a4742d
push id25661
push userbmo:mikokm@gmail.com
push dateTue, 09 Aug 2016 22:06:19 +0000
milestone51.0a1
Use move constructor for points MozReview-Commit-ID: 765UEuCJh36
gfx/2d/Polygon.h
gfx/layers/BSPTree.cpp
--- a/gfx/2d/Polygon.h
+++ b/gfx/2d/Polygon.h
@@ -20,17 +20,17 @@ template<class Units>
 class BasePolygon3D {
 public:
   explicit BasePolygon3D(const std::initializer_list<Point3DTyped<Units>>& aPoints)
     : mPoints(aPoints)
   {
     CalculateNormal();
   }
 
-  explicit BasePolygon3D(const nsTArray<Point3DTyped<Units>>& aPoints)
+  explicit BasePolygon3D(nsTArray<Point3DTyped<Units>>&& aPoints)
     : mPoints(aPoints)
   {
     CalculateNormal();
   }
 
   const Point3DTyped<Units>& GetNormal() const
   {
     return mNormal;
--- a/gfx/layers/BSPTree.cpp
+++ b/gfx/layers/BSPTree.cpp
@@ -172,14 +172,14 @@ BSPTree::SplitPolygon(const gfx::Polygon
       const gfx::Point3D p = a + (ab * t);
 
       // Add the intersection point to both polygons.
       backPoints.AppendElement(p);
       frontPoints.AppendElement(p);
     }
   }
 
-  return std::make_pair(gfx::Polygon3D(backPoints),
-                        gfx::Polygon3D(frontPoints));
+  return std::make_pair(gfx::Polygon3D(std::move(backPoints)),
+                        gfx::Polygon3D(std::move(frontPoints)));
 }
 
 } // namespace layers
 } // namespace mozilla