private void drawCharacterAsGlyph(
      FontCharacter character,
      float fontScale,
      DocumentData documentData,
      Canvas canvas,
      int indexInDocument,
      int parentAlpha) {
    configurePaint(documentData, parentAlpha, indexInDocument);
    List<ContentGroup> contentGroups = getContentsForCharacter(character);
    for (int j = 0; j < contentGroups.size(); j++) {
      Path path = contentGroups.get(j).getPath();
      path.computeBounds(rectF, false);
      matrix.reset();
      matrix.preTranslate(0, -documentData.baselineShift * Utils.dpScale());
      matrix.preScale(fontScale, fontScale);
      path.transform(matrix);
      if (documentData.strokeOverFill) {
        drawGlyph(path, fillPaint, canvas);
        drawGlyph(path, strokePaint, canvas);
      } else {
        drawGlyph(path, strokePaint, canvas);
        drawGlyph(path, fillPaint, canvas);
      }
    }
  }
Elements are reused and not deleted to save allocations.
lottie/src/main/java/com/airbnb/lottie/model/layer/TextLayer.java