@NonNull
  private ShapeData getShapeData(ShapeData startingShapeData) {
    List<CubicCurveData> startingCurves = startingShapeData.getCurves();
    boolean isClosed = startingShapeData.isClosed();
    int vertices = 0;
    for (int i = startingCurves.size() - 1; i >= 0; i--) {
      CubicCurveData startingCurve = startingCurves.get(i);
      CubicCurveData previousCurve = startingCurves.get(floorMod(i - 1, startingCurves.size()));
      PointF vertex = (i == 0 && !isClosed) ? startingShapeData.getInitialPoint() : previousCurve.getVertex();
      PointF inPoint = (i == 0 && !isClosed) ? vertex : previousCurve.getControlPoint2();
      PointF outPoint = startingCurve.getControlPoint1();

      boolean isEndOfCurve = !startingShapeData.isClosed() && (i == 0 || i == startingCurves.size() - 1);
      if (inPoint.equals(vertex) && outPoint.equals(vertex) && !isEndOfCurve) {
        vertices += 2;
      } else {
        vertices += 1;
      }
    }
    if (shapeData == null || shapeData.getCurves().size() != vertices) {
      List<CubicCurveData> newCurves = new ArrayList<>(vertices);
      for (int i = 0; i < vertices; i++) {
        newCurves.add(new CubicCurveData());
      }
      shapeData = new ShapeData(new PointF(0f, 0f), false, newCurves);
    }
    shapeData.setClosed(isClosed);
    return shapeData;
  }
Returns a shape data with the correct number of vertices for the rounded corners shape.
This just returns the object. It does not update any values within the shape.
lottie/src/main/java/com/airbnb/lottie/animation/content/RoundedCornersContent.java