@Override public void draw(Canvas canvas, Matrix parentMatrix, int parentAlpha, @Nullable DropShadow shadowToApply) {
    if (hidden) {
      return;
    }
    if (L.isTraceEnabled()) {
      L.beginSection("GradientFillContent#draw");
    }
    path.reset();
    for (int i = 0; i < paths.size(); i++) {
      path.addPath(paths.get(i).getPath(), parentMatrix);
    }

    path.computeBounds(boundsRect, false);

    Shader shader;
    if (type == GradientType.LINEAR) {
      shader = getLinearGradient();
    } else {
      shader = getRadialGradient();
    }
    shader.setLocalMatrix(parentMatrix);
    paint.setShader(shader);

    if (colorFilterAnimation != null) {
      paint.setColorFilter(colorFilterAnimation.getValue());
    }

    if (blurAnimation != null) {
      float blurRadius = blurAnimation.getValue();
      if (blurRadius == 0f) {
        paint.setMaskFilter(null);
      } else if (blurRadius != blurMaskFilterRadius){
        BlurMaskFilter blur = new BlurMaskFilter(blurRadius, BlurMaskFilter.Blur.NORMAL);
        paint.setMaskFilter(blur);
      }
      blurMaskFilterRadius = blurRadius;
    }

    float fillAlpha = opacityAnimation.getValue() / 100f;
    int alpha = (int) (parentAlpha * fillAlpha);
    alpha = clamp(alpha, 0, 255);
    paint.setAlpha(alpha);

    if (shadowToApply != null) {
      shadowToApply.applyWithAlpha((int)(fillAlpha * 255), paint);
    }

    canvas.drawPath(path, paint);
    if (L.isTraceEnabled()) {
      L.endSection("GradientFillContent#draw");
    }
  }
Cache the gradients such that it runs at 30fps.
lottie/src/main/java/com/airbnb/lottie/animation/content/GradientFillContent.java