@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
  public void draw(Canvas canvas, Matrix matrix) {
    CompositionLayer compositionLayer = this.compositionLayer;
    LottieComposition composition = this.composition;
    if (compositionLayer == null || composition == null) {
      return;
    }
    boolean asyncUpdatesEnabled = getAsyncUpdatesEnabled();
    try {
      if (asyncUpdatesEnabled) {
        setProgressDrawLock.acquire();
        if (shouldSetProgressBeforeDrawing()) {
          setProgress(animator.getAnimatedValueAbsolute());
        }
      }

      if (safeMode) {
        try {
          draw(canvas, matrix, compositionLayer, alpha);
        } catch (Throwable e) {
          Logger.error("Lottie crashed in draw!", e);
        }
      } else {
        draw(canvas, matrix, compositionLayer, alpha);
      }
      isDirty = false;
    } catch (InterruptedException e) {
      // Do nothing.
    } finally {
      if (asyncUpdatesEnabled) {
        setProgressDrawLock.release();
        if (compositionLayer.getProgress() != animator.getAnimatedValueAbsolute()) {
          setProgressExecutor.execute(updateProgressRunnable);
        }
      }
    }
  }
To be used by lottie-compose only.
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java