@Override public void draw(Canvas canvas, Matrix parentMatrix, int parentAlpha, DropShadow shadowToApply) {
    if (hidden) {
      return;
    }
    getBounds(boundsRect, parentMatrix, false);

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

    super.draw(canvas, parentMatrix, parentAlpha, shadowToApply);
  }
Cache the gradients such that it runs at 30fps.
lottie/src/main/java/com/airbnb/lottie/animation/content/GradientStrokeContent.java