[var] Build end-points array on gvar itself
diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh
index df95a82..d898371 100644
--- a/src/hb-ot-glyf-table.hh
+++ b/src/hb-ot-glyf-table.hh
@@ -574,7 +574,6 @@
       }
 
       bool get_contour_points (contour_point_vector_t &points_ /* OUT */,
-			       hb_vector_t<unsigned int> &end_points_ /* OUT */,
 			       bool phantom_only = false) const
       {
 	const HBUINT16 *endPtsOfContours = &StructAfter<HBUINT16> (header);
@@ -586,13 +585,8 @@
 	for (unsigned int i = 0; i < points_.length; i++) points_[i].init ();
 	if (phantom_only) return true;
 
-	end_points_.resize (num_contours);
-
 	for (int i = 0; i < num_contours; i++)
-	{
-	  end_points_[i] = endPtsOfContours[i];
 	  points_[endPtsOfContours[i]].is_end_point = true;
-	}
 
 	/* Skip instructions */
 	const HBUINT8 *p = &StructAtOffset<HBUINT8> (&endPtsOfContours[num_contours + 1],
@@ -709,7 +703,6 @@
     {
       if (unlikely (depth > HB_MAX_NESTING_LEVEL)) return false;
       contour_point_vector_t points;
-      hb_vector_t<unsigned> end_points;
 
       switch (type) {
       case COMPOSITE:
@@ -722,7 +715,7 @@
         break;
       }
       case SIMPLE:
-	if (unlikely (!SimpleGlyph (*header, bytes).get_contour_points (points, end_points, phantom_only)))
+	if (unlikely (!SimpleGlyph (*header, bytes).get_contour_points (points, phantom_only)))
 	  return false;
 	break;
       default: return false; /* empty glyph */
@@ -746,8 +739,8 @@
       }
 
 #ifndef HB_NO_VAR
-      if (unlikely (!face->table.gvar->apply_deltas_to_points (gid, font->coords, font->num_coords,
-							       points.as_array (), end_points.as_array ()))) return false;
+      if (unlikely (!face->table.gvar->apply_deltas_to_points (gid, font->coords, font->num_coords, points.as_array ())))
+	return false;
 #endif
 
       switch (type) {
diff --git a/src/hb-ot-var-gvar-table.hh b/src/hb-ot-var-gvar-table.hh
index 82bc667..7861bd4 100644
--- a/src/hb-ot-var-gvar-table.hh
+++ b/src/hb-ot-var-gvar-table.hh
@@ -546,8 +546,7 @@
     public:
     bool apply_deltas_to_points (hb_codepoint_t glyph,
 				 const int *coords, unsigned int coord_count,
-				 const hb_array_t<contour_point_t> points,
-				 const hb_array_t<unsigned int> end_points) const
+				 const hb_array_t<contour_point_t> points) const
     {
       coord_count = hb_min (coord_count, gvar_table->axisCount);
       if (!coord_count || coord_count != gvar_table->axisCount) return true;
@@ -569,6 +568,11 @@
       contour_point_vector_t deltas; /* flag is used to indicate referenced point */
       deltas.resize (points.length);
 
+      hb_vector_t<unsigned> end_points;
+      for (unsigned i = 0; i < points.length; ++i)
+	if (points[i].is_end_point)
+	  end_points.push (i);
+
       do
       {
 	float scalar = iterator.current_tuple->calculate_scalar (coords, coord_count, shared_tuples.as_array ());